----- Original Message -----
From: "Jay Waheed" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 03, 2003 10:14 AM
Subject: Using Wildcards when matching a string(sentence)
> I am running a while loop, where I am comparing a
> string, but I want to use a wild card towards the end.
> Can anyone give me an idea of doing this. Here is what
> I have. My threshold value could vary and only thing I
> need to check from that line is "#Threshold", but my
> variable $lineFromFile contains similar string with a
> different value.
>
> while ($lineFromFile[$i] ne "#Threshold = 0,\n"){
> $i++;
> }
>
> Thanks
> -Jay
>
Jay -
You need a regular expression. Also, where is $i initialized?
Try something lik this:
for (@LineFromFile) {
last if /^#Threshold/;
}
Aloha => Beau;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]