Kasi ramanathen wrote:
> by using this code i get the right answer, but i want to store the
> pattern in the variable and use it, for pattern, it fails. what is
> the problem. is it related to priority of operator.
>
> open(IH, "<st.htm");
> @a=(<IH>);
> $v=join(' ',@a);

same as
    $v = "@a";

> while($v=~m/href=\"(.*?)\"><IMG.*?border=0>/gi)
> {
> print "\n<br>$1";
> print 1;
> }
>
> ***********************
>
> i want to change line number 4
>
> while($v=~m/href=\"(.*?)\"><IMG.*?border=0>/gi)
> with,
>
> $t="href=\"(.*?)\"><IMG.*?border=0>";
>
> with
>
> while($v=~m/$t/gi)

Hi again Kasi. Still not using /x ?  ;-)

Look:

    print my $t="href=\"(.*?)\"><IMG.*?border=0>";
outputs
    href="(.*?)"><IMG.*?border=0>

Not the same, is it? You should be able to see why. Since we're
trying hard to help you you should take notice of the advice
we give:

- use strict
- use warnings
- use /x to lay out complex regexes
- use qr/../ to define regex constants

If you're still stuck after you've tried these ideas then come back
to us and we'll sort things out.

Good luck!

Rob




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to