Last thursday, parrot 1.1 was out, and it comes with lots of changes compared to parrot 1.0.
One of the strange syntax present in my last script, was a line like:
In that case, the first = is the well known assignation, and the second = was a prefix operator, that took the next element of the list that was preceeding.while my $tat = =$*IN { ... }
= as a prefix operator has been deprecated in favour of '.get' function .
so that code, now would be like
Nothing else for the moment
#!/tmp/rakudo/perl6
sub printa_rusc($f, $c){
my $first = ' - ' x $c ;
$first.chop.say; #chop is non
my $top_line = '/ \_' x $c;
my $bottom_line = '\_/ ' x $c;
for 1..$f {
$top_line.chop.say;
$bottom_line.chop.say;
}
}
while my $tat = $*IN.get {
my @arr=$tat.split(/\s+/);
@arr.perl.say;
if 2==@arr.elems {
printa_rusc(@arr[0], @arr[1]); #not $arr[0]
} else {
"Bad format. Enter only 2 integers".say;
}
}
# vim: set tabstop=4 shiftwidth=4 foldmethod=marker ft=perl: ##
No hay comentarios:
Publicar un comentario