> OK, but how about:
>
> 1)where is $LOG being set?
$LOG is the first opened filehandle...
> 2)does it get past the dies shown below?
> 3)got strict? it's 'fer your own good, you know! ;)
>
Good question, good point....
> -Tom Kinzer
>
>
>
> #!/usr/bin/perl -w
>
> $file="./text";
> $|=1;
> use Fcntl;
> use IO::Handle;
>
> $D_LOG = $ENV{MHCONTEXTFD};
>
> open($LOG, "< logfile") or die "Unable to open 1st handle, stopped";
> open($D_LOG, "<& LOG") or die "Unable to open 2nd handle, stopped";
In the above (I believe) Perl does not know that LOG is a filehandle
rather than just the name of a file in the local directory or an
improper filehandle/file descriptor. If you intend to pass $LOG as a
filehandle you will need to do so properly. Whether you can use the 2
argument form with a $LOG in there I am not sure (it might get
stringified), you should definitely be able to use a 3 argument form and
then *not* quote $LOG. That or you should open your filehandle into a
named filehandle such as LOG rather than into a variable. (Regardless
you should add a $! to the error message to know *why* it failed not
just that it did) On top of this you set $file, but then open
'logfile'??? Are you supposed to be opening $file? And you said $D_LOG
to an environment variable, presumably an open file descriptor???, and
then clobber it by duping the other opened file handle into it? So
basically I have no idea what your actual intentions are... what are you
*really* trying to do?
perldoc perlopentut
perldoc -f open
perldoc -f pipe
> $LOG->autoflush(1);
> $D_LOG->autoflush(1);
>
> $line1=<$LOG>;
> $line2=<$D_LOG>;
>
> print "1:$line1 2:$line2";
>
<snip old worthless threads>
http://danconia.org
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]