in reply to Require - Module inclusion
But the below is working fine and resulting the object reference.use constant PATH => 'XX/XDC/'; my $change=PATH."raja"; require("$change.pm") || die "$!"; $change=~ s/\//\:\:/g; $obj = $change->new(); print $obj; Output: ------- Can't locate object method "new" via package "XX::XDC::raja" (perhaps +you forgot to load "XX::XDC::raja"?) at xyz.pl.
unshift(@INC,"XX/XDC"); require raja; $obj = raja->new(); print $obj; output: ------- raja=HASH(0x8f38d1c)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Require - Module inclusion
by Anonymous Monk on Mar 16, 2007 at 08:27 UTC | |
|
Re^2: Require - Module inclusion
by kulls (Hermit) on Mar 16, 2007 at 11:42 UTC | |
by agianni (Hermit) on Mar 16, 2007 at 14:48 UTC |