Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

subsitute s/ and match m/ failure

by kp2a (Sexton)
on Jan 22, 2009 at 14:53 UTC ( [id://738178]=perlquestion: print w/replies, xml ) Need Help??

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://738178]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-03-19 11:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found