Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: Print all derefs and method calls in a directory (Friday golf)

by ikegami (Patriarch)
on Jan 09, 2009 at 13:03 UTC ( [id://735162]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Print all derefs and method calls in a directory (Friday golf)
in thread Print all derefs and method calls in a directory (Friday golf)

Since you're using 'say', you have to use '-E' instead of '-e'.

Oops!

it will either remove a leading '(' or a leading '--', '-+', '+-' or '--')

Oops!

[+-]{2} is not equivalent to \+\+|--

Indeed, but I deemed it acceptable.

if you're golfing, you shouldn't make a capture if you aren't using the result.

Not until Perl6. /...(?:...|...)/ is longer than /...(...|...)/. (Multiplying out the leading subexpression would have been shorter, but that's not the issue you raised.)

I take your 69 and give you 51:

perl -nE'/[-+(]*(\S{3,}->\S{5,})/&&say$1' *|sort -u

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2024-03-28 21:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found