Re: How do I delete a file

2002-05-16 Thread Todd Wade,,,Room 108
Connie Chan wrote: unlink($_) for @$filelist ; Heehee.. Thanks a lot !!! I really don't know for loop can be writtern in this way [trwww@misa trwww]$ perldoc -f unlink unlink LIST unlink Deletes a list of files. Returns the number of files successfully

How do I delete a file

2002-05-15 Thread A Taylor
I have written a script that searches through a directory and finds files that are no longer needed - these files are actually image files - .jpg or ..gif extensions. But how do I actually delete the unused files ? Any help would be greatly appreciated Thanks in advance Anadi PS: And

Re: How do I delete a file

2002-05-15 Thread Frank Wiles
On Wed, 15 May 2002 16:43:14 + A Taylor [EMAIL PROTECTED] wrote: I have written a script that searches through a directory and finds files that are no longer needed - these files are actually image files - .jpg or ..gif extensions. But how do I actually delete the unused files ?

RE: How do I delete a file

2002-05-15 Thread Jackson, Harry
-Original Message- From: A Taylor [mailto:[EMAIL PROTECTED]] I have written a script that searches through a directory and finds files that are no longer needed - these files are actually image files - .jpg or ..gif extensions. But how do I actually delete the unused files ?

Re: How do I delete a file

2002-05-15 Thread Alan Drew
To delete files, use unlink - just as you would in the Unix terminal: e.g [mag-17 scripts]$ perl -e ' unlink foo.bar ' this deletes the file foo.bar. A. On Wednesday, May 15, 2002, at 04:43 PM, A Taylor wrote: I have written a script that searches through a directory and finds files that

Re: How do I delete a file

2002-05-15 Thread Connie Chan
@filelist = your_search_script_result(); for (@filelist) { unlink ($_) } - Original Message - From: A Taylor [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, May 16, 2002 12:43 AM Subject: How do I delete a file I have written a script that searches through a directory

Re: How do I delete a file

2002-05-15 Thread drieux
On Wednesday, May 15, 2002, at 10:14 , Connie Chan wrote: @filelist = your_search_script_result(); for (@filelist) { unlink ($_) } now you're showing some step forward my complements! for those who are wondering why beginners are here, it's to learn and pass along that which they have

Re: How do I delete a file

2002-05-15 Thread Connie Chan
you might want to think in terms $filelist = your_search_script_result($dir, $recurse, $pattern, $suffix); Hmm... I don't know, and not sure =) The writer mensioned he already wrote the script for searching matched files, and suppose it would get the file as a list... unlink($_) for

Re: How do I delete a file

2002-05-15 Thread drieux
On Wednesday, May 15, 2002, at 02:48 , Connie Chan wrote: you might want to think in terms $filelist = your_search_script_result($dir, $recurse, $pattern, $suffix); Hmm... I don't know, and not sure =) The writer mensioned he already wrote the script for searching matched files,and

Re: How do I delete a file

2002-05-15 Thread John W. Krahn
Connie Chan wrote: unlink($_) for @$filelist ; Heehee.. Thanks a lot !!! I really don't know for loop can be writtern in this way. My complement, why I try to respond something what I knew, because it sometimes give me some smater ideas on the same stuff. =) It _could_ also be

Re: How do I delete a file from Perl?

2002-01-14 Thread Connie Chan
day =) - Original Message - From: Randolph S. Kahle [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, January 13, 2002 12:21 AM Subject: How do I delete a file from Perl? I am writing my first perl program (copied from a magazine). The only line that is not working is system

RE: How do I delete a file from Perl?

2002-01-12 Thread Bob Showalter
-Original Message- From: Randolph S. Kahle [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 12, 2002 11:22 AM To: [EMAIL PROTECTED] Subject: How do I delete a file from Perl? I am writing my first perl program (copied from a magazine). The only line that is not working

How do I delete a file from Perl?

2002-01-12 Thread Randolph S. Kahle
I am writing my first perl program (copied from a magazine). The only line that is not working is system( rm -rf $file ); The error message is: Can't call method rm with a package or object reference. Any tips? Thanks -- Randy -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: How do I delete a file from Perl?

2002-01-12 Thread Steve Maroney
try using unlink instead. On 12 Jan 2002, Randolph S. Kahle wrote: I am writing my first perl program (copied from a magazine). The only line that is not working is system( rm -rf $file ); The error message is: Can't call method rm with a package or object reference. Any tips?

Re: How do I delete a file from Perl?

2002-01-12 Thread Ahmed Moustafa
Randy, You can delete a file, or a list of files, using unlink. Example: ## unlink $file; ## perldoc -f unlink Hope that helps. Ahmed [EMAIL PROTECTED] | http://www.photo.net/user/ahmed Randolph S. Kahle wrote: I am writing my first perl program (copied from a magazine). The only line

RE: How do I delete a file from Perl?

2002-01-12 Thread Gary Hawkins
system(rm -rf $file); But if you copied this from another source, that source was totally unaware that deletion of files like THAT is TOTALLY unsafe. A safer approach is: system(rm, -rf, $file); I'm not aware of the reason for it. What's a good way to find which perl doc contains

Re: How do I delete a file from Perl?

2002-01-12 Thread Tanton Gibbs
The rm -rf $file should be in quotes system( rm -rf $file ) but make sure file isn't / !!! :) - Original Message - From: Randolph S. Kahle [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, January 12, 2002 11:21 AM Subject: How do I delete a file from Perl? I am writing my

Re: How do I delete a file from Perl?

2002-01-12 Thread Ahmed Moustafa
It's perldoc -f system not perldoc system. --Ahmed Gary Hawkins wrote: system(rm -rf $file); But if you copied this from another source, that source was totally unaware that deletion of files like THAT is TOTALLY unsafe. A safer approach is: system(rm, -rf, $file); I'm not aware of

RE: How do I delete a file from Perl?

2002-01-12 Thread Jeff 'japhy' Pinyan
On Jan 12, Gary Hawkins said: system(rm -rf $file); But if you copied this from another source, that source was totally unaware that deletion of files like THAT is TOTALLY unsafe. A safer approach is: system(rm, -rf, $file); I'm not aware of the reason for it. Multi-arg system()

Re: How do I delete a file from Perl?

2002-01-12 Thread Elias Assmann
system( rm -rf $file ); Any tips? Try 'system(rm, -rf, $file)'. The quotes are not really necessary here (I think), but you should use them, because otherwise rm and rf will be interpreted as barewords, and you might get in conflict with the reserved ones. HTH, Elias -- To

Re: How do I delete a file from Perl?

2002-01-12 Thread Jeff 'japhy' Pinyan
On Jan 12, Randolph S. Kahle said: The only line that is not working is system( rm -rf $file ); You (or they) have forgotten the quotes: system(rm -rf $file); But if you copied this from another source, that source was totally unaware that deletion of files like THAT is TOTALLY unsafe. A