On May 31, Barry Jones said:
What type of functions are built in to perl for arrays?
Mainly, I'm looking to find out how to see how many elements are in an
array without counting them, but I was wondering about others too.
Arrays have push(), pop(), shift(), unshift(), and splice(). To get
No of elements in an array is given by $#ARRAY_NAME
eg the number of element in an array @array is $#array
-Original Message-
From: Barry Jones [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 31, 2002 11:17 AM
To: Beginners @ Perl (E-mail)
Subject: Simple array question
What type of
oops $#array is the index index of the last element
-Original Message-
From: Shishir K. Singh
Sent: Friday, May 31, 2002 11:23 AM
To: Barry Jones; Beginners @ Perl (E-mail)
Subject: RE: Simple array question
No of elements in an array is given by $#ARRAY_NAME
eg the number
At 11:17 AM 5/31/02 -0400, Barry Jones wrote:
What type of functions are built in to perl for arrays?
Mainly, I'm looking to find out how to see how many elements are in an
array without counting them, but I was wondering about others too.
What about hashes?
perldoc perlfunc lists them under
Sure.
@main = (@data1, @data2, @data3);
Rob
-Original Message-
From: A Taylor [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 21, 2002 10:05 AM
To: [EMAIL PROTECTED]
Subject: simple array question
Hi all,
I have a very simple and probably stupid question to ask.
If I have a set of
Yes but you have to write it like this:
(@main) = (@data1,@data2,@data3);
-Original Message-
From: A Taylor [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 21, 2002 10:05 AM
To: [EMAIL PROTECTED]
Subject: simple array question
Hi all,
I have a very simple and probably stupid question to
Here's how you can do it (this is just one way):
#!/usr/bin/perl
@x = ('a','b');
@y = ('c','d');
@z = ('e','f');
@xyz = (@x,@y,@z);
print @xyz;
Output is : abcdef
Got it!!!
Aman
- Original Message -
From: A Taylor [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, May 21, 2002
On Tue, 21 May 2002 15:17:03 +0100, Barry Jones wrote:
Yes but you have to write it like this:
(@main) = (@data1,@data2,@data3);
No you don't.
@main = (@data1,@data2,@data3);
works just fine.
Dave...
--
Shoot some of those missiles, think of us as fatherless scum
It won't be