in reply to list array

TIMTOWDI

@ary = 0 .. 10; print "$_\n" for @ary; print map { $_.$/ } @ary; print join $/, @ary; { local $, = "\n"; print @ary; } { local $" = "\n"; print "@ary"; }

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Replies are listed 'Best First'.
Re: Re: list array
by BrowserUk (Patriarch) on Feb 19, 2003 at 03:35 UTC

    You missed one:)

    C:\test>perl -le"@a=1..10; print for @a"

    I find the number of times I don't want a newline after a print to be very much smaller than the number of times I do, so most of my scripts have the -l switch on the shebang line. I find it easier to disable it on the rarer occasions when I don't want it.

    { local $\; print for @a; }

    Examine what is said, not who speaks.

    The 7th Rule of perl club is -- pearl clubs are easily damaged. Use a diamond club instead.