Oh wise monks of the symbol table,

I want to create a subroutine that alters a normal scalar into a tie'ed object, but without returning the object from the sub. This because I would like to use it as 'syntactic sugar' for a module interface.
# 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
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 ?

--
Jaap Karssenberg || Pardus (Larus)? <pardus@cpan.org>
>>>> Zoidberg: So many memories, so many strange fluids gushing out of patients' bodies.... <<<<

In reply to ref 'n typeglob by Pardus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.