HP3000-L Archives

May 2001, Week 5

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"COLE,GLENN (Non-HP-SantaClara,ex2)" <[log in to unmask]>
Reply To:
COLE,GLENN (Non-HP-SantaClara,ex2)
Date:
Wed, 30 May 2001 19:21:09 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (41 lines)
Mark Bixby writes:

> The Perl code which creates a temporary copy and then streams a job after
> replacing all occurences of {CI expression} with the evaluated results of
> that expression (the finfo call is needed to convert MPE-style filenames
> into HFS-style filenames required by Perl):
>
> :print estream
> parm streamfile
> xeq perl.pub.perl &
>   "-p -e 's/{([^}]*)}/substr(`callci echo !\[$1\]`,0,-3)/eg' &
>   ![finfo('!streamfile','posixfullfname')]" &
>   >$newpass
> stream $oldpass
...
> No muss, no fuss, and free too!  :-)

Some may challenge the 'no muss, no fuss' part. ;)

My one real regret with this solution is for those shops which implement
this, but which are not (yet :) entirely comfortable with Perl.  For those,
Mark's preamble above may suffice as a comment in the command file.

Perl actually has a neat feature to help with the readability of
such expressions -- more in line with Mark's detailed deconstruction
a day or two ago -- but the max length of the info string likely
prevents it from being put to good use here.  (I've not tried.)

For details, see the first entry in the FAQ segment at

   http://www.perldoc.com/perl5.6/pod/perlfaq6.html

Perl's extensive use of "non-letters" may present an initial hurdle
(much like Greek characters did in math classes, or the wacky
syntax of Objective C), but it should not be a showstopper.

--Glenn, who is constantly thankful for the power of Perl

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2