From: Sano Babu <[EMAIL PROTECTED]>
> On 04 Oct 2004 05:15:04 -0700, Randal L. Schwartz
> <[EMAIL PROTECTED]> wrote: 
> >>>>> "John" == John <[EMAIL PROTECTED]> writes: 
> > John> can the above be done with one perl function? 
> > use File::Path qw(rmtree); 
> > rmtree('/some/path/to/the/top'); 
>
> If the directory has read-only
> permission shouldn't the program report "read-only directory. Can't
> delete !" or something without having to explicitly die??  Are the
> semantics heading the right way here?? 

die() does NOT mean "write a message to STDERR and exit the program". 
It means "throw an exception. If noone catches the exception print 
the message to STDERR and exit the program.)

See eval BLOCK in 
        perldoc -f eval

HTH, Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery


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