1 |
joko |
1.1 |
#!/usr/bin/perl |
2 |
|
|
|
3 |
|
|
use strict; |
4 |
|
|
use warnings; |
5 |
|
|
|
6 |
|
|
#use Shell; |
7 |
|
|
use Shell qw(echo cat ps cp); |
8 |
|
|
|
9 |
|
|
#my $foo = echo("howdy", "<funny>", "world"); |
10 |
|
|
#print $foo; |
11 |
|
|
|
12 |
|
|
# normal style |
13 |
|
|
print "--- TEST 1", "\n"; |
14 |
|
|
print echo("abc\n"); |
15 |
|
|
|
16 |
|
|
# normal style - read from STDOUT |
17 |
|
|
print "--- TEST 2", "\n"; |
18 |
|
|
my $passwd = cat('<c:\tmp\testldif'); |
19 |
|
|
print $passwd; |
20 |
|
|
|
21 |
|
|
# OO style |
22 |
|
|
print "--- TEST 3", "\n"; |
23 |
|
|
my $shell = new Shell(); |
24 |
|
|
print $shell->ls(); |
25 |
|
|
|
26 |
|
|
# error |
27 |
|
|
print "--- TEST 4", "\n"; |
28 |
|
|
abc(); |
29 |
|
|
|
30 |
|
|
# signature |
31 |
|
|
print "--- TEST 5", "\n"; |
32 |
|
|
sub ps; |
33 |
|
|
print ps -ww; |
34 |
|
|
|
35 |
|
|
#cp("/etc/passwd", "/tmp/passwd"); |