Is it possible to pass the same file handler as reference in two different subroutine ?

use FileHandle; sub f1 { my $handle=shift; ... } sub f2 { my $handle=shift; ... } my $fh=FileHandle->new(); ... f1($fh); f2($fh);

What is disadvantage of having many file handlers passed to many subroutines ?
Depends on your definition of the word many, on the operating system you are using, and whether or not the file handles point to open files. I recently stumbled over the problem, that on Windoze (if we want to call this an "operating system"), having a few hundreds of simultaneously open file handles caused the system to let me open a new one. This has, of course, nothing to do with passing them to *subroutines*.

-- 
Ronald Fischer <ynnor@mm.st>

In reply to Re: File Handler by rovf
in thread File Handler by snape

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.