Gaal Yahas skribis 2005-05-02 22:25 (+0300):
> open 'ls', '|-'; # or even
> open 'ls', :pipe => 'from'
I dislike the hard-to-tell-apart symbols '<' and '>' for modes. 'r' and
'w' are much easier, and get rid of the awful left/right "mnemonic" that
fails to make sense to GUI users. Spelling out 'write' and 'pipe' is
even better, but sucks for oneliners and quick hacks. I already
suggested a syntax like '+$write|w' for having multiple ways to say the
same thing. I don't like an explicit :mode. Let Perl figure that out
based on passed named arguments.
But, if we're keeping these forms, then I think we should break
tradition for the pipe. In Perl, we have called pipes '==>' and '<==',
and I wonder why it would be much different for open. It also frees us
from '|-' and '-|'. It took years before I knew which one to use without
using the dictionary. Just use '==>' and '<=='.
OTOH - people might think the '<' and '>' are also related to their
operators. I see this as another good reason to not use \W symbols at
> This pipe as it is can automatically do open2/3 if both :from and :to
> are given. I don't know if this is a good thing.
I think it's a good thing. It won't remove the traps, but it will make
using bidirectional pipes much easier - an operator that can be done
without the manual.
> One suggestion for the 'auto' encoding was to honor a BOM if it is
> present but default to ASCII otherwise. Or should we UTF-8 otherwise?
> Or what's in the environment...?
Or guess it, -T alike. Browsers do a great (but of course not perfect)
job at guessing. I want Perl to have such dwimmery too.
> And what about IO layers? :)
I can imagine a similarity to sub wrapping: $fh.wrap(Class)