[Chicago-talk] writing a log with Cron, Daemons, Perl

Jay Strauss me at heyjay.com
Thu Sep 11 21:40:45 CDT 2003


Steve,

Why do you do the -t test?  And which file is it testing that it's opened to
a tty?

Jay
> unless( -t )
> {
>     use Basename;
>
>     my $base = (fileparse $0, '\..*')[0];
>     open STDOUT, '>', "$logdir/$base.out";
>     open STDERR, '>', "$logdir/$base.err";
>
>     select STDERR;
>     $| = 1;
>
>     select STDOUT;
> }
>
>
> --
> Steven Lembark                                            2930 W. Palmer
> Workhorse Computing                                    Chicago, IL 60647
>                                                          +1 888 910 1206
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at mail.pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk
>
>




More information about the Chicago-talk mailing list