line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/perl |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=begin metadata |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Name: echo |
6
|
|
|
|
|
|
|
Description: echo arguments |
7
|
|
|
|
|
|
|
Author: Randy Yarger, randy.yarger@nextel.com |
8
|
|
|
|
|
|
|
License: perl |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=end metadata |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=cut |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
package PerlPowerTools::echo; |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
2450
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
210
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my ($VERSION) = '1.2'; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
__PACKAGE__->run( @ARGV ) unless caller(); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub run { |
23
|
4
|
|
|
4
|
|
18123
|
my ( $self, @args ) = @_; |
24
|
|
|
|
|
|
|
|
25
|
4
|
100
|
|
|
|
11
|
unless (@args) { |
26
|
1
|
|
|
|
|
7
|
print "\n"; |
27
|
1
|
|
|
|
|
4
|
exit 0; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
3
|
100
|
|
|
|
8
|
if ($args[0] eq '-?') { |
31
|
1
|
|
|
|
|
3
|
print <
|
32
|
|
|
|
|
|
|
Usage: echo [-n] [arguments] |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Displays the command line arguments, seperated by spaces. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Options: |
37
|
|
|
|
|
|
|
-n: Do not print a newline after the arguments. |
38
|
|
|
|
|
|
|
-?: Display usage information. |
39
|
|
|
|
|
|
|
EOF |
40
|
1
|
|
|
|
|
3
|
exit 0; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
2
|
|
|
|
|
2
|
my $N = 1; |
44
|
2
|
100
|
|
|
|
5
|
if ($args[0] eq '-n') { |
45
|
1
|
|
|
|
|
2
|
$N = 0; |
46
|
1
|
|
|
|
|
1
|
shift @args; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
2
|
|
|
|
|
6
|
print join ' ', @args; |
50
|
2
|
100
|
|
|
|
4
|
print "\n" if $N == 1; |
51
|
|
|
|
|
|
|
|
52
|
2
|
|
|
|
|
5
|
exit 0; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |