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