Pardus has asked for the wisdom of the Perl Monks concerning the following question:
I figured i need to prototype the subroutine to implicitly get a reference to the var, so I declared it as sub my_sub (\$) {}. But now I wonder, whereto should I assign the tie'ed object, to the typeglob of the reference, to the typeglob of the scalar or just to the reference itself ?? And what is the right syntax to do this under use strict ?# The idea is that when I do: use MyModule qw/my_sub/; my $scalar = 'something'; # $scalar is normal here my_sub($scalar); # but now has become a tie'd scalar
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: ref 'n typeglob
by diotalevi (Canon) on Apr 01, 2003 at 01:01 UTC | |
by Pardus (Pilgrim) on Apr 01, 2003 at 01:14 UTC | |
by bbfu (Curate) on Apr 01, 2003 at 20:12 UTC |