Thread Probleme mit Inkrementierung (18 answers)
Opened by nikster77 at 2006-05-21 03:58

pq
 2006-05-21 06:09
#66370 #66370
User since
2003-08-04
12208 Artikel
Admin1
[Homepage]
user image
[quote=nikster77,21.05.2006, 03:36]Hmm.. es ist mir ziemlich egal ob es $text1 oder $text[1] oder $text.1 ist...[/quote]
das klang aber zuerst noch anders.

Quote
push @temp, (split(/\:|\[|\]| /, $line);

funktioniert nicht

definiere "funktioniert nicht".

also ich hab noch nicht ganz verstanden, was du willst; was du beschreibst,
ist ziemlich schwammig formuliert.
wie wär's denn damit als anregung:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
my @lines;
open my $fh, "<", "/home/nikster/supertext" or die "Unable to read from supertext : $!";
while (<$fh>) {
 if (m/^hallo/i) {
   push @lines, [split m/[:\[\]]/, $_];
 }
}
close $fh;

print $lines[4]->[3];
print "@{ $lines[4] }\n";


perlref\n\n

<!--EDIT|pq|1148177412-->
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. -- Damian Conway in "Perl Best Practices"
lesen: Wiki:Wie frage ich & perlintro Wiki:brian's Leitfaden für jedes Perl-Problem

View full thread Probleme mit Inkrementierung