On 12/7/13 at 17:35, [email protected] (Dr.Ruud) wrote:
perl -0 -wple 's/^start\n(.*?)\nend\n/$_=$1;y{\n}{ };"$_\n"/emgs'
Pure obfuscation! Why not keep things simple?! These stupid
one-liners are a pain in the brain.
#!/usr/bin/perl
use strict;
my @items;
while (<>) { # or use a file handle
chomp;
next if /^start/;
if (/^end/) {
print join ", ", @items;
print "\n";
undef @items;
} else {
push @items, $_;
}
}
JD
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/