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

Re: Is there a bash/shlex-like processor with double-quoteshandling?

Thread Previous
From:
Elizabeth Mattijsen
Date:
July 14, 2017 10:38
Subject:
Re: Is there a bash/shlex-like processor with double-quoteshandling?
Message ID:
657655EB-7933-448C-97BB-B557451694CE@dijkmat.nl
zef install Text::CSV

This is a native port of Perl 5’s Text::CSV by the original author.

> On 14 Jul 2017, at 11:12, Philip Hazelden <philip.hazelden@gmail.com> wrote:
> 
> If you haven't yet, you might want to look into a CSV parser. I think that if you configure one of those to split on whitespace, that should give you the results you want.
> 
> (Now with added reply all.)
> 
> On Fri, 14 Jul 2017, 08:42 Mark Carter, <alt.mcarter@gmail.com> wrote:
> 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 Previous


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