http://www.perlmonks.org?node_id=581662


in reply to Why "use of uninitialized value" warning comes?

use strict; use warnings; my $incr=0; my @need = qw(sanjay samir sanjay sudha jasmin sanjmay); my @array1; for my $elem(@need) { if ($elem=~ qr/^sanj/){ push @array1,$elem } } print @array1;

Replies are listed 'Best First'.
Re^2: Why "use of uninitialized value" warning comes?
by ikegami (Pope) on Nov 01, 2006 at 16:28 UTC
    qr/^sanj/ should be /^sanj/