But that statement refers to the reference returned by tie which is not an array reference. The tied array works like a normal array.
| [reply] [d/l] |
use ar ;
my @ar ;
my $art = tie @ar, "ar" ;
@ar = (1, 2) ;
My point is, I cannot know what $art is, so to me this is a big no no:
my @ar-deref = @{$art};
| [reply] [d/l] [select] |
for(@ar) {
print "$_\n";
}
| [reply] [d/l] |
My point is, I cannot know what $art is, so to me this is a big no no: my @ar-deref = @{$art};
Yes, I agree that is bad (unless $art overloads @{}), but in the code you showed here, for (tie @ary, "My::Class"), there is no such "bad" de-reference of the return value of tie happening, not even an implicit one. for (tie @ary, "My::Class") { print "$x\n" } will just print something like My::Class=HASH(0x...) - as perlancar said, it's just looping over a one-element list, the return value of tie, and not the elements of @{$art}, as you seemed to be worried about.
| [reply] [d/l] [select] |