Thread Datei einlesen von "START" bis "ENDE" (24 answers)
Opened by Kalmuecke at 2006-11-06 15:56

bloonix
 2006-11-07 18:14
#71492 #71492
User since
2005-12-17
1615 Artikel
HausmeisterIn
[Homepage]
user image
Ich glaube nicht, dass hier alles in @lines wandert, was reingehört:

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
my @lines;
open my $fh,'<',$file or die $!;
while(<$fh>){
  if(/START/ .. /ENDE/){
      foo();
      push(@lines,$_);
  }
}
close $fh;

print $_ for @lines;

sub foo {
  open my $fh, '<',$otherfile or die $!;
  while (<$fh>) {
     # operations
  }
  close $fh;
}


Oder aber Ihr prüft vorher jedes Modul, ob es $_ sauber lokalisiert.\n\n

<!--EDIT|opi|1162916141-->
What is a good module? That's hard to say.
What is good code? That's also hard to say.
One man's Thing of Beauty is another's man's Evil Hack.

View full thread Datei einlesen von "START" bis "ENDE"