Reputation: 33685
I would like to dequote and split a string the same way Bash does (excluding ` and $). Given the string:
'"'"'\""'"' foo\ bar\" '\" '\ quux
I would like an array containing:
@a = (q("'""), 'foo bar"', '\" quux');
Upvotes: 0
Views: 288
Reputation: 3643
use Text::ParseWords ();
my @list = Text::ParseWords::shellwords($string);
Upvotes: 4