sanjay nayak has asked for the wisdom of the Perl Monks concerning the following question:
When i run this program it showsuse strict; use warnings; my $incr=0; my $incr1=0; my @need = qw(sanjay samir sanjay sudha jasmin sanjmay); my @array1=""; for(;;) { last if $need[$incr] eq ''; if ($need[$incr]=~ qr/^sanj/) { $array1[$incr1]= $need[$incr]; $incr1++; } $incr++; } print @array1;
Use of uninitialized value in string eq at test10.pl line 9
sanjaysanjaysanjmay
Plz. suggest me some suitable code to avoid the above warning?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Why "use of uninitialized value" warning comes?
by Corion (Patriarch) on Nov 01, 2006 at 12:25 UTC | |
by suaveant (Parson) on Nov 01, 2006 at 14:05 UTC | |
Re: Why "use of uninitialized value" warning comes?
by davorg (Chancellor) on Nov 01, 2006 at 12:44 UTC | |
Re: Why "use of uninitialized value" warning comes?
by reneeb (Chaplain) on Nov 01, 2006 at 12:22 UTC | |
by ikegami (Patriarch) on Nov 01, 2006 at 16:28 UTC | |
Re: Why "use of uninitialized value" warning comes?
by liverpole (Monsignor) on Nov 01, 2006 at 15:07 UTC | |
by ikegami (Patriarch) on Nov 01, 2006 at 16:49 UTC |
Back to
Seekers of Perl Wisdom