in reply to data inside file

try
@line = split /\s+/, $_;
as your split.
\s is matches whitespace.
The plus sign says one or more of the prior character.
Note: you really dont need th $_ in the split statement.
By default split uses $_
so your split line could look like...
@line = split /\s+/;