Beefy Boxes and Bandwidth Generously Provided by pair Networks httptech
go ahead... be a heretic
 
PerlMonks  

Re: File Not Found in Attempt To Unlink

by BeernuT (Pilgrim)
on Feb 06, 2002 at 21:07 UTC ( [id://143777]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to File Not Found in Attempt To Unlink

this might not be wrong. but it makes more since. Your while statement reads the array in as 0,1,2,3.... But you then set $x = pop(@delete_me); which removes the last element of @delete_me and sets it to $x. Doesnt make to much since to me. so lets rewrite it as.

foreach (@delete_me) { my $file = $_; unlink $file or die "Can't unlink $file : $!\n"; }

or you can simple do
foreach (@delete_me) { unlink $_ or die "Can't unlink $file : $!\n"; }


-bn

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://143777]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.