Using it the way you describe will cause porting issues for older perl versions:

$ perl -MFile::Glob::bsd_glob -wE'say for bsd_glob ("*.foo")' Can't locate File/Glob/bsd_glob.pm in @INC (@INC contains: /pro/lib/pe +rl5/site_perl/5.14.2/IA64.ARCHREV_0-LP64-ld /pro/lib/perl5/site_perl/ +5.14.2 /pro/lib/perl5/5.14.2/IA64.ARCHREV_0-LP64-ld /pro/lib/perl5/5. +14.2 .). BEGIN failed--compilation aborted.

edit: correct above example of failure. The correct syntax is just as bad though:

$ perl -MFile::Glob=:bsd_glob -wE'say for bsd_glob ("*.foo")' "bsd_glob" is not defined in %File::Glob::EXPORT_TAGS at /pro/lib/perl +5/5.14.2/IA64.ARCHREV_0-LP64-ld/File/Glob.pm line 45. File::Glob::import("File::Glob", ":bsd_glob") called at -e lin +e 0 main::BEGIN() called at -e line 0 eval {...} called at -e line 0 Can't continue after import errors at -e line 0. BEGIN failed--compilation aborted.

And additional shit hits the fan when you would try to install it

$ cpan File::Glob : The most recent version "1.28" of the module "File::Glob" is part of the perl-5.26.1 distribution. ...

Does this in your opinion imply that File::Glob should be dual-lived?

The current (today) absolute advised minimum version to be supported by the toolchain is perl-5.8.1. My example with 5.14.2 could arguably be considered recent enough.

Digging in the Delta's:

perl561delta.pod: File::Glob::glob() has been renamed to File::Glob::bsd_glob() perl58delta.pod: File::Glob::glob() has been renamed to File::Glob::bsd_glob() perl5160delta.pod: It has a new C<:bsd_glob> export tag, intended to replace C<:glob>. perl5260delta.pod: L<C<File::Glob::glob()> will disappear in perl 5.30. Use C<File::Glo +b::bsd_glob()> instead.

Does *not* make me happy. I see the trouble that is addressed, but this makes portable programming much much harder. Looks like the only portable way to write it from 5.6.1 to blead is:

use File::Glob; my @files = File::Glob::bsd_glob ("*.txt");

Safe, but not really a nice replacement of the simple <*.txt> or glob ("*.txt").


Enjoy, Have FUN! H.Merijn

In reply to Re: To glob or not to glob by Tux
in thread To glob or not to glob by haukex

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.