As I continue my journey thru gnat's stages of a Perl programmer, I reach Slide 32 and have a few questions.

The first thing I think I know. Typeglobs are containers holding references to each of the 7 perl types for a particular variable name. They only exist for package variables. Typeglobs do not exist for lexical variables. Since the only two types of variables in Perl are lexical and package, one can say that 1 of the 2 has typeglobs as its storage support.

Now for some questions. In this slide gnat says:

# Perl lets you use a glob wherever you would use a filehandle, so glo +bs are often used to pass filehandles to a subroutine: open(HANDLE, $filename) or die; mysub(*HANDLE);

That's all well and good. And I assume mysub looks like this:

sub mysub { my $fh = shift; while (<$fh>) { ... } }
But what happens when you want to pass a format or dirhandle to a subroutine instead of a filehandle.

In reply to typeglob questions by princepawn

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.