Thread LogFile auslesen ! (9 answers)
Opened by Gast at 2007-05-08 15:46

bloonix
 2007-05-08 23:13
#76561 #76561
User since
2005-12-17
1615 Artikel
HausmeisterIn
[Homepage]
user image
[quote=PerlProfi,08.05.2007, 17:49]
Code: (dl )
split(/ /, $data);
[/quote]
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use strict;
use warnings;
use Data::Dumper;

my @array;

while (my $line = <DATA>) {
@array = split(/ /, $line);
print Data::Dumper->Dump([\@array], [' split / /']);
@array = split(/\s+/, $line);
print Data::Dumper->Dump([\@array], [' split /\s+/']);
}

__END__
08.06.2007 09.10.55,712    de.xxx.yyy.zzz


$ split / / = [
'08.06.2007',
'09.10.55,712',
'',
'',
'',
'de.xxx.yyy.zzz
'
];
$ split /\s+/ = [
'08.06.2007',
'09.10.55,712',
'de.xxx.yyy.zzz'
];


Ich würde da schon eher /\s+/ bevorzugen.\n\n

<!--EDIT|opi|1178652102-->
What is a good module? That's hard to say.
What is good code? That's also hard to say.
One man's Thing of Beauty is another's man's Evil Hack.

View full thread LogFile auslesen !