in reply to find all numeric values from a string and join them
use strict; use warnings; use Test::More tests => 1; my $str = 'EEH_ErrorCode=( 15, /* Component */ 65 /* Error */)'; my $want = '15|65'; my $have = join ('|', $str =~ /(\d+)/ag); is $have, $want;
Meta-update: I've relocated your post into the correct section of this site: Seekers of Perl Wisdom. See Where should I post X? for a discussion of where to post.
|
|---|