Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: direct data to a socket

by demoralizer (Beadle)
on Oct 22, 2014 at 08:54 UTC ( [id://1104655]=note: print w/replies, xml ) Need Help??


in reply to Re: direct data to a socket
in thread direct data to a socket

Thanks for your answer Loops...

what I'm really looking for is the meaning of this <, the whole rest is quite simple and completely clear.

I know this redirection from shell command line but not within perl... is it the same meaning here?
Can you point me to perldoc where this is described, please?

Replies are listed 'Best First'.
Re^3: direct data to a socket
by Corion (Patriarch) on Oct 22, 2014 at 08:57 UTC

    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.

      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...

        In C++, a similar situation exists even in the standard: operator>>.
        لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
      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!
Re^3: direct data to a socket
by Loops (Curate) on Oct 22, 2014 at 08:58 UTC
    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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1104655]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-03-29 06:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found