Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Ksh style select menus in perl

by yumpy (Sexton)
on Aug 02, 2002 at 14:59 UTC ( [id://187113]=note: print w/replies, xml ) Need Help??


in reply to Ksh style select menus in perl

Coincidentally, I just wrote a module the other day that uses source-filtering to implement the Ksh's select loop in Perl, plus more! I'm going on vacation very shortly, but when I return in about two weeks, I'll be posting it to the CPAN.

It supports these obvious invocations:

select (LIST) { block; } select $var (LIST) { block; } select my|local|our $var (LIST) { block; }
I've also just about got an interactive map-filtering style working too:
LIST2 = select {block;} LIST;
I figure it doesn't make any sense to support the following, because it just reduces to map():
LIST2 = select /expr/, LIST;
I'm glad other people are thinking about this, and I'll look forward to sharing my code with you soon!

Tim Maher, "yumpy"

Consultix
tim@teachmeperl.com

Replies are listed 'Best First'.
Re: Re: Ksh style select menus in perl
by yumpy (Sexton) on Sep 05, 2002 at 18:22 UTC
    I'm currently putting the finishing touches on this module, and working on registering a namespace for it in the CPAN. I expect it will be ready in the near future for downloads. Tim Maher tim@teachmeperl.com
      print
      My module that implements the select loop of the Korn and Bash shells has been released! It's called Shell::POSIX::Select, and it's available from your friendly neighborhood CPAN mirror now. You can also check out the documentation at my web site. Here's one of the examples shown in the documentation:
      use Shell::POSIX::Select ; # Extract man-page names from TOC portion of output of "perldoc perl" select $manpage ( sort ( `perldoc perl` =~/^\s+(perl\w+)\s/mg) ) { system "perldoc '$manpage'" ; } Screen 1) perl5004delta 2) perl5005delta 3) perl561delta 4) perl56delta 5) perl570delta 6) perl571delta . . . (This large menu spans multiple screens, but all parts can be accessed using your normal terminal scrolling facility.) Enter number of choice: 6 PERL571DELTA(1) Perl Programmers Reference Guide NAME perl571delta - what's new for perl v5.7.1 DESCRIPTION This document describes differences between the 5.7.0 release and the 5.7.1 release. . . .

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://187113]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-20 05:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found