in reply to Format ignorance

Ignorance can be mended with reading ;-)

Read FileHandle. It defines format_name, format_top and so on. Read perlform.

- my $FH=*{$$self{FILEHANDLE}}; + my $FH = $self->{FILEHANDLE}; + $FH->format_name('FH'); - format $FH = + format FH =

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Replies are listed 'Best First'.
Re^2: Format ignorance
by ikegami (Patriarch) on Oct 05, 2006 at 22:21 UTC
      I mentioned FileHandle because in the OP, section "Original code", FileHandle is used. Of course IO::File would be the better choice, but since reading is expensive, I pointed to the module at hand.

      With eagerness one naturally ends up with IO::File, since the first sentence in the DESCRIPTION section of FileHandle reads

      NOTE: This class is now a front-end to the IO::* classes.

      :-)

      --shmem

      _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                    /\_¯/(q    /
      ----------------------------  \__(m.====·.(_("always off the crowd"))."·
      ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
        Sorry, I hadn't looked at the main program. Because in the OP already uses FileHandle is indeed a good reason. :)
Re^2: Format ignorance
by sailortailorson (Scribe) on Oct 05, 2006 at 20:02 UTC
    Thanks shmem,

    That did the trick. I will pore over the references, leveraging off of a now-working example.