Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Regex and writing lines in file

by choroba (Canon)
on Apr 30, 2013 at 11:24 UTC ( #1031389=note: print w/ replies, xml ) Need Help??


in reply to Regex and writing lines in file

Perl regular expressions are powerful. This kind of activity would be considered obfuscation, though, and I would not recommend it for production code:

perl -pe 's/.*pattern\n$/<>for 1..3;$_/e'
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


Comment on Re: Regex and writing lines in file
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2015-07-05 10:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (61 votes), past polls