Use of uninitialized value Error



Hello,

In the Script below the line: last if ($num >= 35)
is giving me this error: Use of uninitialized value in int

How do I avoid this error?


my @files contains: Gambia001.tiff through Gambia100.tiff

#!/usr/bin/perl -w

my @files =<*>;
$tmp= 1;


for (@files){
my $old = $_;
$_ =~ /(\d+)/;
$num = int($1);
#$_ =~s/Gambia_Pa_Bobo_kuliyo_\d+/Gambia_Pa_Bobo_kuliyo_$tmp/i;
print "$num\n";
#$tmp++;
last if ($num >= 35);
# rename($old,$_);
}

Thx,
Dave GIlden
(kora musician / audiophile / webmaster @ www.coraconnection.com / Ft. Worth, TX, USA)
.



Relevant Pages

  • Re: Scanset
    ... > int main ... Thx a lot Pete! ... Prev by Date: ...
    (comp.lang.c)
  • Re: Conditional looping to create partial combinations, how possible?
    ... Let's say I have 2 vectors that may contain Int and String ... elements respectively, or be empty. ... Is there an elegant way to avoid all the if statements? ...
    (comp.programming)
  • Re: more hand written integer pow() functions (LONG POST)
    ... > trying to avoid implementation defined behavior. ... static int ibmpow ... I tested by replacing the test loop ... And the ibmpow() version is still faster than pow_b. ...
    (comp.lang.c)
  • Re: 0/1 Knapsack problem, what am I doing wrong
    ... Thx, I was secretly hoping for something like that... ... converted to int so the effect is that M only holds integers. ... You need to test inside the loop as well. ... Everything will be okay ...
    (comp.lang.c)
  • Re: Stack depth
    ... happening by writing incorrect and nonportable C: ... int fact ... Since intptr_t is an optional type, n order to avoid UB, you need to ...
    (comp.lang.c)