in reply to For Statement & Letters

Perl has a 'magic' incrementor. The code you posted for letters will work if you change the comparison operator <= to its string equivalent le:
use strict; my $start_letter = 'A'; my $end_letter = 'D'; for (my $i=$start_letter; $i le $end_letter; $i++) { print "\$i = $i\n"; }
As others have stated there are better ways to do this in Perl...

Replies are listed 'Best First'.
Re^2: For Statement & Letters
by Anonymous Monk on Jan 27, 2010 at 22:23 UTC
    This is what I was looking for and works perfectly.
    Thanks for the response, I really appreciate it.