I've got a one-liner in perl that works at the command line, but doesn't work within my script..
...am I just not using the one-liner in perl correctly? Otherwise.. How else can I easily select a block of text from a variable containing multiple lines and print it..?
Code:
from the command line...
$perl -ne 'print if /Begin of text select/ .. /End of text select/' input.txt > output.txt
Code:
#within the script..
$content =~ /Begin of text select/ .. /End of text select/;
print $content;
...am I just not using the one-liner in perl correctly? Otherwise.. How else can I easily select a block of text from a variable containing multiple lines and print it..?