Hii,wie kann ich die Ausgabe von "print Dumper $data;" Zeilenweise in eine Testdatei speichern ?
foreach my $file (@files) {
print "\nprocessing $file\n";
$data = process_file($file);
print Dumper $data;
my $string = Dumper $data;
}
sub process_file {
my $file = shift;
open my $fh, "<", $file || die "unable to open $file: $!";
my @data;
while (<$fh>) {
my @row = $_ =~ /^\[\s*\d+\]\s+\d+\.\d-(\d+\.\d) sec (\d+\.\d{2}) MBytes (\d+\.\d{2}) Mbits\/sec (\d+\.\d{3}) ms\s+([^\/])\//;
push @data, \@row;
}
close $fh;
return \@data;
}
Ich möchte die Ausgabe in folgender Form erhalten:
50 8.94 1.50 6.318 0.031
100 8.91 1.50 8.283 0
50 8.94 1.50 6.318 0.031
100 8.91 1.50 8.283 0
und nicht in:
$VAR1 = [ [
'10.0',
'1.79',
'3.00',
'1.744',
'0'
],
[
'15.0',
'1.78',
'2.98',
'1.936',
'0'
],
[
'20.0',
'1.78',
'2.99',
'1.975',
'0'
],
Kann mir jemand helfen bitte ?
Grüß,
K
Datum: 09.12.2008-16:14
