473,406 Members | 2,281 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

how to test an array in Perl?

47
I have a question about testing.

such as I have a 20 lines of text and each of them will be save in an array.

and I did print it out as a result.

and now. I just want to test whether those text block is set in an array . or now...
Mar 7 '11 #1
1 1353
numberwhun
3,509 Expert Mod 2GB
Depending on the length of each line, you could always do a comparison of each line with each element of the array and see if you can find a match.

Try to code it and if you have trouble, paste what code you tried, here (enclosed in code tags of course), and we will assist you.

Regards,

Jeff
Mar 7 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: John Ramsden | last post by:
I have a perl logging module that sends log messages, via post variables, to a simple PHP web app whose purpose is to write them to a database table. The module is organized in the standard...
3
by: David F. Skoll | last post by:
Hi, I'm tearing my hair out on this one. I'm trying to embed a Perl interpreter into a C program. I need to be able to create and destroy the interpreter periodically, but will never actually...
2
by: gfs X | last post by:
Hi, Im a complete noob to perl. Is there a way to convert array values into a string? For example @myarr=("Sample","test","Array"); My desired output: "SampletestArray" To then work with as...
13
by: Kevin | last post by:
Help! Why are none of these valid? var arrayName = new Array(); arrayName = new Array('alpha_val', 1); arrayName = ; I'm creating/writing the array on the server side from Perl, but I
9
by: Steve Wasser | last post by:
I need to sort a two-dimensional array. Each day I process a file with 9 comma-delimited fields, and varying amount of records (lines). I want to pull in each line, split it according to the comma...
6
by: Alan Roberts | last post by:
In VB6 I had a function that tested whether an array had any items in it as follows Public Function ArrayIsEmpty(TestVar As Variant) As Boolean On Error Resume Next Dim i As Long i =...
6
by: gopalsd | last post by:
Hi Friends, Can anyone pls help me to resolve my school test in PERL................ as follows..... #!/usr/bin/perl @data=N; $sum=0; print"enter the required No. of numbers to be inputed...
1
by: Arjun234 | last post by:
hi, I have a program to calculate the distance. its like this: open(IN, "/path/outModified.pl") or die "$!"; while (my $line = <IN>) { chomp($line); my @array = (split (/\s+/, $line)); #...
0
by: sweetindi | last post by:
Okay,ive been working on this for a long time now and i cant seem to figure a way to make this code work. I simply need to split a FASTA file that has no spaces into one with spoaces so i can...
2
BeemerBiker
by: BeemerBiker | last post by:
I cannot get the following code to work unless I (1) Change <id> to anything else, or (2) Add an empty section to the bottom of my xml file. Could this be a bug in 5.10.1 ActivePerl or my test...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.