Re: Using Fly

[email protected] (Postmaster) Mon, 06 Sep 1999 22:57:58 +0100
Newsgroups perl.riscos
Message-ID <3aa47f3d49%[email protected]>
In message <[email protected]> you wrote:

> <big snip>
> Hi,
> I'm still going through all the stuff on Fly, I might even understand it
> eventually!
> I have another small problem, concerning CGI.pm
> As I understand, this is in the zip file in the library directory in !Perl.
> If I have a line such as:
> 
> my $favourite = param ("flavour");
> 
> Perl doesn't understand this and says
> 
> undefined subroutine &main: param called at ...<snip>
> 
> The param function should be included in CGI.pm (I think), so do I actually
> need to 'install' CGI.pm somewhere, or am I missing something (probably my
> brain :-) )
> 
> TTFN
> Nik
You are using a newer version of CGI.pm. This has moved to a more object
oriented approach, i.e. you create a CGI object and access the parameters
through that:

my $cgi = new CGI;
my $favourite = $cgi->param('flavour');

However, you can still use the non-object oriented version by doing:

use CGI qw/:standard/;

my $favourite = param('flavour');


Dave.
--