This is probably what you want, taking into account the comments by the other monks:
use strict; use warnings; use 5.012; my @list = ("C:\\username\\Sources"); for (@list) { say "array char = $_"; while ($_ =~ m/\\/g) { say "found a '$&'"; # holds the portion of the string that mat +ched } }
In reply to Re: search for '\' in perl
by ricDeez
in thread search for '\' in perl
by kumeperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |