Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl $arg=$ARGV[0]; $pattern="build.log"; $path="/remote/scm/rsync/builds/$arg/FailedInformal"; #print "$path\n"; @releases=`ls -1 $path`; #print "@releases\n"; $x=0; foreach $file(@releases) { if($file=~/^\d/) { $dlist[$x]=$file; } $x++; } #print "@dlist\n"; @three=@dlist[-1,-2,-3]; #print "@three\n"; $latest=$three[0]; print "$latest\n"; $path1="$path/$latest"; print "$path1\n"; @logs=`ls $path1`; #print "@logs\n"; #print "$logs[1]\n"; #print "$path1/@logs[1]"; $p= open(F,"$path1/build.log")or die "$!\n"; while(<F>) { chomp; print "$_\n"; }
3.0.0.0.118 3.0.0.0.113 3.0.0.0.111 3.0.0.0.118 /remote/scm/rsync/builds/v_dialer/FailedInformal/3.0.0.0.118 No such file or directory
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: problem to open a specified path file in open system call
by tirwhan (Abbot) on Jul 14, 2007 at 12:43 UTC | |
|
Re: problem to open a specified path file in open system call
by naikonta (Curate) on Jul 14, 2007 at 12:43 UTC | |
by Anonymous Monk on Jul 14, 2007 at 13:03 UTC | |
by naikonta (Curate) on Jul 14, 2007 at 13:31 UTC | |
by blazar (Canon) on Jul 15, 2007 at 07:36 UTC | |
by naikonta (Curate) on Jul 15, 2007 at 13:27 UTC | |
by almut (Canon) on Jul 14, 2007 at 13:46 UTC |