in reply to display problem
#!/usr/bin/perl use strict; while (<DATA>) { #lecture du fichier chomp; if (/^HI( |\t)*COC/) { my $song; my $hour_dla; while (<DATA>) { chomp; if ( /(^-)(song.*)/) { $song = $2; } if ( /^-chicken.*(\d\d)(\d\d)(\d\d)/) { $hour_dla = join(":",$2,$3); print "$song;$hour_dla\n"; } last if (/^HI.*/) } } } __DATA__ HI COCORICO -song HELLO -chicken 250420 -forest -data data -data 1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: display problem
by steph_bow (Pilgrim) on Mar 04, 2008 at 10:09 UTC | |
by moritz (Cardinal) on Mar 04, 2008 at 10:18 UTC |