line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Sed; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ------------------------------------------------------------------- |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# $Id: Sed.pm,v 1.11 2002/01/23 13:16:17 dlc Exp $ |
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
# ------------------------------------------------------------------- |
8
|
|
|
|
|
|
|
# Sed - A sed(1)-like stream editor |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
# Copyright (C) 2001 darren chamberlain |
11
|
|
|
|
|
|
|
# |
12
|
|
|
|
|
|
|
# This is free software; you can redistribute it and/or modify it |
13
|
|
|
|
|
|
|
# under the same terms as Perl itself. |
14
|
|
|
|
|
|
|
# |
15
|
|
|
|
|
|
|
# This software is distributed in the hope that it will be useful, |
16
|
|
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
17
|
|
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18
|
|
|
|
|
|
|
# GNU General Public License for more details. |
19
|
|
|
|
|
|
|
# |
20
|
|
|
|
|
|
|
# You should have received a copy of the GNU General Public License |
21
|
|
|
|
|
|
|
# along with this software. If not, write to the Free Software |
22
|
|
|
|
|
|
|
# Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
23
|
|
|
|
|
|
|
# ------------------------------------------------------------------- |
24
|
|
|
|
|
|
|
|
25
|
3
|
|
|
3
|
|
94116
|
use strict; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
137
|
|
26
|
3
|
|
|
3
|
|
16
|
use vars qw($VERSION @EXPORT); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
451
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
require Exporter; |
29
|
3
|
|
|
3
|
|
18
|
use base qw(Exporter); |
|
3
|
|
|
|
|
12
|
|
|
3
|
|
|
|
|
1112
|
|
30
|
|
|
|
|
|
|
@EXPORT = qw(sed); |
31
|
|
|
|
|
|
|
$VERSION = sprintf "%d.%02d", q$Revision: 1.11 $ =~ /(\d+)\.(\d+)/; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub sed (&$) { |
34
|
3
|
|
|
3
|
0
|
40
|
my $sub = shift; |
35
|
3
|
|
|
|
|
8
|
local $_ = shift; |
36
|
3
|
|
|
|
|
11
|
&$sub; |
37
|
3
|
|
|
|
|
17
|
return $_; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
__END__ |