in reply to splitting on multiple delimiters
use strict; use warnings; use Data::Dumper; use Text::ParseWords; my $str = 'command1 command2 command3 "command4 --some-arg arg --some- +other-arg 2" command5'; my @words = shellwords($str); print Dumper(\@words);
prints:
$VAR1 = [ 'command1', 'command2', 'command3', 'command4 --some-arg arg --some-other-arg 2', 'command5' ];
|
|---|