blob: dd1b05383d268bee03ee9f9032f0d02f526f11f6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
#!/usr/bin/perl
#
# I thought that I would try out some perl 5 features for the first time.
# So I wrote a small program, included below. It died, and the partial
# output looks very much like what I wanted to accompish. Even if the program
# had not died, there is still the problem that no output was given under the
# label "sonia:".
#
# Since the output is close, perhaps a bug lurks within...(?) I'm using the
# compiled binary provided in the perl5a6 tar file. I tried to write this
# post so it could be given to perl with the -x flag. You should get the
# output I describe here --
# James Bence
# jbence@math.ucla.edu
#
# Output:
#
# Pushed ege into @sonia
# Pushed caflisch into @joshua
# Pushed catalina into @julia
# Pushed lunnon into @sonia
# Pushed m270alg into @redwood
# Pushed harten into @joshua
# Pushed ycc into @joshua
# Pushed m270wsc into @redwood
#
#
# joshua:
# caflisch harten ycc
#
# sonia:
#
#
# redwood:
# m270alg m270wsc
#
# julia:
# Segmentation fault
#
#
require 5.000;
while (<DATA>) {
($login,$host) = split;
push(@{$hostref{$host}},$login); # t/op/ref.t (22) suggests this is ok.
print "Pushed $login into \@$host\n";
}
print"\n\n";
while ( ($host,$ref) = each(%hostref)) {
print "$host:\n ";
$count = 0;
foreach $person (@{$ref}) {
print $person, " ";
$count++;
if ($count % 5 == 0) { print "\n "; }
}
print "\n\n";
}
__END__
ege sonia
caflisch joshua
catalina julia
lunnon sonia
m270alg redwood
harten joshua
ycc joshua
m270wsc redwood
|