jrasillo has asked for the wisdom of the Perl Monks concerning the following question:

Formerly titled "I need help ASAP!"

I'm doing pattern matching through an array, and it seems to work fine the first time it finds the pattern, but if it keeps on trying to find it for second time it fails...
Here's the code
chomp $_myfile[$i];#name of my array if ($_myfile[$i] =~ /Content-Transfer-Encoding: (.*)/) {$encoding = $1;} if ($encoding eq "quoted-printable") {do whatever}

The first time my code runs it matches against Content-Transfer-Encoding just fine, and $encoding gets the stuff after the colon, but the second time it runs $encoding gets nothing...

can anyone help me?

The purpose is getting quoted printable out of that line...
jorge

Edit 2002-03-31 by the node bunny : Fixed formatting and moved to correct section

Edited Sun Mar 31 22:43:52 2002 (UTC), by footpad : Changed title to be more descriptive.

Replies are listed 'Best First'.
Re: Help with multiple matches
by rdfield (Priest) on Mar 31, 2002 at 09:53 UTC
    Looks like you need grep...

    rdfield

Re: Help with multiple matches
by jepri (Parson) on Mar 31, 2002 at 13:55 UTC
    Don't parse HTTP by hand, use something like HTTP::Daemon

    ____________________
    Jeremy
    I didn't believe in evil until I dated it.

Re: Help with multiple matches
by Maclir (Curate) on Mar 31, 2002 at 22:23 UTC
    The first thing you need help with is in writing a short, meaningful title to your submission. That way, when scannng through the list of new entries, other monks can quickly see if they can assist you.