On Tue, Aug 25, 2009 at 1:08 PM, Chris Wagner<wagn...@plebeian.com> wrote: > At 03:43 PM 8/19/2009 -0500, Fei Shi wrote: >>Only when I run the code below I have a little problem: >>*cat ids_overlap_* | sort -u > "a file name"* >> >>I have 3 files named as *ids_overlap_*(21Us/coding/ram)*. The error message >>is: >>*The system cannot find the file specified. >>cat.exe: write error : invalid argument* > > > Why are there star characters there? If u are trying to run that line from > within a perl script it won't work. > > system 'cat ids_overlap_* | sort -u > "a file name"'; > or > @return = `cat ids_overlap_* | sort -u > "a file name"`; >
I have not seen the previous posts but if you are trying to run this on windows it won't as you are trying to invoke a unix-is shell command. Maybe under Cygwin. I don't know what are you trying to achieve but I guess the next line is reading the file "a file name" so you will have the list of ids_overlap_* files in an array. It would be easier to use the glob() function of perl: @return = glob "ids_overlap_*"; and if you want them sorted then this will do it: @return = sort glob "ids_overlap_*"; Gabor http://szabgab.com/blog.html _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs