Re: passing variable to regular expression (PERL)



hi
i understand what u say, but my issue is how to pass a variable in a
Regular Expression

i have
aaaa
qqqq
into "SOMETHING"
now i shall loop the complete data which is in $Result SOMETHING
I shall appreciate if u could help me.
kris


and need to extract only values in between { .. } depending on the
value of

On Sep 8, 5:05 am, Bill Marcum <marcumb...@xxxxxxxxxxxxx> wrote:
On Fri, 07 Sep 2007 18:28:45 -0000, krisworld



<krishnamurthy.i...@xxxxxxxxx> wrote:

hi all

say I have a target file as
-----
-----
aaaa = { bbbbbbbbbbbbbbbbbbbb}
qqqq ={ dddddddddddd,
cccccccccccccc}
-------
--------
and i need output as
{ bbbbbbbbbbbbbbbbbbbb}
or
{ dddddddddddd,
cccccccccccccc} depending on aaaa or qqqq

so if i use

echo $Result |perl -lne "print if / aaaa ={ /../ }"
i get result

but i need to put it in loop

while read SOMETHING; do

echo $Result |perl -lne "print if / $SOMETHING={ /../ }"

done

I am not able to do it.
Can any one help me...
regards
kris

while read SOMETHING; do
echo "$SOMETHING" | perl...
done < file

Do you need the while read loop, or can you do the whole thing with
perl?

--
New York is real. The rest is done with mirrors.- Hide quoted text -

- Show quoted text -


.



Relevant Pages

  • Re: How to choose FPGA for a huge computation?
    ... Depending on the accuracy and bit size. ... in one clock cycle. ... the loop above is only one of a half dozen intermediate ... orders require different "relatively random" accesses to the memory ...
    (comp.arch.fpga)
  • Re: [PHP] Static Pages with PHP
    ... depending on some ... parameters I will display a static page from within my PHP code. ... you probably want to fopen/fread in a loop. ...
    (php.general)
  • Deleting lines with a variable.
    ... In my macro I want to delete some lines depending on a test. ... I loop through some lines and do a check whether to delete the line. ... Prev by Date: ...
    (microsoft.public.excel.programming)
  • Re: Need help with a function
    ... For robustness you might want to add some error checking on the range of x,y to ensure in bounds of lengthand x<=y, etc. ... Well, when you're going thru the loop in your original code, what happens at every step? ... You'll need something to decide whether the new value is a new max and then do something depending on that decision. ...
    (comp.soft-sys.matlab)
  • Re: WAIT... why?
    ... Depending on how getNextIndexIntoWavetableworks it looks like you could split the loop into two threads. ... Left & right channel threads and wait for both before returning, that mixed with any possible fpu improvements the others come up with could add up to quite a bit. ... Always assume I'm posting without coffee. ...
    (borland.public.delphi.language.basm)