you know, our super webmaster perl guy said that you shouldn't use || in die
statements, because in the order of precedence || comes before 'or' and that
in a die statement, it can mess things up.
now, I question his opinion seeing as how EVERYONE uses || instead of 'or'.
can you clarify?
-----Original Message-----
From: Chris Milligan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 25, 2001 12:45 PM
To: [EMAIL PROTECTED]
Subject: Re: checking for true/false after a command has run
Stephanie Stiavetti wrote:
> thank you all for your help with regexp... you folks are awesome.
>
> another question. I'm writing a script where I need to append a file, and
> I'd like it to do one thing if the command is successful, and another if
it
> fails. how do I check to make sure it successfully appended the file?
>
> here's my code:
>
> open (REZFILE, "$>>rezFile") or die "ew! can't open $rezFile! $!\n";
I think the problem is your open. the line should read:
open (REZFILE, ">>$rezFile") || die "ew! can't open $rezFile! $!\n";
The "$" is in the wrong place and use the logical or symbol "||"
Hope this helps.
Chris
-- Life would be so much easier if we could just look at the source code.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]