Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Module IO::All Released - WOW!

by flyingmoose (Priest)
on Mar 16, 2004 at 23:46 UTC ( [id://337173]=note: print w/replies, xml ) Need Help??


in reply to Module IO::All Released - WOW!

Ok, I read the perl.com article (and the CPAN docs), and I'm sorta thinking...yes, this is a neat idea...but I'm not sure if it is special yet.

What I mean to say is, well, it seems to say that all IO is the same, and that implication seems to imply the following meaning...when, in reality, these things that are being joined as one all are different...leaving me inclined, I think, to keep doing everything seperately in the name of understanding.

io('/tmp') >> io('server.com:9999');

So the question is, is that sensical? We're just routing IO right? What about routing a socket to append to a directory? If we have this code work on arbitary scalars, we really don't know what is going on, and not all operations are valid.

$x='server.com:9999'; $y='/tmp'; io($x) > io($y)

So what are the rules that define when this operation works correctly for any $x and $y ... is this obvious? Is this something that can be tested for programatically?

Anyhow, definitely some spiffy concepts, and I apologize for putting on my manager hat :) It just seems to raise questions of maintainability and whether or not all is obvious. In most modules, hidden DWIMerry is cool, here though, the goal is simplication, and I think that hidden DWIMerry could (and I might be wrong) lead to trouble.

Feel free to open up for debate. I'm convinceable. I can also be bribed with cash or steak.

Replies are listed 'Best First'.
Re: Re: Module IO::All Released - WOW!
by Anonymous Monk on Mar 17, 2004 at 05:03 UTC

    I gave your snippet that makes no sense a shot. I was surprised to get an error considering the docs say that no validating is done. But here you are (and you know any DWIM behaviour out of this really wouldn't make sense right?):

    #!c:/perl/bin/perl -w $|++; use strict; use IO::All; my $x = 'localhost:12345'; my $y = 'c:/servdata'; io($x) > io($y); __END__ Undefined behavior for overloaded IO::All operation: 'socket > file' a +t C:/Perl/site/lib/IO/All.pm line 840.
      Darn, there was a sadistic part of me that was wishing this might do something really bizarre, but yeah, I'm glad it didn't work. It certaintly does make you ask what that operator really is, though... I figure if you can't surmise an operator's purpose in a few words you have a rather confusing operator.

      % = modulus

      > is less than, except when both sides are an IO::All, undefined if IO:All on one side, but IO:All must be a file, or possibly a socket, but never a directory, but sometimes a port, and ... err...

Re: Re: Module IO::All Released - WOW!
by perrin (Chancellor) on Mar 17, 2004 at 16:11 UTC
    I agree. And the stuff about inheriting exporting made my skin crawl. It's a neat trick, but it's not something I'd be happy to see in code I had to work on.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (1)
As of 2024-04-25 04:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found