Re: [PBML] Operator Overloading
- On Jun 1, Jeff Eggen said:
>use overloadYou missed something. The 'overload' docs mention a 'fallback' method.
> 'eq' => \&test_equals;
>my $object1 = Class->constructor('parameter')
> or die "error creating object!\n";
>Operation `bool': no method found, argument in overloaded package Class
>So, I didn't notice this in the Programming Perl chapter on overloading,
>but maybe I just missed it: do I always have to implement an overloaded
>'bool' operator if I'm going to overload any other ones? Am I missing
>something simple in the documentation, or have I stumbled across a
use overload (
'eq' => \&test_equals,
fallback => 1,
The explanation in overload.pm:
The key "fallback" governs what to do if a method for a particular
operation is not found. Three different cases are possible depending
on the value of "fallback":
* "undef" Perl tries to use a substituted method (see "MAGIC
AUTOGENERATION"). If this fails, it then tries to
calls "nomethod" value; if missing, an exception will
* TRUE The same as for the "undef" value, but no exception is
raised. Instead, it silently reverts to what it would
have done were there no "use overload" present.
* defined, but FALSE
No autogeneration is tried. Perl tries to call
"nomethod" value, and if this is missing, raises an
Jeff "japhy" Pinyan japhy@... http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/
CPAN ID: PINYAN [Need a programmer? If you like my work, let me know.]
<stu> what does y/// stand for? <tenderpuss> why, yansliterate of course.
>>> japhy@... 01/06/2004 4:32:44 pm >>>D'oh! I must have read that page about 4 times and it never clicked in. I kept thinking it was only related to the whole deal where overloading <=> and cmp define the other comparison operators. Didn't think that the others would be affected too.
>You missed something. The 'overload' docs mention a 'fallback' method.
I added the 'fallback => 1' to the use overload pragma, and that has worked perfectly. Thanks very much Japhy! Time to read that chapter again.
IT Programmer Analyst
Saskatchewan Government Insurance
Ph (306) 751-1795
This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the named addressee, please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that using, disclosing, copying or distributing the contents of this information is strictly prohibited.
I am not able to run SSI on apache webserver, perl/
cgi scripts run perfectly but i am not able to run
SSI. i am using windows 2000 and have all the
privilages tat r required to run the server. I have
incorporated the following lines in the config file.
it would be nice if anyone can help me out with this.
AddType text/html .shtml
AddHandler server-parsed .shtml
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
- --- In email@example.com, vinay mysore <vinay_ma@y...> wrote:
> Hi,Has the server been restarted to re-read the update httpd.conf?
> I am not able to run SSI on apache webserver, perl/
> cgi scripts run perfectly but i am not able to run
> SSI. i am using windows 2000 and have all the
> privilages tat r required to run the server. I have
> incorporated the following lines in the config file.
> it would be nice if anyone can help me out with this.
> Options +Includes
> AddType text/html .shtml
> AddHandler server-parsed .shtml
What errors are you getting? Are you seeing the SSI directives instead
of them being parsed?
Any messages in the error_log?
Have you read
Bit of repeated info at:
If you have enbabled the server-info (mod_info) you can read about the
server configuration. This is a good way to see whether the httpd.conf
file has been read as expected:
Deny from all
Allow from 119.