in reply to Making perl evaluate a variable with a string
Since '$line' is a variable, the compiler doesn't know what it contains : variable names, prayers, profanity, ... . You want your program to evaluate the contents of $line as Perl code. Look up the 'eval' function.
Hope this helps.