CodeJunkie has asked for the wisdom of the Perl Monks concerning the following question:
Hello Again
,
I'm just attempting to write a module and was wondering if it is bad practise to have subroutines within the module that don't *return* anything? For example, I have a common subroutine I use all the time called printFile(); It goes like this:
sub printFile { my ($file) = @_; open FH, "<$file" or return; print while (<FH>); close FH; # do not complain if it cannot }
Now I want to include this in my module so I can use it as and when I like in my programs, but is this bad coding practice? (I know I should be using a templating system also, but that's a whole other story :-) )
Many thanks,
Tom
Back to
Seekers of Perl Wisdom