in reply to Re: Perl's Bad Ideas
in thread Perl's Bad Ideas

3. I personally don't hate these. Once you learn to scope your variables (and these can be a great motivator to learn). OTOH I can understand the desire for per-FH, but it seems like globally settable *defaults* might be nice.

5. *sigh* yeah the sigil thing is hard on beginners, now however I am not happy about having to switch back... In some ways it does make sense as well, $ is scalar and you're getting a single element (scalar) out. Slices use @ denoting multiple elements returned.

6. Why? Implementation, or too much for one operator?

--
perl -pe "s/\b;([st])/'\1/mg"

Replies are listed 'Best First'.
Re: Perl's Bad Ideas
by Dominus (Parson) on Apr 07, 2002 at 01:01 UTC
    Says belg4mit:
    6. [ <> globbing was a bad idea ] Why? Implementation, or too much for one operator?
    Too much semantics on one piece of notation. If Larry hadn't unnecessarily overloaded <> to do globbing, then you would be able to write
    @array_of_fhs = ...; my $line = <$array_of_fhs[37]>;
    Which you can't presently do, and which frequently trips people up. Without the glob overloading, this would have meant just what it appears to.

    --
    Mark Dominus
    Perl Paraphernalia

      >Too much semantics on one piece of notation. If Larry hadn't unnecessarily overloaded <> >to do globbing, then you would be able to write
      That's what I said, or rather asked if that was why clintp disliked it.

      As for the catch, yes. I have had to resort to readline before because of that.

      --
      perl -pe "s/\b;([st])/'\1/mg"

        That's exactly why I dislike it. I think I really started to dislike it the first time I had to teach filehandles and noted that...oh yeah, the thing in <>'s has to look *exactly* like <identifier> or <$identifier> or what happens is something else entirely. Ugh.