This is magic employed by IO::All.
If you want to know the details, IO::All overrides some operators of Perl to make the normal Perl syntax do something different when dealing with IO::All objects. The expression is simply $a < $b, the comparison expression. Except that the IO::All objects do something different when "compared" with something, to make this syntax appear like shell redirection.
| [reply] [d/l] |
Wow, that's icky. I understand why overloading exists, and needs to exist. Things like being able to subtract two DateTime objects and get a DateTime::duration object are the stuff of which consistent, intuitive behavior are made. But overloading what is normally a comparison operator to do something completely semantically unrelated to comparison doesn't make me smile. If it were in the ACME:: namespace, that would be one thing...
| [reply] |
In C++, a similar situation exists even in the standard: operator>>.
| [reply] |
Now it's clear or at least I know where to search for :)
Thanks a lot to all of you, for bringing some enlightenment to me!
| [reply] |
Updated the original post, to be more clear about that part, but not quickly enough, sorry. As I said in that update, this is a specific operator overload implemented by IO::All. It is very specific to objects created with IO::All and so you wont see examples of usage like this anywhere else in perldoc. | [reply] |