develooper Front page | perl.perl6.users | Postings from July 2017

Is there a bash/shlex-like processor with double-quotes handling?

Thread Next
From:
Mark Carter
Date:
July 14, 2017 07:41
Subject:
Is there a bash/shlex-like processor with double-quotes handling?
Message ID:
f58baf68-d599-5e3c-eaa3-1251d50a09b8@gmail.com
Is there a function that can decompose a string to an array separated by 
whitespace, but also respecting double quotes, and prefereably escape 
sequences?

So, for example:

my $d="hello   \"cruel world\"";

something-something($d) ; => ("hello", "cruel world")

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About