Phoenix.pm: Perl 101

Bryan Lane Bryan.Lane at VITALPS.COM
Fri Jul 7 15:01:54 CDT 2000


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.



More information about the Phoenix-pm mailing list