in reply to compiletime checking of valid method calls
Figured maybe it was possible to use fields, but only got it to work for functions, not methods... Strangely enough the error occurs at line 8.
package BOGUS ; use fields qw( new ) ; package TEST ; my BOGUS $b ; $b = fields::new("BOGUS") ; @{$b}{keys %TEST::} = @TEST::{keys %TEST::} ; sub new { my $class = shift ; my TEST $self = {} ; bless $self, $class ; print "Runtime!\n" ; bloeb() ; return $self ; } package main ; use strict ; use warnings ; sub tst { my TEST $x ; $x = TEST->new() ; $x->blo() ; } tst() ;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: compiletime checking of valid method calls
by LanX (Saint) on Apr 08, 2019 at 22:56 UTC |