Hi y'all, Just dabbling with Perl and running the below gives me this error: Use of uninitialized value $i in sprintf. I'm new so googling this just made my head swim. Thanks for any help. Rob #!C:/Perl/bin/perl.exe use strict; use warnings; my $Column = 1; my $Out = ''; for(my $i=33; $i<=126; $i++){ $Out .= sprintf("%3s" . $i) . "=" . chr($i) . " "; if(($Column % 10) == 0){ $Out .= "\n"; } $Column += 1; } print $Out . "\n"; print "Finished!\n";
I don't have a compiler handy atm, but shouldn't it be sprintf("%3s", $i) ? That is, comma instead of period?
Thanks, it would work fine without use strict, so I thought I copied it correctly (from a book). Guess my eyes aren't as good as they used to be.