in reply to Using a variable to define a variable

What's the rest of the code look like? Also you have some syntax errors

Should look like this

$ecounter=0; my @file_line_contents = split (/\|/,$_); while ($ecounter < 45) { $ecounter=length($file_line_contents[$ecounter]); $ecounter+=1; }

I suppose the code will work but what are you trying to accomplish with it?