Changeset 23377 for trunk/Nebulous/scripts/ptest.pl
- Timestamp:
- Mar 17, 2009, 4:53:25 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous/scripts/ptest.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous/scripts/ptest.pl
r23375 r23377 53 53 54 54 while ($kids) { 55 foreach my $child ($s->can_read(0)) {56 my $string = do { local $/; <$child>};57 my @events = split(/\n/, $string) if $string;58 print join("\n", @events), "\n" if scalar @events;59 }55 # foreach my $child ($s->can_read(0)) { 56 # my $string = do { local $/; <$child>}; 57 # my @events = split(/\n/, $string) if $string; 58 # print join("\n", @events), "\n" if scalar @events; 59 # } 60 60 } 61 61 … … 64 64 my ($sock, $id) = @_; 65 65 66 #unless ($print_stdout) {67 #my $filename = hostname() . "." . $$ . ".txt";68 #open my $fh, ">$filename" or die "can't open $filename: $!";69 # 70 #open STDOUT, ">&", $fh or die "can't reopen STDOUT: $!";71 #autoflush STDOUT 1;72 #}66 unless ($print_stdout) { 67 my $filename = hostname() . "." . $$ . ".txt"; 68 open my $fh, ">$filename" or die "can't open $filename: $!"; 69 70 open STDOUT, ">&", $fh or die "can't reopen STDOUT: $!"; 71 autoflush STDOUT 1; 72 } 73 73 74 74 # select $sock; … … 81 81 # proxy => 'http://localhost:80/nebulous' 82 82 proxy => 'http://alala:80/nebulous', 83 sock => $sock,83 # sock => \*STDOUT, 84 84 ); 85 85 … … 123 123 use base qw( Nebulous::Client ); 124 124 125 sub new126 {127 my $class = shift;128 my %p = @_;129 130 my $sock = delete $p{sock};131 my $self = $class->SUPER::new(%p);132 $self->{sock} = $sock;133 134 return $self;135 }125 #sub new 126 #{ 127 # my $class = shift; 128 # my %p = @_; 129 # 130 # my $sock = delete $p{sock}; 131 # my $self = $class->SUPER::new(%p); 132 # $self->{sock} = $sock; 133 # 134 # return $self; 135 #} 136 136 137 137 BEGIN {
Note:
See TracChangeset
for help on using the changeset viewer.
