/[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

Contents of /bin/iselect.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26