J
john swilting
I recopied the chaphitre 5
#!/usr/bin/perl -w
use strict;
use diagnostics;
my @conf = ('XferMethod',
'rsync',
'XferLogLevel',
'1',
'RSyncShare',
'___1___',##they is these 2 pattern
'ClientNameAlias',
'___2___');##they is pattern
print @conf,"\n";
my @substitution = @conf;
my $motif =qr/___[1-9][0-9]?___/is;
my @regexes = ();
my @motif = ();
foreach $motif ( @motif ) {
push @regexes, qr/$motif/;
}
foreach my $elem ( @substitution ) {
foreach my $re ( @regexes ) {##the loop however turns well#scalar(@regexes
if ( $elem =~ /$re/) {##one do not arrive to this line
print "$elem egal $re\nentrer la valeur\n";
chop ($elem =<STDIN>);
print "nouvelle valeur de",$elem,"\n";
}
}
}
#!/usr/bin/perl -w
use strict;
use diagnostics;
my @conf = ('XferMethod',
'rsync',
'XferLogLevel',
'1',
'RSyncShare',
'___1___',##they is these 2 pattern
'ClientNameAlias',
'___2___');##they is pattern
print @conf,"\n";
my @substitution = @conf;
my $motif =qr/___[1-9][0-9]?___/is;
my @regexes = ();
my @motif = ();
foreach $motif ( @motif ) {
push @regexes, qr/$motif/;
}
foreach my $elem ( @substitution ) {
foreach my $re ( @regexes ) {##the loop however turns well#scalar(@regexes
if ( $elem =~ /$re/) {##one do not arrive to this line
print "$elem egal $re\nentrer la valeur\n";
chop ($elem =<STDIN>);
print "nouvelle valeur de",$elem,"\n";
}
}
}