On Mon, May 09, 2005 at 03:46:20PM +0530, Vamsi_Doddapaneni wrote:
> Here is the code part:
> foreach $name(`ls $opt_i/*.xml`){
Change this to:
foreach $name (glob("$opt_i/*.xml")) {
You can learn more here:
$ perldoc -f glob
> chomp;
> push @f, $name;
> print "pushing elements=$name\n";
> }
> [EMAIL PROTECTED];
>
> Now in the directory $opt_i if there are some 10 , 20 or even 100 its
> working well. But now I have some 305 odd xmls and the code is EXITING
> WITH
>
> sh: /usr/bin/ls: 0403-027 The parameter list is too long.
As suggested previously, you should normally only get this when there
are tens of thousands of files on the command line. What operating
system and version are you running? For UNIX systems, the kernel is
compiled to allow a set amount of information to be passed during an
exec. The information that is passed includes the command line
arguments, the environment, and some other little stuff. If your
environment is large, e.g., you have a _lot_ (thousands) or environment
variables or one environment variable that is really large (perhaps you
are setting environment variables in your script?), then the total
number of command line arguments you are allowed may be significantly
reduced.
http://www.linuxjournal.com/article/6060
> In unix prompt ls *.xml is working (giving out those 305 xmls)
This points to the fact that either your $opt_i is not set propertly or
you are setting some environment variables in your script that are
causing problems.
> DISCLAIMER: This email (including any attachments) is intended for the
> sole use of the intended recipient/s and may contain material that is
> CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance
> by others or copying or distribution or forwarding of any or all of
> the contents in this message is STRICTLY PROHIBITED. If you are not
> the intended recipient, please contact the sender by email and delete
> all copies; your cooperation in this regard is appreciated.
Duly noted.
dd
--
David Dooling