Perl

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • unbalanced "/" before "switch" statement cause fatal error

    13 answers - 243 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Hi,
    I was going to report this as a bug in Switch, after spending over an
    hour debugging why a script was failing compilation. Then I saw it was
    already reported over a year ago :(
    Any chance of this being fixed?
    Thanks,
  • No.1 | | 465 bytes | |

    11/23/05, Kaye wrote:
    I was going to report this as a bug in Switch, after spending over an
    hour debugging why a script was failing compilation. Then I saw it was
    already reported over a year ago :(

    Any chance of this being fixed?

    Well, I think Damian is preparing some upcoming release. That said,
    the last time I tried to fix a bug in Switch -- I thing that might be
    this one -- I ran away screaming (when short of tuits).
  • No.2 | | 423 bytes | |

    11/23/05, Rafael Garcia-Suarez wrote:

    Well, I think Damian is preparing some upcoming release. That said,
    the last time I tried to fix a bug in Switch -- I thing that might be
    this one -- I ran away screaming (when short of tuits).

    I don't blame you

    The only thing I can add is that if you comment out line 451 in Switch.pm:
    "/"=meta_bop {$_[0] / $_[1]},

    The bug goes away. Duh :)
  • No.3 | | 535 bytes | |

    Wed, Nov 23, 2005 at 04:02:41PM +0100, Rafael Garcia-Suarez wrote:
    11/23/05, Kaye wrote:
    I was going to report this as a bug in Switch, after spending over an
    hour debugging why a script was failing compilation. Then I saw it was
    already reported over a year ago :(

    Any chance of this being fixed?

    Well, I think Damian is preparing some upcoming release. That said,
    the last time I tried to fix a bug in Switch -- I thing that might be
    this one -- I ran away screaming (when short of tuits).
  • No.4 | | 912 bytes | |

    (Sorry about the blank reply, must have hit the wrong key.)

    Wed, Nov 23, 2005 at 04:02:41PM +0100, Rafael Garcia-Suarez wrote:
    11/23/05, Kaye wrote:
    I was going to report this as a bug in Switch, after spending over an
    hour debugging why a script was failing compilation. Then I saw it was
    already reported over a year ago :(

    Any chance of this being fixed?

    Well, I think Damian is preparing some upcoming release. That said,
    the last time I tried to fix a bug in Switch -- I thing that might be
    this one -- I ran away screaming (when short of tuits).

    See also:

    I looked into this bug, too. Unfortunately, I don't think it's possible to
    fix, because it requires accurately parsing the entire script, rather than
    just the heuristic parsing that Switch.pm does currently. (The matching
    of the regex is done with ().)

    Ronald
  • No.5 | | 623 bytes | |

    Wed, 23 Nov 2005 17:41:40 +0200, Kaye <offer.kaye (AT) gmail (DOT) comwrote:

    11/23/05, Rafael Garcia-Suarez wrote:

    Well, I think Damian is preparing some upcoming release. That said,
    the last time I tried to fix a bug in Switch -- I thing that might be
    this one -- I ran away screaming (when short of tuits).

    I don't blame you

    The only thing I can add is that if you comment out line 451 in Switch.pm:
    "/"=meta_bop {$_[0] / $_[1]},

    The bug goes away. Duh :)

    And will Switch.pm then also work nicely with defined-or?
    That is the major reason I never use Switch.
  • No.6 | | 374 bytes | |

    11/23/05, Ronald J Kimball wrote:

    I looked into this bug, too. Unfortunately, I don't think it's possible to
    fix, because it requires accurately parsing the entire script, rather than
    just the heuristic parsing that Switch.pm does currently. (The matching
    of the regex is done with ().)

    Ronald

    Would PPI () help here?

    Regards,
  • No.7 | | 855 bytes | |

    Wed, Nov 23, 2005 at 06:53:36PM +0100, H.Merijn Brand wrote:
    Wed, 23 Nov 2005 17:41:40 +0200, Kaye <offer.kaye (AT) gmail (DOT) comwrote:

    11/23/05, Rafael Garcia-Suarez wrote:

    Well, I think Damian is preparing some upcoming release. That said,
    the last time I tried to fix a bug in Switch -- I thing that might be
    this one -- I ran away screaming (when short of tuits).

    I don't blame you

    The only thing I can add is that if you comment out line 451 in Switch.pm:
    "/"=meta_bop {$_[0] / $_[1]},

    The bug goes away. Duh :)

    And will Switch.pm then also work nicely with defined-or?

    Defined-or doesn't exist in current Perl, so why should it?

    Abigail

    PGP SIGNATURE
    Version: GnuPG v1.4.0 (GNU/Linux)

    lf9XFCaVmYvzW9fJ5f1HRGk=
    =saGv
    PGP SIGNATURE
  • No.8 | | 897 bytes | |

    Wed, 23 Nov 2005 20:55:26 +0100, Abigail <abigail (AT) abigail (DOT) nlwrote:

    Wed, Nov 23, 2005 at 06:53:36PM +0100, H.Merijn Brand wrote:
    Wed, 23 Nov 2005 17:41:40 +0200, Kaye <offer.kaye (AT) gmail (DOT) com>
    wrote:

    11/23/05, Rafael Garcia-Suarez wrote:

    Well, I think Damian is preparing some upcoming release. That said,
    the last time I tried to fix a bug in Switch -- I thing that might be
    this one -- I ran away screaming (when short of tuits).

    I don't blame you

    The only thing I can add is that if you comment out line 451 in
    Switch.pm: "/"=meta_bop {$_[0] / $_[1]},

    The bug goes away. Duh :)

    And will Switch.pm then also work nicely with defined-or?

    Defined-or doesn't exist in current Perl, so why should it?
    - it is in devel
    - Switch is in devel's CRE
    - they don't work together
  • No.9 | | 1681 bytes | |

    H.Merijn Brand wrote:
    Wed, 23 Nov 2005 20:55:26 +0100, Abigail <abigail (AT) abigail (DOT) nlwrote:

    >Wed, Nov 23, 2005 at 06:53:36PM +0100, H.Merijn Brand wrote:

    Wed, 23 Nov 2005 17:41:40 +0200, Kaye <offer.kaye (AT) gmail (DOT) com>
    wrote:

    11/23/05, Rafael Garcia-Suarez wrote:
    Well, I think Damian is preparing some upcoming release. That said,
    the last time I tried to fix a bug in Switch -- I thing that might be
    this one -- I ran away screaming (when short of tuits).

    I don't blame you

    The only thing I can add is that if you comment out line 451 in
    Switch.pm: "/"=meta_bop {$_[0] / $_[1]},

    The bug goes away. Duh :)
    And will Switch.pm then also work nicely with defined-or?
    >Defined-or doesn't exist in current Perl, so why should it?

    - it is in devel
    - Switch is in devel's CRE
    - they don't work together

    Note that Damian has said that Switch.pm is a module "you shouldn't use
    in production because [its] purpose is to explore and prototype future
    core language features" [1].

    The last time I spoke with Rafael about the subject, he said Switch was
    required because there's another module in the base distribution that
    does use it (despite the proviso from Damian above). I forget which one
    it is, and CPANTS doesn't see it. Perhaps it should be patched to use a
    classic perlish switch construct and remove the Switch dependency, and
    Switch could then be removed from core?

    Can a module be removed from the base distribution?

    David

    1.
  • No.10 | | 753 bytes | |

    11/24/05, David Landgren <david (AT) landgren (DOT) netwrote:
    The last time I spoke with Rafael about the subject, he said Switch was
    required because there's another module in the base distribution that
    does use it (despite the proviso from Damian above). I forget which one
    it is, and CPANTS doesn't see it. Perhaps it should be patched to use a
    classic perlish switch construct and remove the Switch dependency, and
    Switch could then be removed from core?

    Er, I don't think I said that, because that's not true or I was
    very very drunk or one of us mistaked Switch for another module.

    Can a module be removed from the base distribution?

    That's against rules^Wtradition
  • No.11 | | 1484 bytes | |

    Rafael Garcia-Suarez wrote:
    11/24/05, David Landgren <david (AT) landgren (DOT) netwrote:
    >The last time I spoke with Rafael about the subject, he said Switch was
    >required because there's another module in the base distribution that
    >does use it (despite the proviso from Damian above). I forget which one
    >it is, and CPANTS doesn't see it. Perhaps it should be patched to use a
    >classic perlish switch construct and remove the Switch dependency, and
    >Switch could then be removed from core?


    Er, I don't think I said that, because that's not true or I was
    very very drunk or one of us mistaked Switch for another module.

    No, definitely talking about Switch, and I'm sure I was talking to you,
    so that leaves you being very, very drunk. me.

    After some rather laborious searchng I've found XML::ParseDTD and
    Data::Transform. There may be others, alas, gonzui is panicking with 500
    errors about a corrupt database, so that rules out the easy search.

    But since these aren't in core, there shouldn't be a problem, assuming
    prerequisites are followed during their builds.

    >Can a module be removed from the base distribution?


    That's against rules^Wtradition

    What I'm trying to say that if it comes down to Switch or defined-or,
    I'd prefer to have the latter.

    David
  • No.12 | | 1907 bytes | |

    Thu, 24 Nov 2005 14:40:13 +0100, David Landgren <david (AT) landgren (DOT) netwrote:

    Rafael Garcia-Suarez wrote:
    11/24/05, David Landgren <david (AT) landgren (DOT) netwrote:
    >The last time I spoke with Rafael about the subject, he said Switch was
    >required because there's another module in the base distribution that
    >does use it (despite the proviso from Damian above). I forget which one
    >it is, and CPANTS doesn't see it. Perhaps it should be patched to use a
    >classic perlish switch construct and remove the Switch dependency, and
    >Switch could then be removed from core?


    Er, I don't think I said that, because that's not true or I was
    very very drunk or one of us mistaked Switch for another module.

    No, definitely talking about Switch, and I'm sure I was talking to you,
    so that leaves you being very, very drunk. me.

    After some rather laborious searchng I've found XML::ParseDTD and
    Data::Transform. There may be others, alas, gonzui is panicking with 500
    errors about a corrupt database, so that rules out the easy search.

    I cannot see anything in the CRE needing Switch other than Switch itself:

    106 grep -l -r -P 'use\s+Switch' *
    lib/Switch/t/switch.t
    lib/Switch/t/given.t
    lib/Switch/t/nested.t
    lib/Switch.pm
    pod/perl58delta.pod
    pod/perlsyn.pod
    pod/perlfaq7.pod
    pod/perl571delta.pod
    107 >

    But since these aren't in core, there shouldn't be a problem, assuming
    prerequisites are followed during their builds.

    >Can a module be removed from the base distribution?


    That's against rules^Wtradition

    What I'm trying to say that if it comes down to Switch or defined-or,
    I'd prefer to have the latter.

    course!
  • No.13 | | 2586 bytes | |

    Thu, Nov 24, 2005 at 02:40:13PM +0100, David Landgren wrote:
    Rafael Garcia-Suarez wrote:
    11/24/05, David Landgren <david (AT) landgren (DOT) netwrote:
    >>The last time I spoke with Rafael about the subject, he said Switch was
    >>required because there's another module in the base distribution that
    >>does use it (despite the proviso from Damian above). I forget which one
    >>it is, and CPANTS doesn't see it. Perhaps it should be patched to use a
    >>classic perlish switch construct and remove the Switch dependency, and
    >>Switch could then be removed from core?

    >
    >Er, I don't think I said that, because that's not true or I was
    >very very drunk or one of us mistaked Switch for another module.


    No, definitely talking about Switch, and I'm sure I was talking to you,
    so that leaves you being very, very drunk. me.

    After some rather laborious searchng I've found XML::ParseDTD and
    Data::Transform. There may be others, alas, gonzui is panicking with 500
    errors about a corrupt database, so that rules out the easy search.

    But since these aren't in core, there shouldn't be a problem, assuming
    prerequisites are followed during their builds.

    Yeah, well, by that reasoning, we could clean up almost any module in
    the core.

    I'd say, it's unfortunate 'Switch' is in the core, but since it's in,
    it should stay in. Not everyone blindly installs something from CPAN,
    for several reasons. Just hang out on clpm or on Perlmonks, and find
    out how hard it is for some people to get a module installed. Be it
    by their own lack of knowledge, or because of system policy.

    Removing Switch, or any other module, from the core will risk that code
    will break after an upgrade of Perl.

    Perhaps the lesson to learn is to not so easily add new modules to the
    core. ;-)

    >>Can a module be removed from the base distribution?

    >
    >That's against rules^Wtradition


    What I'm trying to say that if it comes down to Switch or defined-or,
    I'd prefer to have the latter.

    What I am saying is that if it comes down to introducing new features
    or not breaking code, I prefer the latter.

    Abigail

    PGP SIGNATURE
    Version: GnuPG v1.4.0 (GNU/Linux)

    4kpNnGYNhT6K/3+kT2eSB0=
    =a/lC
    PGP SIGNATURE

Re: unbalanced "/" before "switch" statement cause fatal error


max 4000 letters.
Your nickname that display:
In order to stop the spam: 3 + 2 =
QUESTION ON "Perl"

EMSDN.COM