P is for Practical | |
PerlMonks |
Re^5: Undocumented join() feature, now defunct? (++$i)by FloydATC (Deacon) |
on Oct 30, 2014 at 09:22 UTC ( [id://1105592]=note: print w/replies, xml ) | Need Help?? |
I think you've pointed out a very cool way join() and tie() could have been used together had this been a known/documented behavior of join() from the beginning and one could even imagine join accepting a {} block or a sub reference to determine how $a and $b should be joined together. Unfortunately, there's no indication that this was intended to be possible and so the documentation should IMHO clearly point out exactly what the limitations of join() are, and that this behaviour is broken in certain versions. OR, they could unoptimize the code and make it official from some future version of Perl while pointing out clearly that although this behaviour can be seen in certain earlier versions it can't be relied upon until this exact version.
After all, tie() is a part of Perl and it's not so unreasonable to try and use it to pull off magic tricks. That's what it's there for, like it or not.
-- FloydATC
Time flies when you don't know what you're doing
In Section
Seekers of Perl Wisdom
|
|