CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
File deletion

 



waherne
Novice

Mar 12, 2000, 7:07 AM

Post #1 of 2 (675 views)
File deletion Can't Post

Hi,

How do you delete a selected file?

e.g. ./mydir/deletethis.txt

Thanks for any assistance that you can provide.

Willie


Cure
User

Mar 11, 2000, 10:10 PM

Post #2 of 2 (675 views)
Re: File deletion [In reply to] Can't Post

Hi waherne

perldoc -f unlink

example(s)::

$path='the/path/directory/;
$file='new.txt';
unlink("$path/$file");


but if your in the same directory as the file you are trying to delete, then do this::


$file='new.txt';
unlink($file);

Cure;

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives