Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Buggy smartmatch on tied array?

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


in reply to Buggy smartmatch on tied array?

G'day SankoR,

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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-04-24 05:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found