Re: 'Tie::StdScalar' - perl tells me it can't find it



On Saturday 29 April 2006 10:43 am, Mr. Shawn H. Corey wrote:
On Sat, 2006-29-04 at 10:28 -0700, tom arnall wrote:
i'm try to use 'Tie::StdScalar' but perl tells me it can't find it. I've
pushed '/usr/share/perl/5.8.7' onto @INC. the error is:

Can't locate Tie/StdScalar.pm in @INC

in '/usr/share/perl/5.8.7/Tie/Scalar.pm' there is 'package
Tie::StdScalar' etc.

thanks,

tom arnall
north spit, ca

Is the module Tie::Scalar? See `perldoc Tie::Scalar` for details.


the main module is Tie::Scalar but within that file the StdScalar package is
defined. i dealt actually with the 'can't locate' problem by putting the def'
in a separate file: StdScalar.pm. but now i get a 'can't locate method' error
when i try to tie a variable to the package, i.e.:

DB<1> use Tie::StdScalar
DB<2> tie $f,'StdScalar'
Can't locate object method "TIESCALAR" via package "StdScalar"
at (eval 18)[/usr/share/perl/5.8/perl5db.pl:628] line 2.

but TIESCALAR *is* defined:

sub TIESCALAR {
my $pkg = shift;
if ($pkg->can('new') and $pkg ne __PACKAGE__) {
warnings::warnif("WARNING: calling ${pkg}->new since
${pkg}->TIESCALAR is missing");
$pkg->new(@_);
}
else {
croak "$pkg doesn't define a TIESCALAR method";
}

thanks in advance,

tom arnall
north spit, ca



.



Relevant Pages