>>>>> "GL" == Greg London <[email protected]> writes:

  GL> First, I have a perl script that needs to pass in via command
  GL> options a filename that might include wildcards. This filename
  GL> will be used by the script at a later point, from a different
  GL> directory, so I don't want Unix to do wildcard replacement when I
  GL> run the script. But I'd like it to look like a wildcard so people
  GL> are familiar with it and don't need to be explained about it.

  GL> I used '@' as my wildcard and then do a s/@/*/g at some point
  GL> before using it. It feels a bit klugey though. Is there a better
  GL> way to do it?

why not pass in normal shell patterns but put them in quotes on the
command line? then use glob() to expand them inside perl

  GL> Second, is there a built-in way to find the path to a perl module?
  GL> I wrote a subroutine that does a manual search through @INC,
  GL> PERL5LIB, PERLLIB, etc, but, again, it feels kind of klugey, and,
  GL> again, I can't imagine I'm the first guy to need to do this. Is
  GL> there a built in way?

if you have to load it anyway, use require which happens at
runtime. then you can look inside %INC to find the path for that
module. note that if you want a bareword module load you need to do it
like this:

        eval "require $module"

if you have the filename with the .pm suffix and normal path separators
(/), then you can just do this:

        require $file ;

uri

-- 
Uri Guttman  ------  [email protected]  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to