understood! ok now if the *.bak file exists would I say something like: in order to make a bakup or a bakup
use warnings; use strict; my @ejectapes = qw(/usr/local/bin/perld/exports); ($^I, @ARGV) = ('.bak', @ejectapes); if ( -s '.bak' ) { rename (".bak", ".bak1") || die "cannot rename file: $! ";a } while (<>) { s/(^E?\d{5})/eject\t0,0,0\t$1\n/; print; } Isn't there a File:Copy module? Derek B. Smith OhioHealth IT UNIX / TSM / EDM Teams "JupiterHost.Net" <[EMAIL PROTECTED]> 05/27/2004 01:19 PM To: [EMAIL PROTECTED] cc: [EMAIL PROTECTED] Subject: Re: entering text within a file [EMAIL PROTECTED] wrote: > > no.... thanks! but why are you setting ejectapes as an array and then > calling it with @ instead of $? > > > my @ejectapes = qw(/usr/local/bin/perld/exports); > ($^I, @ARGV) = ('.bak', @ejectapes); > > instead of > > my @ejectapes = qw(/usr/local/bin/perld/exports); > ($^I, @ARGV) = ('.bak', $ejectapes); because : 0) @ejectapes is not the same as $ejectapes :) 1) =qw() is an array 2) you're assigning it to @ARGV which is also an array, so array need to be used instead of variables, if you did it the scalar way and aded something to qw() like my @ejectapes = qw(/usr/local/bin/perld/exports /foobar/tapes /baz/wal/tapes); It would only loop throught the first one since that's the only one you're using :) HTH Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>