----- Original Message -----
From: Michael Gale <[EMAIL PROTECTED]>
Date: Monday, April 4, 2005 11:30 pm
Subject: multiple statments with ||

> Hello,
Yo
> 
> I have the following piece of code:
> 
> --snip--
> if ($_ eq "read") {
>         open(fileid, "/tmp/mysql_lastid") || $lastid=0;
>         $lastid = <fileid>;
>         close(fileid);
>         }
> --snip--
> 
> With the fail of opening the file, I want the variable to be set 
> to zero 
> and print a message to standard out. How can I do both ?

open(fileid, "/tmp/mysql_lastid") or $lastid=0 , print "watch the presidance\n";

> 
> Michael.
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to