#!/usr/bin/perl
use strict;
my (@gerbal) = (
'Newbie',
'Newbie Is',
'A Newbie',
'A Newbie Not',
'Newbie do be Newbie',
);
foreach my $foot (@gerbal) {
print "$foot -- ";
if ($foot =~ /^Newbie/) {
print " match found.\n";
} else {
print " no match.\n";
}
}
exit;
Results:
Newbie -- match found.
Newbie Is -- match found.
A Newbie -- no match.
A Newbie Not -- no match.
Newbie do be Newbie -- match found.
|