msh210 has asked for the wisdom of the Perl Monks concerning the following question:
I can't get Perligata array indices to work: it uses the index instead of the array value. Here's my code, with # comments where the result is unexpected:
adnota -MLingua: +:Romana::Perligata ute strict. ute warnings. adnota use stric +t; use warnings; huic vestibulo perlegementum da. adnota $_ = read +line STDIN; his lacunam tum hoc scindementa da. adnota @_ = spli +t ' ', $_; meis apis lacunam tum hoc scindementa da. adnota my @ap = +split ' ', $_; meo io nullum da. adnota my $i=0; meo mo haec admetamentum da. adnota my $m = $ +#_; per in nullum tum mum conscribementis fac sic adnota for (0..$ +m) { hoc tum lacunam egresso scribe. adnota print S +TDOUT $_, ' '; hoc horum tum lacunam egresso scribe. adnota print S +TDOUT $_[$_], ' '; # prints $_ instead cis adnota } scribe novumversum egresso. adnota print STD +OUT $/; meis bis. adnota my @b; meo vo. adnota my $v; per vum in nullum tum mum conscribementis fac sic adnota for $v (0 +..$m) { vum tum lacunam egresso scribe. adnota print S +TDOUT $v, ' '; vum aporum tum lacunam egresso scribe. adnota print S +TDOUT $ap[$v]; # prints $v instead vo borum vum aporum da. adnota $b[$v] += $ap[$v]; # doesn't assign adnota + # (@b has a 'once' warning, not on adnota + # this line, in simpler versions of adnota + # this script) cis adnota } scribe novumversum egresso. adnota print STD +OUT $/; per in his fac sic scribe hoc tum lacunam egresso cis adnota for (@_) +{print STDOUT $_, ' '} scribe novumversum egresso. adnota print STD +OUT $/; per in bis fac sic scribe hoc egresso cis adnota for (@b) +{print STDOUT $_} # doesn't print
Can anyone help, please?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perligata array indices
by TheDamian (Vicar) on Jul 02, 2016 at 04:01 UTC | |
by msh210 (Monk) on Jul 05, 2016 at 17:13 UTC | |
by TheDamian (Vicar) on Jul 05, 2016 at 21:24 UTC | |
by TheDamian (Vicar) on Jul 07, 2016 at 00:36 UTC | |
by msh210 (Monk) on Jul 07, 2016 at 22:08 UTC | |
|
Re: Perligata array indices
by Anonymous Monk on Jun 28, 2016 at 21:18 UTC |