http://www.perlmonks.org?node_id=1074660


in reply to Re^2: regex - problem with the loop I believe or maybe the regex itself ?
in thread regex - problem with the loop I believe or maybe the regex itself ?

So firstly, one question, if I put the string into an array separated by a delimiter space, will reversing it reverse the characters itself as well? i thought this is only happening if it is a string, but not with a list?

See reverse. In scalar context, reverse will reverse a string, in list context, reverse reverses a list. If you want both, use

@yra = reverse map { scalar reverse $_ } @ary;

update: if you want to match parens, don't escape the backslash.

- if ($str =~ /\bdIonly:\b(.*?)\bworkset\b\\(\\(/g); + if ($str =~ /\bdIonly:\b(.*?)\bworkset\b\(\(/g);
perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'