Rob Dixon wrote:

> > $filein = $ARGV[0];
> > open(filein, "$filein");
>
> Filehandles are traditionally all uppercase, and it's not
> good to put a variable in quotes unless you have a reason
> to.
>
>     open FILEIN, $filein;

You're right, of course, about the quotes.  It seems to me that this is the downside 
of Perlish convenience.  Since Perl offers variable interpolation within double 
quotes, this can be very confusing to a novice.  Of course, since the facility is 
there, I use it.  Still, I tend to look at such constuctions as:
print "Hello, $User, how are you doing?\n";
as:
print "Hello, " . $User . ", how are you doing?\n";
which, as the error messages returned when $User is undefined make clear, the way the 
interpreter handles it internally--it sees the string in the first line as the 
concatenation shown in the second.

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to