Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Perl: the Markov chain saw
 
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 drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2014-04-18 03:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (460 votes), past polls