in reply to Strange File Not Found Error

I'd just like to add that the fragment
open LABS, "/software/polaris-mfcf/data/local/w.stat" or die "Unable to open file: $!\n";
doesn't do what you expect it to, IIRC. In reality, it's saying something like:
open LABS, ("/software/polaris-mfcf/data/local/w.stat" or die "Unable to open file: $!\n")
The or operator bonds to the string "/software/...", not to the open command. You'll want to do this instead
open (LABS, "/software/polaris-mfcf/data/local/w.stat") or die "Unable to open file: $!\n";

Update: Well! I'll be hogtied: "or" != "||". I had always assume that "or" and "and" were just common language equals to their || && counterparts. I didn't know their behaviors where different.

mr.nick ...

Replies are listed 'Best First'.
Re: Re: Strange File Not Found Error
by nardo (Friar) on Jun 15, 2001 at 01:34 UTC
    The or operator bonds to the string "/software/...", not to the open command

    That's the || operator, not the or operator:
    open FILE, "doesnotexist" or print "or\n"; open FILE, "doesnotexist" || print "|| #1\n"; open(FILE, "doesnotexist") || print "|| #2\n";