> I'm trying to write a portable echo for MakeMaker.  Everything's
> fine except for echoing XML...

> $ perl -wle "print [EMAIL PROTECTED]" "<foo>"
> Can't open input file foo> as stdin
> %RMS-F-SYN, file specification syntax error

> I can't figure out how to escape < when its the first piece of input.
> This works...

> $ perl -wle "print [EMAIL PROTECTED]" " <foo>"'
>  <foo>

> but that alters the input.

> So how do I escape a < on the VMS command line?

I have a not terrifically useful answer:

The redirection is being handled by Perl, not by DCL (the VMS shell); it
doesn't do redirection.  There's something in the Perl startup on VMS that
examines the arguments and sees whether they begin with < or > and tries to do
the right thing.  That's why quoting doesn't take away the redirection juju as
it would on Unix.

It seems extremely likely to me that we're screwed in terms of maintaining
backwards compatibility (redirection has to keep working or lots of existing
scripts break) and keeping up this capability.  The only thing I can think of
offhand is inventing more juju, specifically a kind of command-line quoting
that Perl can see in argv and knows just to strip but not to check for
redirection.  I suggest something like

$ perl -wle "print [EMAIL PROTECTED]" ="<foo>"

but it's still kinda messing with the input.

-- Alan

===============================================================================
 Alan Winston --- [EMAIL PROTECTED]
 Disclaimer: I speak only for myself, not SLAC or SSRL   Phone:  650/926-3056
 Paper mail to: SSRL -- SLAC BIN 99, 2575 Sand Hill Rd, Menlo Park CA   94025
===============================================================================


Return-path: <[EMAIL PROTECTED]>
Received: from smtp1.slac.stanford.edu (smtp1.slac.stanford.edu [134.79.18.82])
 by SSRL.SLAC.STANFORD.EDU (PMDF V6.2 #37667)
 with ESMTP id <[EMAIL PROTECTED]> for
 [EMAIL PROTECTED] (ORCPT [EMAIL PROTECTED]); Fri,
 28 Mar 2003 22:23:25 -0800 (PST)
Received: from CONVERSION-DAEMON.smtp1.slac.stanford.edu by
 smtp1.slac.stanford.edu (PMDF V6.1-1 #37665)
 id <[EMAIL PROTECTED]> for [EMAIL PROTECTED]
 (ORCPT [EMAIL PROTECTED]); Fri, 28 Mar 2003 22:23:24 -0800 (PST)
Received: from directory-daemon.smtp1.slac.stanford.edu by
 smtp1.slac.stanford.edu (PMDF V6.1-1 #37665)
 id <[EMAIL PROTECTED]> for [EMAIL PROTECTED]
 (ORCPT [EMAIL PROTECTED]); Fri, 28 Mar 2003 22:23:24 -0800 (PST)
Received: from onion.perl.org (onion.valueclick.com [64.70.54.95])
 by smtp1.slac.stanford.edu (PMDF V6.1-1 #37665)
 with SMTP id <[EMAIL PROTECTED]> for
 [EMAIL PROTECTED]; Fri, 28 Mar 2003 22:23:24 -0800 (PST)
Received: (qmail 83193 invoked by uid 1005); Sat, 29 Mar 2003 06:23:23 +0000
Received: (qmail 83178 invoked by uid 76); Sat, 29 Mar 2003 06:23:21 +0000
Date: Fri, 28 Mar 2003 22:23:16 -0800
From: Michael G Schwern <[EMAIL PROTECTED]>
Subject: Quoting < on the command line.
To: [EMAIL PROTECTED]
Message-id: <[EMAIL PROTECTED]>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-disposition: inline
Precedence: bulk
Delivered-to: mailing list [EMAIL PROTECTED]
Delivered-to: [EMAIL PROTECTED]
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
User-Agent: Mutt/1.4i
X-SMTPD: qpsmtpd/0.25, http://develooper.com/code/qpsmtpd/
X-Spam-Check-By: one.develooper.com
X-Spam-Status: No,
 hits=1.0 required=7.0 
tests=CARRIAGE_RETURNS,RCVD_IN_MULTIHOP_DSBL,RCVD_IN_UNCONFIRMED_DSBL,SPAM_PHRASE_00_01,USER_AGENT,USER_AGENT_MUTT
 version=2.44
X-SMTPD: qpsmtpd/0.25, http://develooper.com/code/qpsmtpd/
List-Post: <mailto:[EMAIL PROTECTED]>
List-Unsubscribe: <mailto:[EMAIL PROTECTED]>
List-Help: <mailto:[EMAIL PROTECTED]>
Original-recipient: rfc822;[EMAIL PROTECTED]

> I'm trying to write a portable echo for MakeMaker.  Everything's
> fine except for echoing XML...

> $ perl -wle "print [EMAIL PROTECTED]" "<foo>"
> Can't open input file foo> as stdin
> %RMS-F-SYN, file specification syntax error

> I can't figure out how to escape < when its the first piece of input.
> This works...

> $ perl -wle "print [EMAIL PROTECTED]" " <foo>"'
>  <foo>

> but that alters the input.

> So how do I escape a < on the VMS command line?


> --
> It's Ecstacy time!

Reply via email to