perl array - what is?
Perl Arrays:
Array is a collection of ordered elements, which is assigned by more than one elements like scalars,strings,numbers,floating points etc.
Creating Arrays:
Method 1:
Method 2:
Method 3:
Method 4:
Method 5:
Method 6:
Method 7:
Method 8:
Array is a collection of ordered elements, which is assigned by more than one elements like scalars,strings,numbers,floating points etc.
Creating Arrays:
Method 1:
@array=(8,1,3,-6,2); print @array;
Method 2:
@array=('one',two,'five'); print @array;
Method 3:
@array =(0) x 10; print @array;
Method 4:
@array = (1..10);
Method 5:
@array=qw(one two five);
Method 6:
@array=qw(one two five); @new=@array;
Method 7:
push(@a,1..4); print @a;
Method 8:
unshift(@b,1..4); print @b;
Labels: array create, perl array
0 Comments:
Post a Comment
Note: only a member of this blog may post a comment.
<< Home