in reply to Variable and object scoping

you would most probably wish to do something like this:
#!/usr/bin/perl my $t=new HTML::Template; foo($t); print $t->output; sub foo { my $f=shift; $f->param(foo=>baz); }

Replies are listed 'Best First'.
Re: Re: Variable and object scoping
by dakkar (Hermit) on Nov 26, 2002 at 21:30 UTC

    Yes, it would be better.

    Anyway, Angel's code would work correctly. Angel, just one thing: use foo(), not &foo. Just for style ;-)

    -- 
            dakkar - Mobilis in mobile
    

      use foo(), not &foo. Just for style ;-)

      And to not bypass prototypes, and to not accidentally use @_ magic, and to be consistent with method calls... :)

      bbfu
      Black flowers blossum
      Fearless on my breath