in reply to Some Basic Help.

just to add to others mastery advice:

"...i want to define it as the current line of ..."

do like so:

... while(defined(my $trained = <trained>)){ chomp $trained; while(defined(my $predict = <predict>)){ chomp $predict; ... } ... }

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me