-
Notifications
You must be signed in to change notification settings - Fork 577
Smart match doesn't work with list and given-when #10386
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
Comments
From [email protected]Hello. I tried to run the follow script, but I get wrong result. I checked it, I think is correct. Smarts matches in lines 12 and 16 doesn't work as expected. This piece of Hugs! Thanks by attention. Case of test used: 1 #!/usr/bin/perl Use of uninitialized value $category in concatenation (.) or string at Flags: Site configuration information for perl 5.12.0: Configured by eof at Tue May 11 08:12:38 BRT 2010. Summary of my perl5 (revision 5 version 12 subversion 0) configuration: Platform: Flags: Site configuration information for perl 5.12.0: Configured by eof at Tue May 11 08:12:38 BRT 2010. Summary of my perl5 (revision 5 version 12 subversion 0) configuration: Platform: Locally applied patches: @INC for perl 5.12.0: Environment for perl 5.12.0: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games Locally applied patches: @INC for perl 5.12.0: Environment for perl 5.12.0: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games -- Linux registered user #488195 |
From @rgarcia2010/5/18 Hudson Flávio Vieira Mateus <perlbug-followup@perl.org>:
You want if() there, not when(), because $number is not used in your condition.
-- |
The RT System itself - Status changed from 'new' to 'open' |
@rgs - Status changed from 'open' to 'rejected' |
From [email protected]I've tested others cases and $number is used. Anyway, try this: use 5.010; $number = 2; given ($number) { Well, I've seen in a book ("Learning Perl - Fifth Edition") that smart match So, this another example too: use 5.010; @array = (1,2,3); if (@array ~~ 2) { This e-mail was tested in 5.10. First e-mail was tested in 5.12 too and Hugs! -- Linux registered user #488195 |
From @rgarciaOn 18 May 2010 15:18, Hudson Flavio V Mateus <hudson@comp.ufla.br> wrote:
No, it's not. It was in 5.10.0, but that caused problems, so in some |
From [email protected]Really, sometimes works, sometimes no... =/ Thanks by attention! On Tue, May 18, 2010 at 12:14 PM, Rafael Garcia-Suarez <rgs@consttype.org>wrote:
-- Linux registered user #488195 |
From @ikegamiOn Tue, May 18, 2010 at 11:43 AM, Hudson Flavio V Mateus <
It always works if the arguments are ordered as per the 5.10.1 and newer There was a whole class of problems that could only be solved by removing |
From [email protected]"It always works if the arguments are ordered as per the 5.10.1 and newer Oh, yes. I agree with you in *this case*. But, in case of Perl smart match But take this out. Thanks by attention! On Wed, May 19, 2010 at 11:43 AM, Eric Brine <ikegami@adaelis.com> wrote:
-- Linux registered user #488195 |
Migrated from rt.perl.org#75152 (status was 'rejected')
Searchable as RT75152$
The text was updated successfully, but these errors were encountered: