in reply to searching the strings
If you plan to plug these filenames into two-arg open, you should redesign and start working with three+ arguments. That seperates actual filenames from what you plan to do with them. You won't need to parse the mode directives out of the filenames then. Consider that a file's actual name may start with those symbols, even though it really confuses the shell if unquoted and unescaped.
That said, the kind of parsing you want can be done like this:
You should read perlre to see how those matches pick out the features that interest you.sub name_parse { local $_ = shift; m/^>>/ and warn 'Error message' and return(); m/^([><])/ and return ($1, substr($_, 1)); m/^\|/ and print 'pipefront'; m/\|$/ and print 'pipeend'; return $_; } my @mulch = name_parse($filename);
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
| A reply falls below the community's threshold of quality. You may see it by logging in. |