Phoenix.pm: Perl 101

Doug Miles doug.miles at bpxinternet.com
Fri Jul 7 15:23:20 CDT 2000


In retrospect, it makes sense.  Its a feature to conveniently print out
an array without using join.  I wish I had run across this sooner. :( 
I've always been using join.

Bryan Lane wrote:
> 
> That's interesting.  That's not what I expected either.
> 
> -----Original Message-----
> From: doug.miles at bpxinternet.com [mailto:doug.miles at bpxinternet.com]
> Sent: Friday, July 07, 2000 10:49 AM
> To: Phoenix.pm
> Subject: Phoenix.pm: Perl 101
> 
> Thanks to all those who made it out last night.  We had a good turnout,
> and hopefully we'll get some new regulars.  To answer a couple of
> questions from last night (and raise a new question):
> 
> #!/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?  I checked
> perop, but couldn't seem to find it there.
> 
> Also, the range operator (..) does not work in reverse, i.e.
> @author[2..1].  It only works to increment through the range, not
> decrement.
> 
> --
> - Doug
> 
> Don't anthropomorphize computers. They hate that.

-- 
- Doug

Don't anthropomorphize computers. They hate that.



More information about the Phoenix-pm mailing list