all,

I have in a large niumber of files something like this in a
variety of forms:

CommonFooter.cgi?one /somepath/two blah
CommonFooter.cgi?dada /somepath/lala blah
CommonFooter.cgi?baba /somepath/gaga blah

I have written a perl script which has somewhere in the code

   $rc = ($content =~ s/$regfrom/$regto/);

$regfrom and $regto are passed to the script from the command line.
I want to do:

../bin//sitesed.pl -r 'CommonFooter.cgi\?([a-z]*) /somepath/([a-z]*) blah' 'SomeNew/$1 
someother/$2'
then it finds all occurences but does not replace it instead I get

.....
SomeNew/$1 someother/$2
.....


If I now hardcode the stuff into it, like:

   $rc = ($content =~ s/$regfrom/SomeNew$1 someother$2/);

it does exactly what I want, eg:

.....
SomeNew/one someother/two
.....

It could be two reasons:

 * commandline (eg shell)
 * perl itself

so I tried 

   $rc = ($content =~ s/$regfrom/\Q$regto/);

and

../bin//sitesed.pl -r 'CommonFooter.cgi\?([a-z]*) /somepath/([a-z]*) blah' 
'\QSomeNew/$1 someother/$2'

or

../bin//sitesed.pl -r 'CommonFooter.cgi\?([a-z]*) /somepath/([a-z]*) blah' 
'SomeNew/\$1 someother/\$2'

but nothing helps.

Any ideas??



jobst



-- 
Keyboard not found - please clean up desktop!

             __, Jobst Schmalenbach, [EMAIL PROTECTED], Technical Director
   _ _.--'-n_/   Barrett Consulting Group P/L & The Meditation Room P/L      
 -(_)------(_)=  +61 3 9532 7677, POBox 277, Caulfield South, 3162, Australia

-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to