- or download this
if ( $contents =~ /line3/g ) {
if ( $contents =~ /(line2-)(\w*)/g ) {
print $2;
}
}
- or download this
if ( $contents =~ /^line3/mo ) {
if ( $contents =~ /^line2-(\w*)/mo ) {
print $1; # has to be changed as well
}
}
- or download this
my $string = "abcde abcde adcde";
while ($string =~ /cd/og) {
...
print "a$1 matched at ",pos $string, "\n";
}
}