sub Log{
my $message = shift();
my $LOGNAME = 'log.log';
open(LOGFILE, ">>$LOGNAME") or die("Could not open log file: $!");
print LOGFILE $message;
close(LOGFILE);
}
sub Print{
my message = shift(); #Assuming you are passing a string
my $Out = *STDOUT; # Standard out.
print $Out "$message\n";
Log("$message"); #Encapsulate message in quotes to say
#Damnit Jim I'm a singl string, not a
#space demlimited array!
}
==[ D-d-d-D-D_-Disclaimer ]================
Code provide was pulled outta the air and not
tested.
Kristofer
--- mark sony <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I wrote a script which is running perfectly fine providing
> many outputs on the screen . Only glitch is that it does not print
> in a log file . Now what I want is that it would print on the
> screen as well as create a log file . At the end of the program I
> will output that the above output can also be seen at the
> $log_File_position . Hope I am clear with my question . Any type
> of pointers and I would be over the moon ;)
>
> Thanx in advance
>
> Mark
> ___________________________________________________
> Meet your old school or college friends from
> 1 Million + database...
> Click here to reunite www.batchmates.com/rediff.asp
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
=====
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GIT d s+:++ a C++ UL++ US+ P+++ L++
W+++ w PS PE t++ b+ G e r+++ z++++
------END GEEK CODE BLOCK------
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]