in reply to 2 basic questions
The first, obviously, is a simplied loop using the range operator (alternate syntax is shown by other replies above); the second takes advantage of the otherwise little-used chop. Note that it will "work" even if your charpair is NOT an ordered pair.my $check = "A"; for (1..2) { $check++; } say $check; #2: my $input = "xy"; $input = reverse ($input); chop $input; say $input;
Please take these for examples, and set yourself the task of finding at least two other ways to answer each of your questions.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: 2 basic questions
by Anonymous Monk on Apr 29, 2013 at 14:53 UTC |