On Mon, 2008-11-24 at 15:57 +0530, sanket vaidya wrote: > my ($bi, $bn, @bchrs); > > my $boundry = ""; > > foreach $bn (48..57,65..90,97..122) { > > > > $bchrs[$bi++] = chr($bn); > > print "$bchrs[$bi]"; > > } > > Output: > > Use of unitialized value within @bchrs >
You increment $bi after you store the value so in the print statement you are pointing at the next item in the array, which doesn't exists yet. Try: my ($bi, $bn, @bchrs); my $boundry = ""; $bi = 0; foreach $bn (48..57,65..90,97..122) { $bchrs[$bi] = chr($bn); print $bchrs[$bi]; }continue{ $bi++; } -- Just my 0.00000002 million dollars worth, Shawn The map is not the territory, the dossier is not the person, the model is not reality, and the universe is indifferent to your beliefs. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/