Skip Menu |

This queue is for tickets about the CGI-Session CPAN distribution.

Report information
The Basics
Id: 23597
Status: resolved
Priority: 0/
Queue: CGI-Session

People
Owner: MARKSTOS [...] cpan.org
Requestors: joe.cullin [...] numarasoftware.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: syntax for calling class methods
Date: Fri, 24 Nov 2006 10:56:04 -0500 (EST)
To: bug-CGI-Session [...] rt.cpan.org
From: Joe Cullin <joe.cullin [...] numarasoftware.com>
version = 4.14 This is not a bug, so much as a usability suggestion. Because I saw that 'load' was a class method, I tried calling it like this: my $session = CGI::Session::load('joe'); That results in the following error message: Can't locate object method "query" via package "joe2" at /usr/.../Session.pm line 664. This is obviously my own error, not a bug. The docs show the correct syntax, I just missed it. However, I see that you do a fair amount of argument error-checking, so I thought I'd suggest this, because it took me a lot of time to figure out. I think that you could simply add a check for (@_ == 0) in sub load, after the initial 'shift' line, to catch and report the error. Otherwise, thanks for sharing what looks like a useful module. -Joe
Subject: Re: [rt.cpan.org #23597] syntax for calling class methods
Date: Fri, 24 Nov 2006 18:37:22 -0500
To: bug-CGI-Session [...] rt.cpan.org
From: Mark Stosberg <mark [...] summersault.com>
Joe Cullin via RT wrote: Show quoted text
> > Requestors: joe.cullin@numarasoftware.com > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=23597 > > > This is not a bug, so much as a usability suggestion. Because I saw that > 'load' was a class method, I tried calling it like this: > > my $session = CGI::Session::load('joe'); > > That results in the following error message: > Can't locate object method "query" via package "joe2" > at /usr/.../Session.pm line 664. > > This is obviously my own error, not a bug. The docs show the correct > syntax, I just missed it. However, I see that you do a fair amount of > argument error-checking, so I thought I'd suggest this, because it took me > a lot of time to figure out. > > I think that you could simply add a check for (@_ == 0) in sub load, after > the initial 'shift' line, to catch and report the error.
Joe, I'm not quite sure what you have in mind. Maybe you could submit a patch? The (@_ == 0) case is what you showed above. Considering the docs show the correct syntax, I'm not so inclined to take action on this. Mark -- http://mark.stosberg.com/
Resolving as not-our-bug, per Ron Savage's suggestion. Mark