Hi,

You have some good stuff in there, but the formatting makes

Question unreadable :) answer obvious :(

Dont despair :) clean your room ;)

Use the convenience that is CGI and Capture::Tiny and the Basic debugging checklist

#!/usr/bin/perl -- ## perltidy -olq -csc -csci=10 -cscl="sub : BEGIN END if while for " +-otr -opr -ce -nibc -i=4 -pt=0 "-nsak=*" use strict; use warnings; use CGI; use Capture::Tiny qw/ capture /; Main( @ARGV ); exit( 0 ); sub Main { if( @_ ){ Download( @_ ); } elsif( my $ONLINE = CGI->new->query_string ){ my $url = $ONLINE; RunCGI(); } elsif( my $url = UrlFromStdin() ){ Download( $url ); } else { PrintUsage(); } } sub Download { my @cmd = ( 'wget', '--help' ); my( $stdout, $stderr, $exit ) = capture { system { $cmd[0] } @cmd; };; die "( $stdout, $stderr, $exit )"; }

$URL needs shell escaped when given to shell

CGI.pm needs $cgi = CGI->new; $cgi->header('text/javascript') , $cgi->query_string

... String::ShellQuote , Win32::ShellQuote, Proc::Background, system_detached , use CGI or die; , ...the checklists :) Basic debugging checklist , brian's Guide to Solving Any Perl Problem, CGI Help Guide , Troubleshooting Perl CGI scripts...


In reply to Re: wget not working from harangzsolt33 perl program by Anonymous Monk
in thread wget not working from perl by harangzsolt33

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.