while (length $source) { # make only one split (creating 2 parts) (my($rec),$source) = split /;/, $source, 2; # ... }