Jemand zu Hause?
1 2 3 4 5 6
while(<FILE>) { my $line=$_; my $index= index($line, "\s"); my $word= substr $line, 0, $index; print $word; }
1 2 3 4 5
while ( <FILE> ) { my $line = $_; my ($word) = split /\s/, $line; print $word, "\n"; }
Wie frage ich & perlintro
brian's Leitfaden für jedes Perl-Problem