Linux.com

Oh Dear, lets look at arrays again

Posted by: Administrator on July 07, 2004 10:52 PM
Why not try below instead:
<TT>@users = ('eric', 'billy', 'eddie', 'yngwie');
for ($i=0; $i <= $#users; $i++)
{
     print "$users[$i]\n";
}</TT>
Semicolons are required. Managing to confuse Perl beginners about how to print out *all* the values from an array is not!

#

Return to SysAdmin to SysAdmin: Approaching Perl