yelekeri has asked for the wisdom of the Perl Monks concerning the following question:

All, does anyboady have info about how to call a CGI script (for that matter, any weblink) from a perl program. From the perl script, lets say I need to call a hyperlink and get read the display output of that hyperlink. How exactly it can be done, which modules I could use for this purpose. Appreciate your replies. -yelekeri

Replies are listed 'Best First'.
Re: calling CGI script from outside server
by quester (Vicar) on Oct 27, 2006 at 02:39 UTC
    LWP::Simple would be an easy choice:
    perl -MLWP::Simple -we 'print get ("http://myserver/cgi-bin/temp.cgi") +;'
Re: calling CGI script from outside server
by sanPerl (Friar) on Oct 27, 2006 at 03:56 UTC
    You can use WWW::Mechanize module.
    use strict; use WWW::Mechanize; my $mech = WWW::Mechanize->new(); $mech->get('http://www.perlmonks.org/'); print $mech->content();
Re: calling CGI script from outside server
by Fletch (Bishop) on Oct 27, 2006 at 12:16 UTC

    And aside from the previous answers, consider extracting the functionality you want to access out of the CGI program into a module and then make your CGI program and your other code use that.

      You guys are great, and it works perfectly the way I want. Thank you very much for all you.