in reply to How to use IF

What part of it doesn't work? Are you getting error messages with the statement code, or are you just not matching? I don't see anything particuarly wrong with your statement, I expect that your regex isn't correct. Perhaps you've used spaces, rather than a tab, as your delimiter in /\b$    0.00 \b/ (or vice versa)? Take another look at your data to make sure you've got what you think you've got. One more thing... when you're trying to match a simple regex, it's a good idea to do some one-liner debugging, rather than continue to hack at hundreds (thousands) of lines of code. For example...
perl -e 'open(DATA, "datafile.txt"); while (<DATA>) { print "$_\n" if +/\b$ 0.00 \b/; }'
-fp

Replies are listed 'Best First'.
Re: Re: How to use IF
by jdawes (Novice) on Aug 05, 2002 at 10:36 UTC
    I'm pretty confused, partly because I
    had a friend help me write most of this and now im just trying to
    add some bits to it. the following part of the
    script doesnt seem to do what i want it to

    if($es =~ /----------/) {print " <form action=/cgi-bin/FormMail.pl method=post name=accept_estimate_cos +t target=_self id=accept_estimate_cost> <input type=hidden name=job_number value=$jn /> <input type=hidden name=phone_number value=$ph /> <input type=hidden name=agency value=$ag /> <input type=hidden name=product value=$pr /> <input type=submit value='Accept Estimate' name=I_accept_the_Estimat +e> </form> <form action=/cgi-bin/FormMail.pl method=post name=accept_estimate_c +ost target=_self id=accept_estimate_cost> <input type=hidden name=job_number value=$jn /> <input type=hidden name=phone_number value=$ph /> <input type=hidden name=agency value=$ag /> <input type=hidden name=product value=$pr /> <input type=submit value='Decline Estimate' name=I_decline_the_Estim +ate> </form> </td></tr>

    regardless of whether "----------" shows up in the file
    that is read to memory it never shows the form buttons,
    i dont know why.

    I actually want the form to show up if $es is not equal
    to "----------" but im not sure how to do an
    IF NOT type of operation either.
    Sorry, Im really new to all this.

    In summary: two probs - my logical operation is the opposite of what i need,
    and it doesnt actually occur anyway.