Re: help regex and substitutions
- From: john swilting <john.swilting@xxxxxxxxxx>
- Date: Fri, 31 Aug 2007 19:15:42 +0200
john swilting wrote:
Jim Gibson wrote:
In article <46d83c60$0$27378$ba4acef3@xxxxxxxxxxxxxx>, john swilting
<john.swilting@xxxxxxxxxx> wrote:
I recopied the chaphitre 5
In what book?
the book is programmation en perl 3eme edition#!/usr/bin/perl -w
with the push (@regexes,$motif)
the substitution is well
how to make to improve my code... I look at closely the precis examples
handbook O reilly
use strict;
use diagnostics;
use warnings;
my @conf = ('XferMethod',
'rsync',
'XferLogLevel',
'1',
'RSyncShare',
'___1___',
'ClientNameAlias',
'___2___');
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/);
## }
push (@regexes,$motif);
foreach my $elem ( @substitution ) {
foreach my $re ( @regexes ) {
if ( $elem =~ /$re/) {
print "$elem egal $re\nentrer la valeur\n";
chop ($elem =<STDIN>);
print "nouvelle valeur de",$elem,"\n";
}
}
}
how to do improves my code
.
- Follow-Ups:
- Re: help regex and substitutions
- From: Klaus
- Re: help regex and substitutions
- References:
- help regex and substitutions
- From: john swilting
- Re: help regex and substitutions
- From: Jim Gibson
- Re: help regex and substitutions
- From: john swilting
- help regex and substitutions
- Prev by Date: Re: help regex and substitutions
- Next by Date: Re: DBD::SQLite FreeBSD install
- Previous by thread: Re: help regex and substitutions
- Next by thread: Re: help regex and substitutions
- Index(es):