Trina Espinoza wrote: > I have this command that reads logfiles.However, if the command isn't > successful it gives me a standard error. > > my @logData= `program1 -log $data1 $data2`; > > > The error looks like this: > > program1: '//mnt/leah/dir/': The system cannot find the file specified. > > *How do I read that error for the string "The system cannot find the file > specified" and skip the file if it doesn't exist??? >
the short answer: my @logData = `program1 -log $data1 $data1 2>&1`; but since i don't know how windows (i see that you are using Outlook so i assume you are running Windows) will handle that, it's probably not very portable. a slightly better solutions would be: #!/usr/bin/perl -w use strict; use IPC::Open3; my ($r,$w,$e); waitpid(open3($w,$r,$e,"ls -l"),0); print "Get $_" while(<$r>); __END__ prints: Get f1.pl Get f2.pl Get f3.pl ... etc at best, you should avoide going to the shell all together. david -- $_=q,015001450154015401570040016701570162015401440041,,*,=*|=*_,split+local$"; map{~$_&1&&{$,<<=1,[EMAIL PROTECTED]||3])=>~}}0..s~.~~g-1;*_=*#, goto=>print+eval -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]