looping questions
- From: lerameur <lerameur@xxxxxxxxx>
- Date: Fri, 28 Sep 2007 13:07:08 -0700
Hello,
this is not a perl problem (maybe it is). The function does work, but
gave me error . there are 4 files into the traffic directory, the loop
goes into 24 possiblility, copies the four files and gives me 20
errors. I decided to add an IF statement to only copy if the file
exists. what is wrong with my IF loop ?
thanks
Ken
for my $hours ('00'..'23') {
$file23 = glob("$timestamp2$hours*") ;
print "$timestamp2: " ,$timestamp2, "\n";
print "file23: " ,$file23, "\n";
if ($file23 == 1){
system(`cp /input/fttr/traffic/$file23 /input/$Out_directory `);
}
$hours++;
}
.
- Follow-Ups:
- Re: looping questions
- From: Joe Smith
- Re: looping questions
- From: xhoster
- Re: looping questions
- From: Greg Bacon
- Re: looping questions
- From: Jim Cochrane
- Re: looping questions
- Prev by Date: Re: How to get some specify lines in a block of a file?
- Next by Date: Re: creating something M$ Excel can read?
- Previous by thread: FAQ 3.24 Why don't Perl one-liners work on my DOS/Mac/VMS system?
- Next by thread: Re: looping questions
- Index(es):
Relevant Pages
|