Can I replace the binding operator with the smart match operator in Perl?

Posted by sid_com on Stack Overflow See other posts from Stack Overflow or by sid_com
Published on 2009-10-28T15:05:14Z Indexed on 2010/04/07 1:43 UTC
Read the original article Hit count: 313

Filed under:
|
|

How can I write this with the smart match operator (~~)?

use 5.010;

my $string = '12 23 34 45 5464 46';

while ( $string =~ /(\d\d)\s/g ) {
    say $1;
}

© Stack Overflow or respective owner

Related posts about perl

Related posts about operators