Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^9: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff

by likbez (Sexton)
on Oct 05, 2020 at 22:01 UTC ( [id://11122556]=note: print w/replies, xml ) Need Help??


in reply to Re^8: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
in thread What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff

This node falls below the community's threshold of quality. You may see it by logging in.
  • Comment on Re^9: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
  • Select or Download Code

Replies are listed 'Best First'.
Re^10: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
by choroba (Cardinal) on Oct 06, 2020 at 21:35 UTC
    The parsing of such an ambiguous expression depends on the prototypes of the subroutines/functions involved.
    #!/usr/bin/perl use warnings; use strict; use feature qw{ say }; sub single ($) { chr $_[0] } sub two ($$) { join "", map chr, @_ } say for split single 32, 'a b c'; say for split two(32, 32), 'a b c'; # This fails with "Too many arguments for main:two" say for split two(32, 32), 'a b c';

    split can take more than one argument, so it greedily takes all it can.

    > Unless this problem is fixed

    It's not a problem, it's a documented behaviour.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
Re^10: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
by GrandFather (Saint) on Oct 06, 2020 at 00:50 UTC

    Perl doesn't require you to not use parenthesis so just add them in as required for your comfort level. Why is that a problem?

    get_config(split(/$s/), $_); get_config(split(/$s/, $_));
    Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
    A reply falls below the community's threshold of quality. You may see it by logging in.
    A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2024-04-23 09:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found