Re: Need help with a question.



On Jun 28, 1:01 pm, "Erwin van Koppen" <inva...@xxxxxxxxxxxxxxx>
wrote:
"Trev" wrote:

Thanks, I've made the changes and so far so good.

foreach $cpqlog (@cpqlog_data) {
    {
    chomp($cpqlog);

    if ($cpqlog =~ /MAC/) {
        $cpqlog =~ s/  <FIELD NAME="Subject" VALUE="//i;
        $cpqlog =~ s/  <FIELD NAME="MAC" VALUE="//i;
        $cpqlog =~ s/"\/>//i;
    }
    }

}

You do understand that the above code does not actually change anything in
the file, right? The substitutions in $cpqlog are just discarded at the end
of the loop.

Oh, and you might want to get rid of the superfluous { }'s...

Yeah, I figured that out, I added a print BOO so the results are
writen to a file which I load in the next sub. This might not be the
best code but I'm still learning.
.



Relevant Pages