Thread Quoting-Problem (6 answers)
Opened by Kevin31 at 2009-06-19 13:51

topeg
 2009-06-19 18:35
#122597 #122597
User since
2006-07-10
2611 Artikel
BenutzerIn

user image
perl selber bietet alles was du brauchst:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/perl
use strict;
use warnings;

my $file='/etc/hosts';
my $tmpmainvillage='Entenhausen';

my @list;

open(my $fh, '<', $file) or die "Error open $file ($!)\n";
while(my $line=<$fh>)
{ push(@list,$line) if($line=~m/#village $tmpmainvillage/); }
close($fh);

print join("\n",@list)."\n";

In diesem Fall brauchst du keine externen Befehle.

View full thread Quoting-Problem