I tried upgrading from 5.30.0 to 5.32.0 and hit the following with some of my scripts

Can't locate DateTime/TimeZone/Local/Unix.pm: /opt/local/lib/perl5/site_perl/5.32.0/DateTime/TimeZone/Local/ +Unix.pm: T oo many open files at /opt/local/lib/perl5/site_perl/5.32.0/Module/Run +time.pm li ne 314 (#1) (F) You said to do (or require, or use) a file that couldn't be fo +und. Perl looks for the file in all the locations mentioned in @INC, un +less the file name included the full path to the file. Perhaps you nee +d to set the PERL5LIB or PERL5OPT environment variable to say where +the extra library is, or maybe the script needs to add the library nam +e to @INC. Or maybe you just misspelled the name of the file. See "require" in perlfunc and lib.

The file '/opt/local/lib/perl5/site_perl/5.32.0/DateTime/TimeZone/Local/Unix.pm' exists ... so I suppose that Perl isn't opening it because it has run out of ... available file handles? What is the name of the resource which has been exhausted and whose exhaustion leads to the 'too many open files' message?

Looking at Runtime.pm .... Line #314 is the 'return scalar ...' line

sub require_module($) { # Localise %^H to work around [perl #68590], where the bug exi +sts # and this is a satisfactory workaround. The bug consists of # %^H state leaking into each required module, polluting the # module's lexical state. local %^H if _WORK_AROUND_HINT_LEAKAGE; if(_WORK_AROUND_BROKEN_MODULE_STATE) { my $notional_filename = &module_notional_filename; my $guard = bless([ $notional_filename ], "Module::Runtime::__GUARD__"); my $result = CORE::require($notional_filename); pop @$guard; return $result; } else { return scalar(CORE::require(&module_notional_filename) +); } }

What is 'sub module_notional_filename'? Well, Runtime.pm contains the following:

[...] The notional filename for the named module is generated and returned. This filename is always in Unix style, with C</> directory separators and a C<.pm> suffix. This kind of filename can be used as an argument + to C<require>, and is the key that appears in C<%INC> to identify a modul +e, regardless of actual local filename syntax. =cut sub module_notional_filename($) { &check_module_name; my($name) = @_; $name =~ s!::!/!g; return $name.".pm"; } [...]

Hmm, I'm running into my own lack of expertise here ... I don't see how 'sub require_module' and 'sub module_notional_filename' relate to counting how many open files I have

Anyone have pointers on what I am seeing?

I rolled back to perl 5.30.0, which restores the original behavior (i.e. none of these 'Too many open files' messages

I am running on Ubuntu, 5.4.0-54-generic

--sk


In reply to Perl 5.32.0 Too many open files ... Runtime.pm by skendric

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.