What is the use of -t?



What is the use of -t?..

Answer / Kumar Abhimanyu Singh

-t is a Perl built-in variable that tests whether input comes from a terminal (interactive) or a pipe/redirection (non-interactive). It's often used to determine if a script should run in tty mode or not. For example: if (-T) { print "This script is running interactively.n" }

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More CGI Perl Interview Questions

Explain which feature of PERL provides code reusability?

1 Answers  


What are the steps involved in configuring a server using cgi programming?

1 Answers  


What are some common methods to all handles in perl?

1 Answers  


Explain what is STDIN, STDOUT and STDERR?

1 Answers  


Explain the arguments for perl interpreter.

1 Answers  


Explain strftime() function in perl?

1 Answers  


How to open and read data files with Perl

1 Answers  


What is the importance of perl warnings? How do you turn them on?

1 Answers  


What are prefix dereferencer? List them.

1 Answers  


Write a program to download the contents from www.perlinterview.com/answers.php website in Perl.

1 Answers  


What rules must be followed by modules in perl.

1 Answers  


How to implement a stack in Perl?

1 Answers  


Categories