Thread erklärungsbedarf (7 answers)
Opened by Gast at 2006-05-02 15:15

Ronnie
 2006-05-03 21:58
#7477 #7477
User since
2003-08-14
2022 Artikel
BenutzerIn
[default_avatar]
Wenn man einen Hash nimmt kann man das ganze noch schön eindampfen:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/perl

use strict;
use warnings;

use Data::Dumper;

#open ( F, '<', $file ) || die "Could not open $file. $!";
my %lut;
/^(LINK|TEXT):(.*)$/ and push @{$lut{$1}}, $2 while (<DATA>);
die Dumper \%lut;
#close F;

_ _DATA_ _
#wgongwog
LINK:http://www.perl-community.de
#1324wgongwog
#
LINK:http://www.example.com
TEXT:there is more than one way to do it
LUI:bla
#

View full thread erklärungsbedarf