in reply to Re^2: Reference madness
in thread Reference madness

> I would say it's a quite unexpected behaviour (at least by me)

Once you understand how references work, there's no surprise. \@say is the reference to @say, when you change the contents of @say, \@say still points to @say, i.e. to the new contents of it. When you store a reference, you don't store the contents.

> when I dump \@say, it prints out the expected results (different for each animal)

Of course. Otherwise, changing @say would have to edit the already printed output.

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,