perlquestion
CodeJunkie
<p>Hello Again<br/>,
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:
</p>
<p>
<code>
sub printFile {
my ($file) = @_;
open FH, "<$file" or return;
print while (<FH>);
close FH; # do not complain if it cannot
}
</code>
</p>
<p>
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 :-) )
</p>
<p>Many thanks,<br/>Tom</p>