in reply to Getting error while crafting frame through Net::Frame module

sagarkha:

I don't see any error checking in there, so a method is likely failing and you're calling a method on an object that was never properly created, was destroyed, was damaged, etc. Based on the text of the error message, I'd add this line after $ip4 is created:

die "Can't connect to target!" unless defined $ip4";

...roboticus

Replies are listed 'Best First'.
Re^2: Getting error while crafting frame through Net::Frame module
by sagarkha (Acolyte) on Aug 27, 2010 at 06:58 UTC
    I added this to my code, but the same result, so i think this object was created without any problem otherwise it would have died. But i am not sure why i am still getting that error.

      sagarkha:

      I guess I should have been more explicit: You need to add error checking to your code. You keep calling methods on objects that may not have been successfully created. I gave you an example of one thing that may have been wrong, based on an error message. You need to look at other statements that could fail, and check their results.

      ...roboticus