I am trying to work on a script, and can seem to figure out how to do something that should be really simple.
I have a variable that contains text. I need to check to see if that text contains a specific bit of text, and if it does, do something else. For example:
$a="this is the image that goes with the information";
if ($a =~ "[IMG]") {
go do something else here
}
else{ ..continue on
The problem that I am getting is that it doesn't seem to work, and I feel like an idiot. I know that I probably am, since I am not a really experienced programmer, but can someone please help me?!?!?
There is no actual image, it has been stripped away from the variable, and it leaves the [IMG] tag there. That is what I am testing for. If it has the tag, then my program received the wrong data, and needs to keep looking.
Thank you in advance for your help!
I have a variable that contains text. I need to check to see if that text contains a specific bit of text, and if it does, do something else. For example:
$a="this is the image that goes with the information";
if ($a =~ "[IMG]") {
go do something else here
}
else{ ..continue on
The problem that I am getting is that it doesn't seem to work, and I feel like an idiot. I know that I probably am, since I am not a really experienced programmer, but can someone please help me?!?!?
There is no actual image, it has been stripped away from the variable, and it leaves the [IMG] tag there. That is what I am testing for. If it has the tag, then my program received the wrong data, and needs to keep looking.
Thank you in advance for your help!