Re: [MacPerl-Porters] @ARGV and droplets, sorry

[email protected] (Chris Nandor) Mon, 3 Dec 2001 18:46:41 -0500
Newsgroups perl.macperl.porters
Message-ID <p0510030fb831bec32fe2@[10.0.1.177]>
At 00:27 +0100 2001.12.04, Axel Rose wrote:
>$ARGV[0] is ok in the bug report "@ARGV and droplets".
>It looks like glob() does the unwanted splitting.

It is not unwanted ... it's the way it works.  :-)  Read the File::Glob docs.

>Since v5.6.0, Perl's CORE::glob() is implemented in terms of bsd_glob().
>Note that they don't share the same prototype--CORE::glob() only accepts
>a single argument.  Due to historical reasons, CORE::glob() will also
>split its argument on whitespace, treating it as multiple patterns,
>whereas bsd_glob() considers them as one pattern.

So, try:

	use File::Glob 'bsd_glob';

	# ...

	bsd_glob("$ARGV[0]*");

Of course, if you have any characters like ? or * in your path, that messes
it up, too.

-- 
Chris Nandor                      [email protected]    http://pudge.net/
Open Source Development Network    [email protected]     http://osdn.com/