Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Buggy smartmatch on tied array?

by kcott (Abbot)
on Oct 05, 2013 at 18:00 UTC ( #1057055=note: print w/ replies, xml ) Need Help??


in reply to Buggy smartmatch on tied array?

G'day CardinalNumber,

On 5.18.1 (current version):

$ cat junk #!/usr/bin/env perl use strict; use warnings; no if $] >= 5.018, warnings => 'experimental::smartmatch'; use Tie::Array; tie my @array_t, 'Tie::StdArray'; my @array = @array_t = qw[aaa bbb ccc ddd eee]; print "plain smatch: " . (/a/ ~~ @array) . "\n"; print "plain grep: " . (grep {/a/} @array) . "\n"; print "tied smatch: " . (/a/ ~~ @array_t) . "\n"; print "tied grep: " . (grep {/a/} @array_t) . "\n";
$ junk plain smatch: 1 plain grep: 1 Use of uninitialized value in pattern match (m//) at ./junk line 12. Use of uninitialized value in pattern match (m//) at ./junk line 12. Use of uninitialized value in pattern match (m//) at ./junk line 12. Use of uninitialized value in pattern match (m//) at ./junk line 12. Use of uninitialized value in pattern match (m//) at ./junk line 12. tied smatch: tied grep: 1

-- Ken


Comment on Re: Buggy smartmatch on tied array?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (17)
As of 2014-12-19 15:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (85 votes), past polls