Skip Menu |
Report information
Id: 2713
Status: open
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: tchrist [at] chthon.perl.com
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: medium
Type:
Perl Version: (no value)
Fixed In: (no value)



To: perlbug [...] chthon.perl.com
Subject: globbing modules' mutual inconsistencies
Date: Sat, 25 Mar 2000 09:31:36 -0700
From: Tom Christiansen <tchrist [...] chthon.perl.com>
Download (untitled) / with headers
text/plain 1.4k
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
Date: Sat, 25 Mar 2000 09:48:37 -0700 (MST)
From: Nathan Torkington <gnat [...] frii.com>
To: tchrist [...] perl.com
Cc: perl5-porters [...] perl.org
Subject: Re: [ID 20000325.004] globbing modules' mutual inconsistencies
Download (untitled) / with headers
text/plain 296b
Tom Christiansen writes: Show quoted text
> use File::DosGlob ':EVERYWHERE'; > use File::Glob ':EVERYWHERE';
If you make it an adjective, it works: use File::Glob ':UNIVERSAL'; use File::Glob ':UNIVERSAL csh_glob'; This risks confusion with UNIVERSAL::, but the concept is pretty similar. Nat
To: Nathan Torkington <gnat [...] frii.com>
Cc: tchrist [...] perl.com, perl5-porters [...] perl.org, tchrist [...] chthon.perl.com
Subject: Re: [ID 20000325.004] globbing modules' mutual inconsistencies
Date: Sat, 25 Mar 2000 10:08:41 -0700
From: Tom Christiansen <tchrist [...] chthon.perl.com>
Download (untitled) / with headers
text/plain 1.6k
Show quoted text
>If you make it an adjective, it works: > use File::Glob ':UNIVERSAL'; > use File::Glob ':UNIVERSAL csh_glob';
I tend to think of it as wanting to modify "use" as an adverb of location not the package name or function name. And yes, adverbs can float better than adjectives in English, but they don't like being put here: # (we'll skip the ":GLOBALLY" and ":UBIQUITOUSLY" this time around) use File::Glob qw(:UNIVERSALLY &csh_glob); use File::Glob qw(:HERE &csh_glob); # redundant use File::Glob qw(:PROGRAM-WIDE &csh_glob); use File::Glob ':ALL OVER THE PLACE', '&posix_glob'; whereas if you put the modifer at the end of the list, it can be an adverb for "use" once again. use File::Glob qw(&glob :UNIVERSALLY); Even though this isn't really like CLI programs that expect their modifiers right after the verb (which we can't do, because we need the package their) and before their objects. execute -quickly someproggy I think the problem is that the package is the genitive for the noun list following, so use File::Glob '&csh_glob'; really reads Please use the File::Glob module's csh_glob function. or Please use File::Glob's &csh_glob. And English isn't happy interposing a non-immediate modifier between the possessive and the possessed. (Yes, I just said that csh is possessed, but we knew that. :-) It's something of a determiner in this regard. So we could use File::Glob's bodacious &glob but we couldn't use File::Glob's universal &glob, because then universal would end up modifying "&glob" not "use", and there is no UNIVERSAL::glob, but rather a CORE::glob. Hm... use File::Glob qw/CORE glob/; use File::Glob qw/:CORE glob/; That might work. --tom


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org