Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: (Sort of) poll: what Perl6 features do you consider {likely,desirable} to leak into P5?

by brian_d_foy (Abbot)
on Mar 09, 2005 at 15:01 UTC ( #437922=note: print w/replies, xml ) Need Help??


in reply to Re: (Sort of) poll: what Perl6 features do you consider {likely,desirable} to leak into P5?
in thread (Sort of) poll: what Perl6 features do you consider {likely,desirable} to leak into P5?

The Perl5 module Switch gives that to us today. There are a lot of other things that we have today, and Scott Walter's new book, Perl 6 Now, talks about a lot of them. :)

Update: Yep, it's a source filter and it's not native, but it is there :)

--
brian d foy <bdfoy@cpan.org>
  • Comment on Re^2: (Sort of) poll: what Perl6 features do you consider {likely,desirable} to leak into P5?

Replies are listed 'Best First'.
Re^3: (Sort of) poll: what Perl6 features do you consider {likely,desirable} to leak into P5?
by rnahi (Curate) on Mar 09, 2005 at 15:57 UTC

    Switch is hardly comparable to a native implementation.

    From the docs:
    BUGS
    There are undoubtedly serious bugs lurking somewhere in code this funky :-) Bug reports and other feedback are most welcome.

    LIMITATIONS
    Due to the heuristic nature of Switch.pm's source parsing, the presence of regexes specified with raw ?...? delimiters may cause mysterious errors. The workaround is to use m?...? instead.
    Due to the way source filters work in Perl, you can't use Switch inside an string eval.
    If your source file is longer then 1 million characters and you have a switch statement that crosses the 1 million (or 2 million, etc.) character boundary you will get mysterious errors. The workaround is to use smaller source files.

    Not the kind of things you'd like to deal with when you are coding in a hurry ...

Re^3: (Sort of) poll: what Perl6 features do you consider {likely,desirable} to leak into P5?
by holli (Monsignor) on Mar 09, 2005 at 16:13 UTC
    To use Switch; is definitly a bad idea. I just don't get it why such a wiggly thing is in the core.


    holli, /regexed monk/

      Personally, I don't like any source filters, but other people have different ideas about them. I tend to think they are just asking for trouble (and may be an example of how Perl is too flexible).

      Still, people like to play with those. I've never really longed for a switch statement, so I don't mind either way as long as it doesn't show up in my production code. :)

      --
      brian d foy <bdfoy@cpan.org>
        well, source filters which do some-encoding=>utf8 conversion are perfectly valid and I use those without fear, when write Russian perl programs, and they transparently do goood unicode work.
        use encoding cp1251=>Filter=>1; print "here is russian string, which just work, despite its not utf-8" +;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2019-11-13 09:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (70 votes). Check out past polls.

    Notices?