Sponsored Content
Top Forums Shell Programming and Scripting Perl :How to print the o/p of a Perl script on console and redirecting same in log file @ same time. Post 302487663 by butterfly20 on Thursday 13th of January 2011 07:00:07 AM
Old 01-13-2011
Perl :How to print the o/p of a Perl script on console and redirecting same in log file @ same time.

How can i print the output of a perl script on a unix console and redirect the same in a log file under same directory simultaneously ?

Like in Shell script, we use tee, is there anything in Perl or any other option ?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl - print to a log file and screen

as the title suggests, i need to print a user message to a log file and the screen using perl. in unix i set up a function using 'tee' like so function Display_Message { echo "$*" | tee -ai $LOGFILE } the following command then obviously displays to the screen and prints to a log... (6 Replies)
Discussion started by: mjays
6 Replies

2. Shell Programming and Scripting

Perl or Shell script to read a transaction log in real time

Hello, I have a Apache webserver running on RedHat. Its primary function is a proxy server for users accessing the internet. I have a transaction log that logs every transactions of every users. For users trying to access certain sites/content the transactions goes into a 302 redirect loop and... (2 Replies)
Discussion started by: bruno406
2 Replies

3. Shell Programming and Scripting

Perl script issue: print

Can someone tell me what I'm doing wrong with my perl script? I am new to Perl. This isn't even the final script, I'm just testing to see if it will print the directories with the files in it. For some reason my output is only printing the 1st, 6th, and last entries of the @sub_dir array. Each... (3 Replies)
Discussion started by: man
3 Replies

4. Shell Programming and Scripting

Perl Print Problems in script

Hi Perl Gurus, perl -e 'print "http://www.site@domain.com"' The output of the above is : http://www.site.com" I want to print http://www.site@domain.com without using escape sequence before '@' like '\@'. Is there any way to do this in perl? Thanks, Som (1 Reply)
Discussion started by: som.nitk
1 Replies

5. Shell Programming and Scripting

Redirecting output to both console and to a file

Hi All, Is there a way in Bash we can redirection some output to both console and the file at the same time. ~Parag (2 Replies)
Discussion started by: paragkalra
2 Replies

6. Shell Programming and Scripting

perl script to print file information - newbie

Hi I have a perl script that prints all the video and audio file information(playing duration). It works fine in one of my friends linux laptop. But it doesn't work in my both windows and linux. My friend told me I have to do install some module ( ppm instal ...... ) but I have no... (1 Reply)
Discussion started by: srijith
1 Replies

7. Web Development

problem with exporting vairable from one perl cgi to another perl cgi script while redirecting.

Can anyone tell me how to export a variable from one perl CGI script to another perl cgi script when using a redirect. Upon running the login.pl the user is prompted to enter user name and password. Upon entering the correct credentials (admin/admin) the user is redirected to welcome page. My... (3 Replies)
Discussion started by: Arun_Linux
3 Replies

8. Shell Programming and Scripting

[Shell/Perl(?)] Prepending timestamps to console output & writing results to a file

I do a lot of TSM work and I embarked on what I thought would be an easy task, and I'd be very happy for any input to save the pounding my keyboard is receiving :] By default, the output of TSM's console has no timestamping, making it hard to sort through accurately. This puts my console into... (5 Replies)
Discussion started by: Vryali
5 Replies

9. Shell Programming and Scripting

Time out set in perl script

Hi, I am preparing a perl script, which will run some commads on remote Linux servers. I have a file contains all the servers names one by one like below vi servers.txt srv1 srv2 srv3 Now, I need to prepare a perl script to ssh (or)rsh to each server in the above... (1 Reply)
Discussion started by: kumar85shiv
1 Replies

10. Programming

PERL: In a perl-scripttTrying to execute another perl-script that SETS SOME VARIABLES !

I have reviewed many examples on-line about running another process (either PERL or shell command or a program), but do not find any usefull for my needs way. (Reviewed and not useful the system(), 'back ticks', exec() and open()) I would like to run another PERL-script from first one, not... (1 Reply)
Discussion started by: alex_5161
1 Replies
PIRL(1p)						User Contributed Perl Documentation						  PIRL(1p)

NAME
pirl - A read-eval-print loop in Perl (see Shell::Perl) SYNOPSIS
pirl pirl --noornaments pirl --version pirl -v EXAMPLE SESSION
$ pirl Welcome to the Perl shell. Type ':help' for more information pirl @> 1+1 2 pirl @> use YAML qw(Load Dump); () pirl @> $data = Load("--- { a: 1, b: [ 1, 2, 3] } "); { a => 1, b => [1, 2, 3] } pirl @> $var = 'a 1 2 3'; $var =~ /(w+) (d+) (d+)/ ("a", 1, 2) pirl @> :q DESCRIPTION
This script is the command-line interface to "Shell::Perl" which does it all. By now, read the fine details at "Shell::Perl" documentation. OPTIONS
--ornaments - turn on terminal ornaments (default) --noornaments - turn off terminal organments --version, -v - prints version info and exits with 0 SEE ALSO
Shell::Perl BUGS
Please report bugs via CPAN RT <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Shell-Perl>. AUTHOR
Adriano R. Ferreira, <ferreira@cpan.org> Caio Marcelo, <cmarcelo@cpan.org> COPYRIGHT AND LICENSE
Copyright (C) 2007aXX2011 by Adriano R. Ferreira This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2011-03-10 PIRL(1p)
All times are GMT -4. The time now is 10:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy