Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Insert lines into specific stanza line

by xjlittle (Beadle)
on Aug 13, 2010 at 20:13 UTC ( [id://855001]=note: print w/replies, xml ) Need Help??


in reply to Re: Insert lines into specific stanza line
in thread Insert lines into specific stanza line

The second one is correct for what I am trying to accomplish. However I am getting the dreaded Use of uninitialized value in pattern match (m//)

here is my code

if ($change[$i] =~ /\b$ip\b/){ my $seen = 1; if ($seen && m{</stanza>}){ print $tl[0]; $seen = 0; }

What am I missing?

Replies are listed 'Best First'.
Re^3: Insert lines into specific stanza line
by oko1 (Deacon) on Aug 14, 2010 at 00:03 UTC

    Please show enough code to establish context. I suspect that you're failing to define $ip (that's the only variable I see being used in a regex, and so the only place where you could have an uninitialized value in one), but since you've only showed this tiny snippet, there's no way for me to tell what else is wrong. There may also be other things wrong with your script, and I don't want to shoot in the dark.


    --
    "Language shapes the way we think, and determines what we can think about."
    -- B. L. Whorf

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (8)
As of 2024-04-19 08:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found