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
misleading error message #887
Comments
From mstevens@kronos.imaginet.co.ukmstevens@wildcat:~> cat test.pl @array = (1, 2, 3); map { next if (2 == 2); } @array; mstevens@wildcat:~> perl test.pl The error generated claims that next is outside a block, but mstevens@wildcat:/usr/local/bin> perldoc -f map =item map EXPR,LIST Evaluates the BLOCK or EXPR for each element of LIST (locally setting $_ to each @chars = map(chr, @nums); translates a list of numbers to the corresponding characters. And %hash = map { getkey($_) => $_ } @array; is just a funny way to write %hash = (); Note that, because $_ is a reference into the list value, it can be used Perl Info
|
From [Unknown Contact. See original ticket]
next, last, and redo operate on blocks governed by while loops, for loops, --tom |
From @TimToadyTom Christiansen writes: The error message is misleading. It should say "loop block" rather than Larry |
From [Unknown Contact. See original ticket]On Wed, Nov 24, 1999 at 10:57:34AM -0700, Tom Christiansen wrote:
I happily accept "you can't do this". What I dislike is an error message saying that a particular context is The two statements are contradictory as given, as far as I can tell. The phrase 'block' may be an oversimplification, but what I'm bothered |
From [Unknown Contact. See original ticket]On Wed, Nov 24, 1999 at 06:08:22PM +0000, Michael Stevens wrote:
Reply to my own email but... that's awful english. I mean that, if it |
From [Unknown Contact. See original ticket]
I was thinking of that. Well, to be honest, I considered but discarded --tom |
From @TimToadyTom Christiansen writes: None of the things you mention are loop blocks. Do loops come the closest, Larry |
From [Unknown Contact. See original ticket]
I would not say they are, but then again, I happen to know what's --tom |
From [Unknown Contact. See original ticket]If I send out one more message that fails to parse today, I'm going to --tom |
From [Unknown Contact. See original ticket]Larry Wall writes:
Another thing which confuses a lot is "when an operator expected". only a binary- or a postfix-operator makes sense here or something similar? Ilya |
From The RT System itselfclosed: (at least) perl-current @7385 contains Larry's requested fix. |
Migrated from rt.perl.org#1819 (status was 'resolved')
Searchable as RT1819$
The text was updated successfully, but these errors were encountered: