Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!europa.asd.contel.com!gatech!usenet.ins.cwru.edu!ncoast!jeffl From: jeffl@NCoast.ORG (Jeff Leyser) Newsgroups: comp.lang.perl Subject: Variable Interp./File Test Op Bug? Message-ID: <1991Jun10.180301.7925@NCoast.ORG> Date: 10 Jun 91 18:03:01 GMT Organization: North Coast Public Access Un*x (ncoast) Lines: 37 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