in reply to Perl Substr
use strict; use warnings; my $string1 = "ABCDEFderp12345"; my $string2 = "derp"; if ($string1 =~ m/$string2(.*)$/ ){ print $1, "\n"; }else{ print "$string2 does not occur within $string1"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl Substr
by AnomalousMonk (Archbishop) on Jun 17, 2013 at 12:56 UTC |