in reply to Problem with do statement

You need a semicolon after the end of the do block to finish the statement.

I'm curious why you want to do that. The standard open my $fh, '<', $file or die 'Error xxx'; would have the same effect, but could run unattended.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re^2: Problem with do statement
by revdiablo (Prior) on Apr 18, 2005 at 17:22 UTC

    To throw a random guess, I would say he might be running the program by double-clicking on an icon from something like Windows Explorer. It opens the script in a terminal window, and executes, but then closes as soon as the program finishes. If there was an error message displayed, it would disappear nearly instantly.