> top of pg64 > ---- > $chunk_of_code = q { > if ($condition) { > print "Gotcha!"; > } > }; > > > is $chunk_of_code supposed to contain Perl code? If so why? When would > you use this? What does this assign to the variable? I am assuming a > true false value but I am not sure. >
if you print the variable as is it will print the entire string (as a string, not code) inside the q{} but if you want to flip into a chunk of code, just eval it: $condition = 1; $chunk_of_code = q { if ($condition) { print "Gotcha!"; } }; eval$chunk_of_code; output: Gotcha! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]