in reply to Re: Typecasting a scalar to a module
in thread Typecasting a scalar to a module

Erm, no it won't work as is because he's passing a scalar reference to his object rather than the object ref itself.

Update: Yup, confuzzlingness. I was reading "second snippet" as the second alternative, not the second code section as a whole.

Replies are listed 'Best First'.
Re^3: Typecasting a scalar to a module
by Mugatu (Monk) on Mar 03, 2005 at 18:30 UTC

    Huh? Where are the "scalar references" that are not "the object ref itself" in this code?

    my $local = a_module->new(); $local->do_init; func1($local); func2($local);

    Update: sorry for the confusion.