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

[ID 20000325.004] globbing modules' mutual inconsistencies

Thread Previous | Thread Next
From:
Tom Christiansen
Date:
March 25, 2000 08:31
Subject:
[ID 20000325.004] globbing modules' mutual inconsistencies
Message ID:
23055.954001896@chthon
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 CGI.pm'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 /;

Or 

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

Or 

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

--tom

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About