/[iselect]/bin/iselect.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /bin/iselect.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 14 - (hide annotations)
Thu Oct 25 17:24:33 2007 UTC (16 years, 4 months ago) by dpavlin
File MIME type: text/plain
File size: 549 byte(s)
continue move to OO land.
1 dpavlin 1 #!/usr/bin/perl -w
2    
3     use strict;
4 dpavlin 12
5     use blib;
6    
7     use Term::ISelect;
8 dpavlin 1 use Data::Dump qw/dump/;
9    
10     my $data = <<'EOF';
11     First line
12    
13 dpavlin 4 {s}first selectable
14     {s}second selectable
15 dpavlin 1
16     a space....
17    
18     ...infinity and beyond
19    
20    
21 dpavlin 4 {s}foo
22     {s}bar
23 dpavlin 1
24     bum
25 dpavlin 4
26 dpavlin 1 EOF
27    
28 dpavlin 11 $data .= ( rand(10) < 5 ? '{s}' : '' ) . "foobar $_\n" foreach ( 1 .. 300 );
29 dpavlin 1
30 dpavlin 6 $data .= "\n--EOF--";
31 dpavlin 14
32     my @lines = split(/\n/, $data);
33     warn "lines = ", dump( @lines );
34 dpavlin 6
35 dpavlin 14 my $iselect = Term::ISelect->new({
36     lines => [ @lines ],
37     });
38    
39     $iselect->loop(
40 dpavlin 12 sub {
41     warn "## ",dump(@_);
42     },
43     );
44 dpavlin 1

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26