LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 05-28-2002, 07:46 AM   #1
berry
LQ Newbie
 
Registered: Nov 2001
Location: Klazienaveen - Netherlands
Distribution: SuSE 7.0;Mandrake 8.1
Posts: 25

Rep: Reputation: 15
Perl and file deletion


Hi all,

This seems like a stupid question, but I just can't find out how to delete a file using a Perl function. I can delete a file using a system command like 'rm', but I want to write portable scripts.
Am I blind or does such a function just not exist in Perl (which a can't imagine)?

Thanks,
Berry Vos
 
Old 05-28-2002, 12:54 PM   #2
vfs
Member
 
Registered: Apr 2002
Location: Brazil
Distribution: Slackware
Posts: 184

Rep: Reputation: 30
Ooh, I can't see my feet!!! Just kidding!

Do a 'man perlfunc' to learn about the Perl functions.

The function you need is remove() . Remember, C has the same function, so don't ask it if you want to use C someday .

HTH,

vfs
 
Old 05-28-2002, 03:31 PM   #3
MartBrooks
Member
 
Registered: May 2002
Location: London
Distribution: Debian
Posts: 388

Rep: Reputation: 31
Actually, I thought the function was called unlink()

Regards
 
Old 05-29-2002, 01:34 AM   #4
berry
LQ Newbie
 
Registered: Nov 2001
Location: Klazienaveen - Netherlands
Distribution: SuSE 7.0;Mandrake 8.1
Posts: 25

Original Poster
Rep: Reputation: 15
It's unlink allright. Thanks!
As I said, I tought I was stupid that I couldn't find such a function.

I'm glad that not all people around here give smart-ass answers like vfs ( n *not* kidding).

Thanks again
 
Old 05-29-2002, 06:42 AM   #5
vfs
Member
 
Registered: Apr 2002
Location: Brazil
Distribution: Slackware
Posts: 184

Rep: Reputation: 30
I'm quite sure Perl has both functions...

Try 'man perlfunc' or 'perldoc -f remove'
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
File Deletion mhkhalqani Linux - General 1 10-12-2005 03:08 AM
secure file deletion shawn59 Linux - Security 2 06-12-2005 09:00 PM
File Deletion Script disinformation Linux - Software 3 04-18-2005 07:00 AM
Problem with file-deletion after a while JohnWayne Linux - General 3 07-26-2004 12:57 PM
perl(Cwd) perl(File::Basename) perl(File::Copy) perl(strict)....What are those? Baldorg Linux - Software 1 11-09-2003 08:09 PM


All times are GMT -5. The time now is 07:17 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration