JupiterHost.Net wrote:
Hello group,
I was wanting opinions on what you think is better and why:
Assuming there are several places you need to check and see if the script is being run via terminal or not, would it be better to:
if(-t STDIN) {
everytime *or* do it once:
my $isterminal = -t STDIN;
and then do
if($isterminal) {
everytime?
Just FYI, as I suspected using the variable version is consistently a bit faster (and more maintainable: if you need to change the logic you change it in one place instead of each -t) on benchmark tests.
So its variable time for me :)
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>