On Mon, 19 Jan 2004, Mallik wrote:

> I have the following code
> 
> unless(-d $dir)
> {
>    unless(mkdir $dir)
>    {
>       print "Error\n";
>    }
> }
> 
> Can I rewrite the above code in the following way
> 
> unless (-d $dir | mkdir $dir)
> {
>    print "Error\n";
> }
> 


Well that works for me and || works as well

I'm not sure how you get to generate an error, unless you don't have
permission to mkdir


Owen


-- 
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