develooper Front page | perl.perl5.porters | Postings from March 2000

[ID 20000325.004] globbing modules' mutual inconsistencies

Thread Previous | Thread Next
Tom Christiansen
March 25, 2000 08:31
[ID 20000325.004] globbing modules' mutual inconsistencies
Message ID:
File::DosGlob uses 'GLOBAL_glob' (not a real function) for the same
kind of thing that File::Glob uses ':globally' (an import tag) for.

Perl should figure out a regular convention for this kind of thing.
Here's one way:

    use File::DosGlob ':EVERYWHERE';
    use File::Glob    ':EVERYWHERE';

Normally, I'd say ":GLOBALLY", but that looks too confusing with
these globbish modules.

I've already reported the oddness that File::Glob's ":globally"
doesn't even make the fileglobbing operators use &File::Glob::glob,
either.  It makes it use csh_glob instead.

You know, that read better this way:

    use File::Glob qw/csh_glob :EVERYWHERE/;
    use File::Glob qw/glob     :EVERYWHERE/;

But violates the "put the colon tags first" notion.  Legibility in
English is the more important factor here, so that notion can be
trampled on.

Another idea is from there's's -foo style:

    use File::Glob qw/-everywhere csh_glob/;
    use File::Glob qw/-everywhere glob    /;

Or, since we're rolling our own imports, even something like

    use File::Glob qw/ glob=csh_glob   :UBIQUITOUSLY /;
    use File::Glob qw/ glob=posix_glob :UBIQUITOUSLY /;

Or shorter:

    use File::Glob qw/:UBI glob=csh_glob   /;
    use File::Glob qw/:UBI glob=posix_glob /;


    use File::Glob qw/:UBI=package glob=csh_glob   /;
    use File::Glob qw/:UBI=program glob=posix_glob /;


    use File::Glob qw/:WHERE=PACKAGE glob=csh_glob   /;
    use File::Glob qw/:WHERE=PROGRAM glob=posix_glob /;


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About