Try
perl -wne 'BEGIN {$b= "";} if (/\47[1-4]\47/) {$b= $_.$b;} elsif (/\47 +[5]\47/) {print $b, $_; $b= "";} else {print;}'
I'm not sure if it does what you want.
In reply to Re: sed to perl conversion
by ambrus
in thread sed to perl conversion
by NovMonk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |