Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Split does not behave like a subroutine

by haukex (Archbishop)
on Jul 22, 2020 at 18:27 UTC ( [id://11119672]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub foo {
        my @x = ("a", @_, "b"); # interpolation
    ...
    # also: comma operator in scalar context via "return"
    my $x = foo("u", "v");
    # $x is "y" !!
    
  2. or download this
    sub mysplit1        { ... }
    sub mysplit2 ($$;$) { ... }
    ...
     mysplit1(":", @x);  # arguments to mysplit1 are flattened
     mysplit2(":", @x);  # parsed like mysplit2(":", scalar(@x)) !!!
    &mysplit2(":", @x);  # prototype is ignored, arguments are flattened!
    

Log In?
Username:
Password:

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

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

    No recent polls found