in reply to Help With Perl and Files

Instead of
open (MYFILE, '>>$file'); print MYFILE "$\@_[0]:$\@_[1]:$\@_[2]:$\@_[3]:$\@_[4]:$\@_[5]:$\@_[6]: +$\@_[7]:$\@_[8]:$\@_[9]:$\@_[10]:$\@_[11]:$\@_[12]:$\@_[13]:$\@_[14]" +; close (MYFILE);
Simply use:
open (MYFILE, '>>$file'); print MYFILE join(":",@tapes_to_eject); close (MYFILE);
Also,why are you escaping to shell to touch the file? open takes care of this. You should also get the date using a Perl idiom, not the system's date utility.

If you want to use system utilities like this, you might be better of just writing a shell script.

Replies are listed 'Best First'.
Re^2: Help With Perl and Files
by Anonymous Monk on Sep 28, 2007 at 22:41 UTC
    Hey, thanks for the response...I was confused about using open - I thought the file had to exist first and was just making it more difficult. When I get frustrated with perl I escape to shell until I can get it worked out with perl. Your post really helped and led me down the right path. Thanks.