kev
kev

Reputation: 3

Show output of a perl script in linux

I am using a web interface written in php that runs a perl script in a linux environment.It passes parameters(username,password,...) to the script . I want to view the output of the script without interfering with the process. Note that the script in his turn also passes data and excutes another program.

The script contains print commands like

if( $@ ){ print "Error :".$@."\n"; print "skip...\n"; } else{ }

I just want to view these results from the shell, also it would do it if i can save into a txt file .

thanks a lot!

Upvotes: 0

Views: 2802

Answers (1)

daxim
daxim

Reputation: 39158

Run the Perl program from the shell to see the output from print.

$ perl theprogram
⋮
Error : blah blah
skip...
⋮

Redirect STDOUT to save it into a file.

$ perl theprogram > theprogram.log

These are the very basics of shell usage, you already should know all this if you are a programmer. If not, read a Unix book for beginners.

Upvotes: 1

Related Questions