in reply to printing and logging to a file
i rolled my own sub a long time ago, when i was pretty new to perl, and wanted the excersize. i dug it up for you:
i used it like so:#! /usr/local/bin/perl -w use strict; use FileHandle; use Getopt::Std; use vars qw($opt_n); die( "Error: No arguments passed.\n" ) unless( $#ARGV >= 0 ); my $text = pop @ARGV; die("no opts\n") unless getopts('n'); unless ( $opt_n ) { print $text."\n"; } while ($ARGV[0]) { $_ = shift; my $FH = new FileHandle ">>$_" or die( "oops! $!\n" ); print $FH $text."\n"; close( $FH ); }
mprint($::AUDITLOG, $::BUILDLOG, " ** dbcfg.tmp file in $::BUILDPATH n +ot found * Run Aborted!!!");
~Particle
|
|---|