Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

split limit of 0 ignored #1974

Closed
p5pRT opened this issue May 15, 2000 · 3 comments
Closed

split limit of 0 ignored #1974

p5pRT opened this issue May 15, 2000 · 3 comments

Comments

@p5pRT
Copy link

p5pRT commented May 15, 2000

Migrated from rt.perl.org#3247 (status was 'resolved')

Searchable as RT3247$

@p5pRT
Copy link
Author

p5pRT commented May 15, 2000

From @pjscott

[This seemed to drop into a black hole the first 2 times I sent it...]

Looks like a split LIMIT of 0 is treated like it's not there​:

$ perl -MO=Deparse -e '() = split //, $x, 1'
() = split(//, $x, 1);

$ perl -MO=Deparse -e '() = split //, $x, 0'
() = split(//, $x, 1);

$ perl -MO=Deparse -e '() = split //, $x, 2'
() = split(//, $x, 2);

5.6.0 and 5.005_03. If this is the correct behavior, perlfunc should be
changed from

  When assigning to a list, if LIMIT is omitted, Perl supplies a
  LIMIT one larger than the number of variables in the list
to
  When assigning to a list, if LIMIT is omitted or 0, Perl supplies a
  LIMIT one larger than the number of variables in the list

@p5pRT
Copy link
Author

p5pRT commented Jul 17, 2003

From @rgs

Resolved by change #20162.

@p5pRT
Copy link
Author

p5pRT commented Jul 17, 2003

@rgs - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant