Home: Perl Programming Help: Beginner:
param function reports error



HTTP404
Deleted

Mar 17, 2001, 2:38 AM


Views: 265
param function reports error

use CGI;
$mail=param('mail');

wierd i have ActiveState Perl i'm on windows and it gives me error msg saying:

undefined subroutine called at &main::param

same with when i use

print start_html ("Perl Rocks");

thnx very much in advance







unknownSym
stranger

Mar 17, 2001, 6:00 AM


Views: 261
Re: param function reports error

You need to import those subroutines into the 'main' package like this:

use CGI qw(:all)

The above line imports all of the CGI packages subroutines in the 'main' package.

If you don't use the above line then your need to call the subroutines like this

CGI->param(parametername)
CGi->start_html(string)

OR

$cgi = new CGI
$cgi->param(paramname)
$cgi->start_html(string)

Have fun

--unknownSym



HTTP404
Deleted

Mar 17, 2001, 6:20 AM


Views: 260
Re: param function reports error

thnx m8



HTTP404
Deleted

Mar 17, 2001, 6:35 AM


Views: 259
Re: param function reports error

thnx works very sweet + OOP