Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool.mu.edu!sol.ctr.columbia.edu!ira.uka.de!tmipi4!fuchs From: fuchs@tmipi4.telematik.informatik.uni-karlsruhe.de (Harald Fuchs) Newsgroups: comp.lang.perl Subject: Re: Novice surprise Message-ID: Date: 12 Feb 91 01:37:45 GMT References: <11393@jpl-devvax.JPL.NASA.GOV> Sender: news@ira.uka.de (USENET News System) Organization: University of Karlsruhe, FRG Lines: 16 lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) writes: >I think that most people avoid the problem by not using filenames beginning >with + or >. If you really want to write a bulletproof script, you might >put the following before the initial loop: >for (@ARGV) { s#^([^/])#./$1#; s#$#\0#; } >while (<>) {... Shouldn't that be for (@ARGV) { s#^[^./]#./$&#; s#$#\0#; } Note the period: ^ -- Harald Fuchs *gulp*