Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: The 'eval "require $module; 1"' idiom

by sedusedan (Monk)
on Apr 19, 2014 at 12:02 UTC ( [id://1082890]=note: print w/replies, xml ) Need Help??


in reply to Re: The 'eval "require $module; 1"' idiom
in thread The 'eval "require $module; 1"' idiom

Thanks for pointing out about the general term. Although the majority of the general form is for require/use, people do use it for other purposes too:

http://grep.cpan.me/?q=if+%5C%28eval+%22.%2B%3F%3B+1%22

  • Comment on Re^2: The 'eval "require $module; 1"' idiom

Replies are listed 'Best First'.
Re^3: The 'eval "require $module; 1"' idiom
by davido (Cardinal) on Apr 19, 2014 at 17:04 UTC

    I wish the grep.cpan.me supported lookaheads and lookbehinds, which would allow me to search a little more specifically for situations where the idiom is used outside of the "require" and "use" use case. If it did, I might try something like:

    if \(eval ["'](?!require|use).+?;\s*1;?["']

    Dave

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 22:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found