in reply to problem opening and reading from a file

You didn't say what happens when it "doesn't work" but I'm guess you mean that the script die()s. If that's the case you can find out what went wrong by including the special $! variable in your die() message. For example:

    open(OUT,">/foo.csv") or die "Cannot open output file: $!";

Then when you run the script you'll see a message indicating what exactly is wrong. For example, if I run the above code without permission to open '/foo.csv' I'll see:

    Cannot open output file: Permission denied

-sam

Replies are listed 'Best First'.
Re: Re: What the @#%* lost again!
by Nkuvu (Priest) on Jul 02, 2003 at 21:21 UTC

    I dunno, I thought the inclusion of this error was a pretty good indication of what doesn't work:

    syntax error at test.pl line 4, near "open" Execution of test.pl aborted due to compilation errors

    Or maybe I'm just reading too much into it. ;)

      Huh, right you are. I somehow managed to read right past that.

      -sam

        If I had a nickel for every time I'd done the exact same thing, I'd have, uh...

        Well I'd have a lot of nickels.