Thread print "$split[0Splitfunktion (15 answers)
Opened by Annka at 2006-07-18 13:34

styx-cc
 2006-07-18 14:48
#68199 #68199
User since
2006-05-20
533 Artikel
BenutzerIn

user image
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/perl -w
use strict;
for (<DATA>) {
my @line = split(/ /, $_);
print "$line[0]\n";
}

__DATA__
name alter wohnort usw.
max 18 FFM
till 18 Nürnberg
friedel 18 lichtenau
anja 19 salzburg


So klappts bei mir, Ausgabe:
Code: (dl )
1
2
3
4
5
6
stefan@workaholic:~$ perl programmierung/perl/community/split.txt
name
max
till
friedel
anja
Pörl.

View full thread print "$split[0Splitfunktion