Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!zaphod.mps.ohio-state.edu!sdd.hp.com!decwrl!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: Novice Question: How is -e supposed to work? Message-ID: <9165@jpl-devvax.JPL.NASA.GOV> Date: 16 Aug 90 21:15:09 GMT References: <1990Aug16.070010.26529@morrow.stanford.edu> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 35 In article <1990Aug16.070010.26529@morrow.stanford.edu> whenry@lindy.stanford.edu (homo obsolescensis) writes: : : I a perl tyro and I am having trouble using the -e switch. the man : pages give the following example: (lets call this file "go") : : #!/usr/bin/perl -pi.bak : s/foo/bar/; : : and intimate that the result of running go on file bas will be a : changed file bas. : : however, when I try any of the following, the results are the same as : if only the -p switch were set. that is, the changes are printed to : the screen only, not to the original file. : : go bas : go bas or : go bas : just clobber bas : : Do I misinterpret what is supposed to be happening? go bas ought to work the way you expect. The file bas should be renamed bas.bak and a new file bas should be created. Is your first line actually #!/usr/bin/perl or is it possibly some longer pathname that happens to be just long enough to wipe out the switch? That's the only thing I can think of, apart from mangled kits. Larry