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

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: cgi code that opens a website
by Corion (Patriarch) on Feb 21, 2011 at 18:47 UTC

    That's easy. Just read CGI and use its ->redirect method.

Re: cgi code that opens a website
by wind (Priest) on Feb 21, 2011 at 19:21 UTC
    #!/usr/bin/perl use CGI; use strict; my $q = CGI->new; print $q->redirect('http://www.google.com'); 1;
      Hey wind - thanks your code worked perfectly. Much appreciated - normann

        And just for the sake of completeness, if that's *all* you're doing these would be fine too.

        use CGI; print CGI->new->redirect('http://www.google.com'); # or use CGI; print CGI::redirect('http://www.google.com'); # or (what I'd probably use) use CGI "redirect"; print redirect('http://www.google.com');
Re: cgi code that opens a website
by elagon (Initiate) on Feb 22, 2011 at 07:22 UTC
    In your code you just use the system() function which ask the operative system to execute the arguments That code won't work on anything but windows I think. Try read the CGI perldoc for a start, you will find usefull examples.