When I replace the URL in each of the code examples, they both run for me. If the code is executing on your side too, then the problem may be on the network or on the server side. It would be good if you could elaborate on "failing to do".... what error messages are you getting? Can you access these URLs from the command line? Please see How do I post a question effectively? and Basic debugging checklist.

Or, perhaps the code isn't doing what you want it to? The first code example does seem a little strange: You load LWP::Simple, but then call the external wget command. If you wrote my $data = get($url);, you could fetch the URL into Perl without going to the external command. If you could explain the bigger picture of what you are trying to do that would be good.

BTW, since you're using LWP::Simple and CGI together, please see the section "Caveat" at the bottom of LWP::Simple.


In reply to Re: Unable to execute URL from perl/cgi script by Anonymous Monk
in thread Unable to execute URL from perl/cgi script by coolsaurabh

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.