Boss this is the main issue with most of the guys here on perlmonks.
They think everything should be in perl itself and think that pure perl can take them to the other side.
When something gets stuck, then go out to CPAN or post another query here.
We have a unix system and should recognize the power of that OS which has been there since 30 years ago.
What is the problem there in shipping out something to shell when the work gets done easily. After all, perl also was derived from unix itself.
Tools are just tools (the old comment) and simply use them to get the job done.
Now someone will say your script has to be portable, and blah blah.
These are all minor things I would say.
Regarding that question now. The original question lists the output of ls -lrt.
This is a simple script and we can forget about execution speed here.Any intelligent guy would never run the script without reading the code. He would first list out the files instead of deleting them. But since this code is workable (tested few times on my home directory), so I had to put that rm -rf there.
Can't write more now. Leave it....
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.