I understand that it is proof-of-concept code, but the first example is probably better rephreased as:
and, of course, you don't even need a variable for the array:my @step = (1..9, 0); # Use of comma operator, no need for push my $step = join '', @step; # Use of specific function for the task print ($step x 7);
or for the scalar:my $step = join '', (1..9, 0); print ($step x 7);
This results in less code and improved readability IMHO. Well, maybe the last is not so readable :)print ((1..9, 0) x 7);
Regarding the second example, I suggest that you provide also some examples of how your scripts behaves, showing sample input, the resulting output and pointing out where you expected different results.
Update: added one-line example and comment about readability.
Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf
In reply to Re: I'm reading a book! It's given me more questons!
by polettix
in thread I'm reading a book! It's given me more questons!
by Petras
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |