use base 'Exporter';
use IO::File;
+use Text::ParseWords;
our @EXPORT_OK = qw(
$IPV6RE
split_list
file_set_contents
file_get_contents
+extract_param
);
my $IPV4OCTET = "(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])";
return @data;
}
+# split an shell argument string into an array,
+sub split_args {
+ my ($str) = @_;
+
+ return $str ? [ Text::ParseWords::shellwords($str) ] : [];
+}
+
+sub extract_param {
+ my ($param, $key) = @_;
+
+ my $res = $param->{$key};
+ delete $param->{$key};
+
+ return $res;
+}
+
1;