package ExtConstructor; sub new { return <<" CODE"; eval 'use parent "parent::classes"'; sub new { return bless $_[0]->SUPER::new(); } CODE } 1; package Interface::Module; use ExtConstructor; my $code = new ExtConstructor; eval $code; # so that the constructor code created on-the-fly 1; package main; use Interface::Module; my $obj = new Interface::Module;
In reply to Re^4: Don't know how to make a module for this repeating code
by exilepanda
in thread Don't know how to make a module for this repeating code
by exilepanda
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |