skip to main
|
skip to sidebar
Perl - Tidings
Wednesday, August 11, 2010
Copying and Substituting Simultaneously
When the purpose is to search and replace a copy of the string and the intention is to accomplish this in one step then instead of doing this:
$dst = $src;
$dst =~ s/this/that/;
a single step like this will be more concise:
($dst = $src) =~ s/this/that/;
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
My Archive
►
2012
(2)
►
May
(2)
►
2011
(13)
►
September
(13)
▼
2010
(8)
►
September
(1)
▼
August
(5)
Env
FindBin
Using hash for counting
Copying and Substituting Simultaneously
WebAPP
►
March
(1)
►
February
(1)
►
2009
(24)
►
July
(4)
►
March
(11)
►
February
(9)
►
2008
(2)
►
November
(1)
►
May
(1)
►
2007
(1)
►
June
(1)
No comments:
Post a Comment