On Sun, May 23, 2010 at 12:21 AM, Greg London <[email protected]> wrote:
>
> First, I have a perl script that needs to pass in via command options a
> filename that might include wildcards. This filename will be used by the
> script at a later point, from a different directory, so I don't want Unix
> to do wildcard replacement when I run the script. But I'd like it to look
> like a wildcard so people are familiar with it and don't need to be
> explained about it.
>
>
People using Perl on Windows without Cygwin shell have the same problem (in
current directory) since on DOS each executable is responsible for its on
globbing.
> I used '@' as my wildcard and then do a s/@/*/g at some point before using
> it. It feels a bit klugey though. Is there a better way to do it?
>
I'd have them quote their strings so you can use the standard very familiar
ones, it's the same as deferring glob wildcards for remote or later use with
ftp, shell, etc.
then it's thesame as i used on Windows
@ARGV = map {(glob $_)} @ARGV;
will work in whatever working directory you choose to use when you use it.
Second, is there a built-in way to find the path to a perl module? I wrote
> a subroutine that does a manual search through @INC, PERL5LIB, PERLLIB,
> etc, but, again, it feels kind of klugey, and, again, I can't imagine I'm
> the first guy to need to do this. Is there a built in way?
Tilly is correct. %INC
--
Bill
[email protected] [email protected]
_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm