R
ReMo...
#!/usr/bin/perl
use strict;
use warnings;
my @arr = ('third1000', 'third1000', 'third?1000', '1000third?', 'third{}1000');
for my $item (@arr) {
my $targ = $item;
print "$targ and $item ";
print "do not " if ($item !~ /$targ/);
print "match\n"
}
The output is:
third1000 and third1000 match
third1000 and third1000 match
third?1000 and third?1000 do not match << I don't understand this
1000third? and 1000third? match
third{}1000 and third{}1000 match
In the above, the nondigits represent arbitrary text that digits are
added to for a multi-array sort in a module I'm making, because there
may be otherwise-identical text items.
/\Q...\E/ seems to make it go away, but then two characters ('$' and '@')
would apparently need to be accounted for.
So my question is, what other characters will fail to match in a string
ending with digits? I assume there are more clues in perlre and perlops,
but I can't find them. I've got to be missing something really elementary
here.
use strict;
use warnings;
my @arr = ('third1000', 'third1000', 'third?1000', '1000third?', 'third{}1000');
for my $item (@arr) {
my $targ = $item;
print "$targ and $item ";
print "do not " if ($item !~ /$targ/);
print "match\n"
}
The output is:
third1000 and third1000 match
third1000 and third1000 match
third?1000 and third?1000 do not match << I don't understand this
1000third? and 1000third? match
third{}1000 and third{}1000 match
In the above, the nondigits represent arbitrary text that digits are
added to for a multi-array sort in a module I'm making, because there
may be otherwise-identical text items.
/\Q...\E/ seems to make it go away, but then two characters ('$' and '@')
would apparently need to be accounted for.
So my question is, what other characters will fail to match in a string
ending with digits? I assume there are more clues in perlre and perlops,
but I can't find them. I've got to be missing something really elementary
here.