Subject: | |
From: | |
Reply To: | COLE,GLENN (Non-HP-SantaClara,ex2) |
Date: | Wed, 30 May 2001 19:21:09 -0400 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
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 *
|
|
|