Re: Passing Scalar Reference to Subroutine

2001-08-17 Thread Michael Fowler
I'm responding to both messages (the original and the response) because I don't have the original. On Thu, Aug 16, 2001 at 01:21:16PM -0500, randy Peterman wrote: > I believe that you may need to add an ampersand "&" before the name of the > subroutine, like so: > if(!&isPresent(\$req, $user))

Re: Passing Scalar Reference to Subroutine

2001-08-16 Thread randy Peterman
I believe that you may need to add an ampersand "&" before the name of the subroutine, like so: if(!&isPresent(\$req, $user)) Randy "David Simcik" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Newbie question here... > > I've created a CGI.pm object and want

Re: Passing Scalar Reference to Subroutine

2001-08-16 Thread register
$req is already a reference but you called isPresent using the following syntax isPresent(\$req,$user) # Wrong instead of isPresent($req,$user) # Correct On Thu, Aug 16, 2001 at 11:32:39AM -0500, David Simcik shaped the electrons to read: > Newbie question here... > > I've

Re: Passing Scalar Reference to Subroutine

2001-08-16 Thread Curtis Poe
--- David Simcik <[EMAIL PROTECTED]> wrote: > Newbie question here... > > I've created a CGI.pm object and want to pass its reference to a function. > It keeps on puking though, returning this message: David, First bit of advice: don't use prototypes. http://www.perl.com/pub/a/language/misc/

Re: Passing Scalar Reference to Subroutine

2001-08-16 Thread Jeff 'japhy/Marillion' Pinyan
On Aug 16, David Simcik said: >Type of arg 1 to main::isPresent must be scalar (not single ref constructor) >at C:\src\Orion\cgi-bin\share.pl line 45, near "$user)" A prototype of \$ means that Perl will add the \ for you automagically. >sub isPresent(\$$); > >if(!isPresent(\$req, $user)) You

Re: Passing Scalar Reference to Subroutine

2001-08-16 Thread Jos I. Boumans
e tutorial at http://japh.nu first regards, Jos - Original Message - From: "David Simcik" <[EMAIL PROTECTED]> To: "Perl Beginners" <[EMAIL PROTECTED]> Sent: Thursday, August 16, 2001 6:32 PM Subject: Passing Scalar Reference to Subroutine > Newbie questio

Passing Scalar Reference to Subroutine

2001-08-16 Thread David Simcik
Newbie question here... I've created a CGI.pm object and want to pass its reference to a function. It keeps on puking though, returning this message: Type of arg 1 to main::isPresent must be scalar (not single ref constructor) at C:\src\Orion\cgi-bin\share.pl line 45, near "$user)" Basically, I