in reply to perlform and write

See Re^3: formats output \r\n question

--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: perlform and write
by Anonymous Monk on Oct 19, 2007 at 08:14 UTC
    Thanks - the open sub method works like a charm :)
Re^2: perlform and write
by Tux (Canon) on Oct 19, 2007 at 09:01 UTC

    Indeed works like a charm, but be careful!

    • Does not work with tied filehandles
    • Does a fork, so if you have open database connections or other external links, be extra careful.

    Enjoy, Have FUN! H.Merijn
      Indeed :) some pointers for anyone finding this with search...

      while( <STDIN> ) blocks, (while can't assume the format is done printing, even if we know the exact # of lines being written) ... solved by exiting the while on N written lines since I know N.

      this is being run from a daemon... which is a child process all too itself. the daemon runs this capture on X formats every K seconds... each pipe is a new child process... defuncts like WOAH! :) remember to reap children Re: Unix Review column