in reply to formatting the output
I don't see that at all.
$host = '127.0.0.1'; my $output = `ping $host`; print "ping result $output\n";
outputs
ping result Pinging 127.0.0.1 with 32 bytes of data: Reply from 127.0.0.1: bytes=32 time<10ms TTL=128 Reply from 127.0.0.1: bytes=32 time<10ms TTL=128 Reply from 127.0.0.1: bytes=32 time<10ms TTL=128 Reply from 127.0.0.1: bytes=32 time<10ms TTL=128 Ping statistics for 127.0.0.1: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms
Is that what you get from that three line program?
I tried fooling with binmode, $/ and $\ to reproduce your undesirable results to no avail. Are you using cygwin or ActiveState?
Have you tried using a module like Net::Ping instead?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: formatting the output
by Anonymous Monk on Nov 17, 2005 at 21:35 UTC |