in reply to Re^2: Perl Switch Errors on certain version
in thread Perl Switch Errors on certain version

I believe the perldoc refers to the practice of using "/.../" for a match instead of "m/.../", regardless of the actual delimiting character used.


Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian W. Kernighan
  • Comment on Re^3: Perl Switch Errors on certain version

Replies are listed 'Best First'.
Re^4: Perl Switch Errors on certain version
by Perl Mouse (Chaplain) on Nov 29, 2005 at 11:58 UTC
    I don't think so. If the manual had meant "/.../", it would have written "/.../". I think the manual page says "?...?" because it means "?...?". Why do you think the manual page would use a rarely used construct, if it meant an often used one?
    Perl --((8:>*

      Good question. Looks like a logical error on my part, if so, mea culpa. After taking a cursory look through Switch.pm I can't see why "?..?" should cause a different error from "/../", but then again it's not obvious to me why either should cause an error at all, so that's not saying much.

      To be honest, if I were having the OP's problem I'd still try replacing all "/../" with "m/../" (well, no, I'd rewrite the code to not use Switch.pm, but anyway) just on the off-chance, so maybe my first node still has some merit.


      Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian W. Kernighan