Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Buggy smartmatch on tied array?

by kcott (Bishop)
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 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
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 chilling in the Monastery: (6)
As of 2021-01-28 00:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?