Phoenix.pm: Perl 101
doug.miles at bpxinternet.com
Fri Jul 7 13:55:12 CDT 2000
I'll add this info into my presentation. I guess it was just something
I had never tried before.
Kevin Buettner wrote:
> On Jul 7, 10:48am, Doug Miles wrote:
> > #!/usr/bin/perl
> > @author = ('Tom', 'Randal', 'Larry');
> > print "@author\n";
> > print @author;
> > print "\n";
> > displays this:
> > Tom Randal Larry
> > TomRandalLarry
> > This surprised me that 'print "@author\n";' interpolates with spaces in
> > between elements. Does anyone know where this is documented?
> Page 43 of the Camel book.
> See also the discussion of $" in the perlvar manpage. The perlop
> manpage also describes it:
> Interpolated scalars and arrays are internally
> converted to the join and . Perl operations,
> thus "$foo >> '@arr'"> becomes:
> $foo . " >>> '" . (join $", @arr) . "'";
> (Note the typo however.)
Don't anthropomorphize computers. They hate that.
More information about the Phoenix-pm