The alternative the grandparent suggested
print("error message\n"), next if /^>>/;
could easily be confused for
print("error message\n"); next if /^>>/;
I don't think it's a very good idea.
At least what you used is well established. It is quite ugly, though. I usually fall back to if/elsif. if/elsif even produces shorter lines:
foreach (@w) { print "working with $_... "; if (/^>>/ ) { print "error message\n" } elsif (/^\s*([<>])\s*(\S+)/) { print "separated '$1' from '$2'\n" } elsif (/^\s*\|/ ) { print "pipefront\n" } elsif (/\|\s*$/ ) { print "pipeend\n" } else { print "\n" } }
In reply to Re^4: searching the strings
by ikegami
in thread searching the strings
by singam
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |