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

%INC...

From:
Jeff Pinyan
Date:
April 29, 2000 12:09
Subject:
%INC...
Message ID:
Pine.GSO.4.21.0004291507290.5465-100000@crusoe.crusoe.net
Would it be sensible to patch %INC such that keys could also be package
names?  This way, I can do:

  use Some::Module;
  $loc = $INC{'Some::Module'};

instead of doing:

  use Some::Module;
  $OSSEP = '/';
  for ($^O || do { require Config; $Config::Config{osname} }) {
    /Win/i and $OSSEP = '\\', last;
    /^MacOS$/i and $OSSEP = ':', last;
    /os2/i and $OSSEP = '\\', last;
  }
  ($module = 'Some::Module.pm') =~ s/::/$OSSEP/g;
  $loc = $INC{$module};

But perhaps I'm being silly.

-- 
MIDN 4/C PINYAN, NROTCURPI, US Naval Reserve             japhy@pobox.com
http://www.pobox.com/~japhy/                  http://pinyaj.stu.rpi.edu/
PerlMonth - An Online Perl Magazine            http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc.    http://www.perlarchive.com/




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