in reply to BRUTEFORCE problem and a ?bug?
If you have to generate a sequence of letters, this will do:
my @alphabeth = 'a' .. 'z';
You never initialise $slovo, but you keep using it, expecially in the while test. Moreover, are you sure that you get an ERROR and not a WARNING?
If you want to increment a letter, it's as easy as doing this:
my $letter = 'p'; $letter++; # Now $letter is 'q'
Note that you should chomp immediately when you get the input letter, something along the lines:
This also means that you don't need to chomp() in the while loop.chomp(my $hladane = <STDIN>);
Regarding the newline problem, note that you never chomp() the $lf variable, that's where you get your newline from.
Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: BRUTEFORCE problem and a ?bug?
by xoddam (Novice) on Mar 19, 2007 at 17:03 UTC | |
by polettix (Vicar) on Mar 19, 2007 at 17:22 UTC |