Let's see if I understood everything:
foreach (@w) { print "working with $_... "; /^>>/ and do { print "error message\n"; next }; /^\s*([<>])\s*(\S+)/ and do { print "separated '$1' from '$2'\n"; ne +xt }; /^\s*\|/ and do { print "pipefront\n"; next }; /\|\s*$/ and do { print "pipeend\n"; next }; print "\n"; } __END__ working with >test.txt... separated '>' from 'test.txt' working with <test.txt... separated '<' from 'test.txt' working with >>test.txt... error message working with | test... pipefront working with test |... pipeend
This probably needs more refinement but I think I'll leave that to you ;).
Update: Code beautification.
--
David Serrano
In reply to Re: searching the strings
by Hue-Bond
in thread searching the strings
by singam
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |