Hallo,
#!/usr/bin/perl
use strict;
use warnings;
package palim;
{
use vars qw(@ISA);
sub new
{
bless({}, shift);
}
sub namespaceMe($)
{
push(@ISA, $_[1]);
}
sub doPalim()
{
print "palim\n";
}
}
# uiuiui, das ist ganz arg böse !!!!
eval << "PACK";
package blub;
{
sub new
{
bless({}, shift);
}
sub doBlub()
{
print "blub\n";
}
}
PACK
package main;
my $o = new palim();
$o->doPalim();
eval { $o->doBlub(); };
print ( ($@ =~ /(.*?)\ at\ /)[0] . "\n" ) if $@;
$o->namespaceMe('blub');
$o->doBlub();
gibt:
palim
Can't locate object method "doBlub" via package "palim"
blub
für:
v5.8.7 built for i386-freebsd-64int
gruss
--
Swiss Army Chainsaw
Terrorific!
Given a cow full of milk, should the milk un-cow itself, or should the cow milk itself?
Swiss Army Chainsaw
Terrorific!
Given a cow full of milk, should the milk un-cow itself, or should the cow milk itself?