On Sat, May 22, 2010 at 9:21 PM, Greg London <[email protected]> wrote:
> Two unrelated perl queries.
>
> 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.
>
> 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?

That is very kludgey.  I would suggest just making people put single
quotes around the wildcard.  That will be less surprising for
experienced people.

> 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?

After you use it, just look in %INC to figure out where it was found.

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

Reply via email to