my $VERBOSE = $main::VERBOSE = 0;
my $DEBUG = $main::DEBUG = 0;
+exec('ssh',$ARGV[0] && shift @ARGV,$NAME,@ARGV) if @ARGV and $ARGV[0] eq '--ssh' and shift @ARGV;
csv2txt("\t",shift @ARGV) if @ARGV and $ARGV[0] eq '--csv2txt' and shift @ARGV;
curl_help() if @ARGV and $ARGV[0] eq '--curl_help' and shift @ARGV;
parse_debug() if @ARGV and $ARGV[0] eq '--parse_debug' and shift @ARGV;
#################################################################################
# Push key=value
-push(@cmd,map {('--data-binary',esc($_).'='.esc($keys{$_}))} sort keys %keys);
+push(@cmd,map {('--data-binary',uri_esc($_).'='.uri_esc($keys{$_}))} sort keys %keys);
warn "$NAME: Command: ",join(" ",map{/\s+/ ? '"'.$_.'"' : $_} @cmd),"\n" if $VERBOSE;
system @cmd;
exit;
}
-sub esc {
+sub uri_esc {
return URI::Escape::uri_escape($_[0]);
local $_=shift;s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg;
return $_;
=head1 OPTIONS
+ option[ssh=s] SERVER Run the script on that server
option[verbose|v+] Verbose mode: increase the verbosity level.
option[debug+] Debug mode: increase the verbosity level.
option[version|V] Print version (default: $VERSION)