[comp.lang.perl] Variable Interp./File Test Op Bug?

jeffl@NCoast.ORG (Jeff Leyser) (06/11/91)

Is this a case of the compiler being buggy, or the progammer being buggy?
On a Motorola Delta 8000 running SVR3, using the file test operators and
variable interpolation, I get some interesting results:

-------------------Source Code--------------
eval '/usr/local/bin/perl -S $0 ${1+"$@"}; exit' if 0;
$HOME="/usr/acct/source";
$MMDD=`date +%m%d`;

print "without interpolation -r returns: "
i			,(-f "/usr/acct/source/file0610"),"\n";
print "with interpolation at end -r returns: "
			,(-f "/usr/acct/source/file$MMDD"),"\n";
print "with interpolation at begining -r returns: "
				,(-f "$HOME/file0610"),"\n";

----------------Output--------------------

without interpolation -r returns: 1
with interpolation at end -r returns: 
with interpolation at begining -r returns: 1

---------Perl info------------------

This is perl, version 4.0

$RCSfile: perl.c,v $$Revision: 4.0.1.1 $$Date: 91/04/11 17:49:05 $
Patch level: 3

Copyright (c) 1989, 1990, 1991, Larry Wall

Perl may be copied only under the terms of the GNU General Public License,
a copy of which can be found with the Perl 4.0 distribution kit.
-- 
Jeff Leyser                                     jeffl@ncoast.org
Opinions?  I thought this was typing practice!  leyser@tsa.attmail.com