[ create a new paste ] login | about

Link: http://codepad.org/JLnyaZg5    [ raw code | output | fork ]

skeletonkey - Perl, pasted on Feb 18:
1
2
3
4
my @x = qw(foo bar one two three bar foofoo foobar thisfoowillbebar);
map { s/foo/bar/g } @x; # replace any foo with bar
# map { s/^foo$/bar/g } @x; # for exact matching
print join("\n", @x) . "\n";


Output:
1
2
3
4
5
6
7
8
9
bar
bar
one
two
three
bar
barbar
barbar
thisbarwillbebar


Create a new paste based on this one


Comments: