#HERE IS THE SPLIT PROBLEM AREA! $tparse=split(/-/,$current); $writer=$tparse['2']; #### ... In scalar context, returns the number of fields found and splits into the "@_" array. Use of split in scalar context is deprecated, however, because it clobbers your subroutine arguments.