in reply to Net::Netmask not working with scalar variable

You don't show the contents of your input file, but I am guessing something like:

IP Address 1.2.3.4 Gateway 1.2.3.1

When you read a line from your input file into $_, it includes the line termination character ("\n"). If there is no space character after the IP address in your configuration file, then you will end up with $ff set to something like "10.6.10.5\n" and $fk set to something like "10.6.10.5\n:255.255.255.0", when what you need is "10.6.10.5:255.255.255.0".

There are several ways to deal with this, but one good one for you to learn is to use the chomp function to remove the line termination from your input. You could change your input loop to be like the following:

while(<F>) { chomp; # Remove the "\n" from the end of the line # now use $_ }