But I think the suggested Text::ParseWords is core and offers everything I expect from parsing a command line.
It has also tests, is cutomizable and the source is well structured and documented.
So if I "wanna roll my own" and need to make special adjustments (like e.g. paired {quotes} ) I can take the code as a base.
DB<94> use Text::ParseWords qw/shellwords/ DB<96> x shellwords(q{this is 'an example' "with different quoting a +nd \" escaping" including\ escaped\ whitespace}) 0 'this' 1 'is' 2 'an example' 3 'with different quoting and " escaping' 4 'including escaped whitespace' DB<97>
In case larger files need to be parsed I'll consider a dependency to Text::CSV , but this really looks good.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
In reply to Re^2: Parsing a line of text items
by LanX
in thread Parsing a line of text items
by mikkoi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |