$input = $_; @format=split (/ /, $_); for ($i=0; $i<=$#format; $i++) { print " -> $format[$i]"."\n"; $prev=$format[$i]; for($n=0;$n<=$#code;$n++) { $find=$code[$n]; chomp($find); chomp($prev); $current=$prev; if ($prev=~/$find/i){ print "$blink $cyan -> Logged \n"; print "$normal$green"; #HERE IS THE SPLIT PROBLEM AREA! $tparse=split(/-/,$current); $writer=$tparse['2']; $writes=$#tparse; print "$cyan -> $prev \n $green"; print "$cyan -> $#writes \n $green"; print "$cyan -> $writer \n $green"; $n=($#code+1); } } }