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

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: subsitute s/ and match m/ failure
by svenXY (Deacon) on Jan 22, 2009 at 15:00 UTC
    Hi,
    since you split on ':' which is after .log,
    $ip =~ s/\.log$//;
    will do the trick.
    Regards,
    svenXY
Re: subsitute s/ and match m/ failure
by Bloodnok (Vicar) on Jan 22, 2009 at 15:29 UTC
    As clarification of what's been said elsewhere, you are testing the wrong element of the split ... to use your original code, change
    $model =~ s/\.log$//; die if $model =~ /log/;
    to read
    $ip =~ s/\.log$//; die if $ip =~ /log/;

    A user level that continues to overstate my experience :-))
Re: subsitute s/ and match m/ failure
by b10m (Vicar) on Jan 22, 2009 at 15:23 UTC

    You're trying to strip '.log' of $model, where clearly you want to strip it of $ip.

    --
    b10m
Re: subsitute s/ and match m/ failure
by matze77 (Friar) on Jan 22, 2009 at 16:35 UTC

    Hmm. What is obvious, i dont understand a word. Am I too silly? What is the failure? Or is there another context i might have missed?

    Thanks MH
      The OP replaced his original question with this meaningless reply to other replies. Hopefully the Janitors restore the original content.