We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Migrated from rt.perl.org#1309 (status was 'resolved')
Searchable as RT1309$
The text was updated successfully, but these errors were encountered:
@new = sort { ($b =~ /=(\d+)/)[0] <=> ($a =~ /=(\d+)/)[0] || uc($a) cmp uc($b) } @old;
should have '/g' as below :-
($b =~ /=(\d+)/g)[0] <=> ($a =~ /=(\d+)/g)[0]
if not the match returns true/false not the required integer.
Hope this helps.
Simon Castle.
Sorry, something went wrong.
Simon Castle x2087 <scastle@sced.esoc.esa.de> wrote
as fare as i can tell the following example from perlfunc sort :- @​new = sort \{ \($b =~ /=\(\\d\+\)/\)\[0\] \<=> \($a =~ /=\(\\d\+\)/\)\[0\] || uc\($a\) cmp uc\($b\) \} @​old; should have '/g' as below :- \($b =~ /=\(\\d\+\)/g\)\[0\] \<=> \($a =~ /=\(\\d\+\)/g\)\[0\] if not the match returns true/false not the required integer.
as fare as i can tell the following example from perlfunc sort :-
@​new = sort \{ \($b =~ /=\(\\d\+\)/\)\[0\] \<=> \($a =~ /=\(\\d\+\)/\)\[0\] || uc\($a\) cmp uc\($b\) \} @​old;
\($b =~ /=\(\\d\+\)/g\)\[0\] \<=> \($a =~ /=\(\\d\+\)/g\)\[0\]
No it doesn't. Did you actually try the example?
Read up in perlop about the different results which are returned by m// in scalar and in list context.
Mike Guy
No branches or pull requests
Migrated from rt.perl.org#1309 (status was 'resolved')
Searchable as RT1309$
The text was updated successfully, but these errors were encountered: