Where did you find inet_aton documented? Consider taking a look at Socket and use.
The code you showed is not the code you run. Please post the complete code that corresponds to your error message. The snippet you show does not tell us anything about your code.
strict.pm is there to force you to predeclare all variables you use. This helps preventing
typos in variable names. If you have use strict; in your program, you will need to predeclare all variable names you use. You don't do that, at least if we are to believe the error message you get. Maybe you want to predeclare the variables?