|Problems? Is your data what you think it is?|
Re: Re: remove backupsby Sidhekin (Priest)
|on Nov 05, 2002 at 12:07 UTC||Need Help??|
... chomp $dirname - why?
To get rid of that pesky newline. (Yes, there is one.)
... define the scalar $dirname - why?
That he may print it (in the last line)?
... use a system call to rm, making it platform dependant. Why not use unlink?
Opening "ls *~|" already makes it platform dependent. Of course, that could be glob("*~"), so your question still stands ...
... empty the entire directory from which this is run - why not use rm * | del *.* | whatever?
I think you miss the point: the alternative would be rm *~, which is quite easy to get wrong. Or at least easy enough to make guys like me paranoid.
Me, I have a bash function for this sort of thing:
If it ever gets complicated enough that I make a Perl script out of it, I'll probably make it platform independant. For now, it does the job.