in reply to print_notice or print $notice or print notice?
Approach 3, if indeed it is supposed to read...
sub print_notice { print 'please be sure that XXX is installed first' } print_notice;
...is a no-no in my book. It does two things, it defines a scalar, and prints it out. In my experience, sooner or later you will want to grab that string, to feed it to split or lc, and you will be out of luck, because the damned thing will get printed to STDOUT.
That leaves approaches 1 and 2. Approach 2 gets my nod, because if the worst comes to the worst, you can always set a breakpoint in the sub (or add some debug print) and find out from whence it is being called. And, as is alluded to elsewhere, it lends itself to i18n and l10n.
--
|
|---|