Perl Home
PERL Functions
© 2011 TutorialsPoint.COM
|
PERL s/// Function
Syntax
Definition and Usage
Not a function. This is the regular expression-substitution operator. Based on the regular expression specified in PATTERN, data is replaced by REPLACE. Like m//, the delimiters are defined by the first character following s.
Return Value
Example
#!/usr/bin/perl -w
$string = "This is Test";
# this will replcase Test with Best.
$string =~ s/Test/Best/;
print "$string\n";
|
It will produce following results:
|

|
|
|