Hi, all
---8<---
>
> > > Actually, I thought C<binmode()> was a NOOP on VMS.
> >
> > I think that perl's CORE::binmode() is but
> VMS::Stdio::binmode() really
> > does do a freopen() on the filehandle. Nico would like to
> add "ctx=bin"
> > to avoid CR insertion for mailbox talking to STDIN.
>
> Ah. C<freopen()> looks to be somehow associated with C and
> therefore Inherently Evil.
>
---8<---
Well whatever, the binmode way is portable acros platforms
(with freopen inside...),
whereas the Perl way probably should be:
(forgive the typo's, it's an crude example)
if ($^O eq 'VMS') {
close (STDIN);
$fh = vmsopen( "SYS$INPUT:" , ..... );
} else {
$fh = \STDIN;
}
Then I just have to rewrite all the code that uses stdin and
(f.e. cgi.pm) to get it all working again..... ;-{
now the only problem is how to set the STDIN back to the newly opened
$fh....?
The scripts should also run on AIX & SunOS ....
binmode makes these (and possibly other) scripts portable, as is...
which I prefer.
The only issue left with binmode is that it just manages OUTPUT file pointers
(except after my patch the STDIN), the input filepointers are never checked,
reopened or whatever.
During porting from the perl V5.5 (where it was still built in and not an
add-on)
-> new architecture somehow this was not done.
(B.T.W I'm on the list now)
regards,
Nico Baggus
-----------------------------------------------------------------
ATTENTION:
The information in this electronic mail message is private and
confidential, and only intended for the addressee. Should you
receive this message by mistake, you are hereby notified that
any disclosure, reproduction, distribution or use of this
message is strictly prohibited. Please inform the sender by
reply transmission and delete the message without copying or
opening it.
Messages and attachments are scanned for all viruses known.
If this message contains password-protected attachments, the
files have NOT been scanned for viruses by the ING mail domain.
Always scan attachments before opening them.
-----------------------------------------------------------------