Hi Peter,
> 
> On Tue, 13 Mar 2001 [EMAIL PROTECTED] wrote:
> 
> > 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.
> 
> You say that you want portability, however you'd have to put:
> 
> BEGIN { 
>     if ($^O eq 'VMS') { 
>         require "VMS::Stdio.pm"; 
>         import 'VMS::Stdio::binmode()';
>     }
> }
> 
> at any script that made use of the proposed change to
> VMS::Stdio::binmode().  Are you prepared to handle that?

Yep as it is only ONE change at the start of an inhouse written script.
and no changes to whatever modules we do use (like: smtp, ftp, rcmd alike, cgi
for example.) and I don't want to check and possibly modify code in there
as that makes future upgrades a nightmare.

> 
> > 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.
> 
> Are you here referring to CORE::binmode() as the "not an add on"?
--8<--
Yes, it used to be implented as a mybinmode, in the VMS.C specific part/
The core binmode only checks for the DOS/Windows platform and nothing else
(#ifdef...) and is a NOOP otherwise. In the past there were check like
#ifdef mybinmode ... etc. this seems to be deprecated.

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.
-----------------------------------------------------------------

Reply via email to