while(my $line = ) { $line =~ s/&+/&/; # Assuming you have a good reason for this # See $line has now been declared, where before it wasn't my ($isbn, $ocln, $title, $author, $call_number) = split(/\t/, $line);# See the variables have been declared # .. do something here }