Hi,

I have some subroutine that tests either one machine or a bunch of them. If
it's a single machine, the "print" statements in the subroutine should go to
stdout (no change needed for this, that's how it works now), if however I
want to test a lot of machines, I want the "print" statements redirected to
a logfile.

from a "logical" thought something like this:

if ($opt_l) {
        open Logfile;
        $print=LOG;
}

sub test {
        print $print "some output";
}

so if $print is empty it prints to stdout, if it contains LOG it should do a
"print LOG 'some output';".

somehow my logic doesn't work though, what's the correct way?

Lars
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to