Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Use of implicit split to @_ is deprecated

by Abigail-II (Bishop)
on Jun 04, 2004 at 15:49 UTC ( [id://360952]=note: print w/replies, xml ) Need Help??


in reply to Re: Use of implicit split to @_ is deprecated
in thread Use of implicit split to @_ is deprecated

Update: or $var_cdrcellsplit = do { my @f = split(...) }; or $var_cdrcellsplit = () = split(//, $var_cdrcellname, -1)

They are not equivalent. And you also may expect that leaving the -1 off doesn't make a difference. However, try to guess the output of the following program:

#!/usr/bin/perl use strict; use warnings; my $str = "foobar"; my $c1 = do {my @f = split // => $str}; my $c2 = () = split // => $str => -1; my $c3 = () = split // => $str; print "$c1 $c2 $c3\n"; __END__
Answer after the <readmore> tag.

It prints 6 7 1.

Abigail

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2024-04-18 21:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found