Have you tried Text::CSV_XS? It allows you to set both the separatist and eol 
and it also lets you use complex separators.

T.

Sent from my iPhone

> On Dec 16, 2014, at 4:05 PM, Kenneth Wolcott <kennethwolc...@gmail.com> wrote:
> 
> Hi;
> 
>  I've got some strings that I need to parse the value(s) off of the key.
> 
>  The key is (possibly) space-separated and terminate by a colon, and
> the value is delimited by single quotes.  But there are (potentially)
> additional values for the key.
> 
> Here is one real-world example (excerpt from the output of VBoxManage
> showvminfo vm):
> Name: 'tuba', Host path: '/Users/kwolcott/Shared/tuba' (machine
> mapping), writable
> 
> What I want to parse is the part contained by single quotes.
> 
> Perhaps I'd better use a capturing regex instead of split?
> 
> Perhaps something like:
> $example_string =~ m|'($1)'|;
> $shared_folder = $1;
> 
> Is there a better way to do this?
> 
> What kind of string format is this called?
> 
> Thanks,
> Ken Wolcott
> 
> -- 
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
> 
> 

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to