perl_fan has asked for the wisdom of the Perl Monks concerning the following question:
am writing a simple substitutes program where both parameter of substitute are stored in variables
When i execute that, it gives me the following output#!/usr/local/bin/perl $string = '10 09'; $regex = '(\d+) (\d+)'; $replace = '$2 $1'; $string =~ s/$regex/$replace/; print "$string \n"; -----------------------
# ./test.cgi $2 $1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: regular expression problem
by jethro (Monsignor) on Aug 17, 2009 at 11:14 UTC | |
by johngg (Canon) on Aug 17, 2009 at 12:44 UTC | |
by perl_fan (Novice) on Aug 17, 2009 at 12:13 UTC | |
|
Re: regular expression problem
by biohisham (Priest) on Aug 17, 2009 at 12:18 UTC | |
|
Re: regular expression problem
by Anonymous Monk on Aug 17, 2009 at 13:00 UTC |