Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^3: Perl script to delete files using regex

by Bod (Parson)
on Nov 24, 2020 at 01:01 UTC ( [id://11124101]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Perl script to delete files using regex
in thread Perl script to delete files using regex

Yes indeed - much nicer and much more Perl-ish!

I deliberately didn't write it that way though so that CarlosN could (hopefully) understand what is going on.

  • Comment on Re^3: Perl script to delete files using regex

Replies are listed 'Best First'.
Re^4: Perl script to delete files using regex
by GrandFather (Saint) on Nov 24, 2020 at 01:30 UTC

    Clarity is rather in the eye of the beholder. But as a general thing smaller code (as long as it's not obfuscated) is easier to unpack. In this case there are two Perlish things that are likely to trip up a novice. The first is grep which is easy to find documentation for. The second is the list assignment which is kinda hard to formulate a good search for!

    The saving grace is for novices who don't know what they don't know the assignment looks kinda innocuous and it's likely their eyes just glaze over for a moment as they recognize it as a wobbly assignment and move on. For this example that's pretty much OK because the real lesson is filtering a list. That said, YMMV!

    Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11124101]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-20 14:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found