in reply to Re: printing arrays
in thread printing arrays
Once you have the list that you want to print; you don't need to use a join join, instead you can just print it with $, set appropriately. $, is also known as $OFS and
$OUTPUT_FIELD_SEPARATOR; use perldoc perlvar.
This can be much more efficient even with small lists.
rir
Be well,my @arr = ( 1, "Ali", 2, "Bobbi", 3, "Charli" ); local $, = " "; print @arr, $/;
rir
Updated: join usage
Updated: efficiency comment deleted.
In Section
Seekers of Perl Wisdom