Thanks again - that "/eg" opens up a whole world of possibilities!
John W. Krahn wrote:
q() is another way of saying ''. All the quote operators can be found
in the perlop.pod document under "Quote and Quote-like Operators"
section.
If you want your version to work correctly you are going to hav
Martin Costello wrote:
>
> John W. Krahn wrote:
> >
> >Here is one way to do it:
> >
> >$ perl -e'
> >$text = q/
> >
> >blahblah -blah blah
> >-blah blah -blah $blah -blah "Ground"
> >-c "blah transformC" transformC;
> >
> >blahblah
> >-af transformC"blah"($blah)
> >-af Atr
John,
Thank you ever so much - that seemed to work.
In my code I'm actually using variables for the names to replace:
so my substitute looks like this :
$line =~ s/("[^"]+"|\w+)/
$1 eq $oldList[$i] ? $newList[$i] :
$1 eq "$oldList[$i]" ? "$newList[$i]" : $1
/eg;
(I removed the q( ) parts from y
Martin Costello wrote:
>
> Hello,
Hello,
> I'm trying to do a search and replace on a file (specifically the word
> transformC). A cut down version of the file is below:
>
> blahblah -blah blah
> -blah blah -blah $blah -blah "Ground"
> -c "blah transformC" transformC;
>
> blahblah
>
Hello,
I'm trying to do a search and replace on a file (specifically the word
transformC). A cut down version of the file is below:
blahblah -blah blah
-blah blah -blah $blah -blah "Ground"
-c "blah transformC" transformC;
On Dec 16, Paul Kraus said:
>How can I grab a numeric string that contains commas.
... that ALSO contains periods in it.
>POINTPoint Health Centers 19,466.79
>0.00 401.20 0.00 19,867.99
>if (/(^POINT)\s+ Point Health Centers\s+([\d\,]*)
How can I grab a numeric string that contains commas.
String
--
POINTPoint Health Centers 19,466.79
0.00 401.20 0.00 19,867.99
My Expr
---
if (/(^POINT)\s+ Point Health Centers\s+([\d\,]*)\s+.*/){
print "$1 $2\n";
}
What it