At 12:03 pm -0600 24/12/04, Adam Butler wrote:

What it's doing is opening the file for reading, and if the file doesn't
exist it creates it....


Open(GAMELOG, "$file"); @entries = <GAMELOG>; close(GAMELOG);

You've had your answer. in your script 'Open' means nothing and the file won't be created even if you use 'open'.



#!/usr/bin/perl chdir "/tmp"; $log = "game.log"; open LOG, ">$log" or die $!; # ---> > ! print LOG "success !"; close LOG; open LOG, $log; for (<LOG>) { print };


Make it a rule NEVER to open a filehandle without testing.

JD

Reply via email to