in reply to Re^2: Split Help
in thread Split Help

Hmm.. here you are saying

print "$#lines\n";

but in the OP

@line=split(/$variable/,$_);

Maybe you mean @lines? or perhaps $#line?

If you include

use warnings;

at the top of your program, perl helps you emitting a warning if, by typo, you are using a variable only once.