I have encountered a problem with the way ActivePerl handles @ARGV and
wildcard expansion under Win32 and Solaris, and I don't know how to get
around it in an efficient manner.
I have a single perl script which needs to run under both Win32 and
Solaris, and I have no intention whatsoever to maintain two versions of
the same script. The script takes a commandline argument, in the form
of a filename, with or without wildcards, eg 'myscript.pl <file?name*>
<other_arguments> <more_arguments>'. The problems arise when using
wildcards in the filename under Solaris.
The problem, is that under Solaris, the script does a 'wilcard
expansion', and places all the found filenames in $ARGV[0], $ARGV[1],
$ARGV[2] and so on, while under Win32 the filename argument (including
the wildcards) is placed in $ARGV[0], and the remaining arguments in
$ARGV[1], $ARGV[2] etc. And this is the way I want it to work under
Solaris too.
Putting single quotes around the filename argument under Solaris
prevents the expansion, but then the script doesn't behave as I'd
like... And not in the same way as under Win32. I need the script to
be 'transparent' in the sense that it must function identically in both
environments.
So, to summarize, my question boils down to: How do I enter a filename
including wildcards as a command line argument to a perl script under
Solaris, without having the wildcard expansion being performed, and
wrongly overwriting the following arguments in @ARGV? And without using
single quotes around the argument.
TIA
~Mike
___________________________________
The information included in this e-mail is intended only for the
person or entity to which it is addressed. Any use of this
information by persons or entities other than the intended
recipient is prohibited. If you receive this transmission in
error, please delete this email and destroy any copies of it.
Any opinions expressed in this email are those of the individual
and not necessarily those of the company CCNOX.
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl