SPUG:Object property question

Colin Meyer cmeyer at helvella.org
Sun May 4 14:18:38 CDT 2003


On Fri, May 02, 2003 at 05:24:08PM -0700, Fred Morris wrote:
 

[...]

> How about..
> 
> sub new ($;$$$ ) {
> 
>   return SUPER::new( @_ );
> 
> }
> 
> or...

Note that if you call your constructor in the typical OO fashion:

  my $obj = ClassName->new();

then the prototype will not apply.  From 'perldoc perlsub':

       Perl supports a very limited kind of compile-time argument
       checking using function prototyping.  
       ...
       Method calls are not influenced by prototypes either,
       because the function to be called is indeterminate at
       compile time, since the exact code called depends on
       inheritance.


Have fun,
-Colin.



More information about the spug-list mailing list