in reply to Re^2: File read errors
in thread File read errors

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^4: File read errors
by cdarke (Prior) on Jan 14, 2010 at 09:21 UTC
    Pardon me saying this, but your real coding error was not to check the return result from open.
Re^4: File read errors
by Anonymous Monk on Jan 14, 2010 at 05:06 UTC
    Low blood sugar? Sleep deprivation? Multitasking? Don't sell yourself short, I think you just need a better mantra. To remind myself everything can fail I often use, the also motivational:

    success or else!

    Programming Mantras, The Module Mantra

Re^4: File read errors
by Anonymous Monk on Jan 14, 2010 at 12:42 UTC
    that is not an error!, sometimes you would write a script that would be saved - by default - to the current directory and would work on the current directory, without having to specify a path!, check cwd to know the current working directory the script is saved in...Your error was that you did not tell your program what to do in case it could not open a file handle... beat yourself over that one!!!
    Open(FH, "something.txt") or die ("could not open it $!\n");
    and also through IO::Handle
    use strict; use warnings; use IO::Handle; my $fh = IO::Handle->new; $fh->open('something.txt') or die("could not open file $!\n");

    Watch your language out of courtesy!!!!