Originally Posted by dolfantb
I'm using Perl Critic to help me learn best practices and I'm having an issue with 2 errors.
1. Useless interpolation of a literal string.
This comes from:
Code:
$a = sprintf "%02x", hex $a;
The interpolation is not useless to me as I need to convert a randomly selected hex number from 0 - F to 00 - 0F. Is there a better way to do this without getting this error?
2. Return value of flagged function ignored - print.
How do i make sure print returns something? Is this necessary? Should I live and die with critic or use my judgement? I got into error 1 by first removing parens from all built in functions. I had always used parens with sprintf in the past.
I figured the sprintf issue out, just need help with the 2nd problem.