Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re^3: Has anyone seen perl losing arguments?

by Anonymous Monk
on Sep 28, 2011 at 19:56 UTC ( #928406=note: print w/replies, xml ) Need Help??

in reply to Re^2: Has anyone seen perl losing arguments?
in thread Has anyone seen perl losing arguments?

Oh, I printed everything;

Did you escape (Dumper) it?

What shell are you invoking on the cloud?

$ perl -V:sh sh='cmd /x /c';

See the problem is, you're not escaping $now_string and $start_date, see Re^2: perl windows backtick problem, String::ShellQuote

Or avoid the shell completely, use IPC::Run3

Replies are listed 'Best First'.
Re^4: Has anyone seen perl losing arguments?
by ted.byers (Monk) on Sep 29, 2011 at 15:28 UTC

    Thanks for your help

    No, I didn't dumper it. rather, I just print intermediate results, until the program has been shown to be working OK.

    The shell is Windows Server Web's cmd

    Here are the contents of my script:

    use strict; use warnings; use IPC::System::Simple qw(system systemx capture capturex); $| = 1; my $cmd = ' qwerty asdfghjk zxcv'; my $op = `$cmd`; print "==============\n",$op,"\n\n=================\n"; my @args; push @args,''; push @args,"\"qwerty 12354\""; push @args,'asdfg'; push @args,'zxcvbnm'; system('perl',@args); print "\n\n==============\n"; systemx('perl',@args); print "\n\n==============\n";

    And there are the contents of ''

    print "$ARGV[0]\n\t$ARGV[1]\n\t\t$ARGV[2]\n";

    and here is what is written to standard out:

    C:/Perl64.v.5.14/bin\perl.exe -w c:/Work/ ============== ================= qwerty 12354 asdfg zxcvbnm ============== qwerty 12354 asdfg zxcvbnm ==============

    So, it is clear that my way forward is to use IPC::System::Simple. But what is not clear is why using the default system and back ticks worked fine on WIndows 7, Windows XP, and Windows Server 2003, but fails miserably on Windows Server Web. But I am not going to worry too much about that as long as I can quickly get these programs working again.

    Thanks again.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://928406]
Discipulus ignores..
Discipulus IE just maps to id est in my mind .. ;=)
[Corion]: marto: I believe nowadays, at least window.opener should not be set anymore (except maybe within the same domain)
[Corion]: But I wouldn't really know as I don't use iexplore much (except at $work) and mostly surf with JS disabled (except at $work :) )

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2018-03-21 11:43 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (267 votes). Check out past polls.