Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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 drinking their drinks and smoking their pipes about the Monastery: (11)
As of 2015-03-03 11:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When putting a smiley right before a closing parenthesis, do you:









    Results (70 votes), past polls