Perl/Shell Knowledge Sharing
Perl Interview Questions and Answers
Monday, January 17, 2011
perl modifier(e)
#Method 1:
use strict;
my $string = "Nikil";
$string =~ s/^([A-Za-z]+)/length($1)/e;
print $string, "\n";
#Method 2:
use strict;
my $string = "Nikil";
$string =~ s/([Ss][A-Za-z]*)/'<'.uc($1).'>'/e;
print $string, "\n";
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment