use strict;
use warnings;
my $text = "encrypted key\n";
if ($text =~ /key/){
print qq/$text new print !\n/;
}
if(lc ($text) =~ /key/){
print "$text";
}
$text = "/home /andre /work /tmp /bin";
if($text =~ m[/bin]){
print "Directory /tmp found!\n";
}
$text = "andre luiz\n";
$text =~ s(andre)<AnDrE>;
$text =~ s[l]/L/;
$text =~ s{uiz}{UIZ};
print $text;
$text = "Andre Luiz Silva";
$text =~ /Luiz/;
print "$text\n ";
print "left : <$`> \n";
print "center : <$&> \n";
print "right : <$'> \n";
$text =~ "andre luiz silva\n";
if ($text =~ /Andre/){ print "$text\n";}
if ($text =~ m/Andre/){ print "m/$text\n";}
$text = "aaabbb";
$text =~ s/a/A/g;
print "$text\n";
$text = "aaabbb";
$text =~ s/a/A/;
print "$text\n";
$text = "aaabbb";
$text =~ tr/a/A/;
print "$text\n";
Result
$ perl blog.pl
encrypted key
new print !
encrypted key
Directory /tmp found!
AnDrE LUIZ
Andre Luiz Silva
left : <Andre >
center : <Luiz>
right : < Silva>
Andre Luiz Silva
m/Andre Luiz Silva
AAAbbb
Aaabbb
AAAbbb
0 comentários:
Post a Comment