How would I send the 'space bar command' in the following

  • Thread starter grocery_stocker
  • Start date
G

grocery_stocker

Given the following...

[cdalten@localhost oakland]$ more man.pl
#!/usr/bin/perl

use strict;
use warnings;

open my $out, '|-', 'man perl' or die "cannot open pipe to man
pages";

#print $out "find nope a=cdalten\n";

close $out or die "cannot close pipe to man pages: $!";

[cdalten@localhost oakland]$ ./man.pl

I get....

PERL(1) Perl Programmers Reference Guide
PERL(1)

NAME
perl - Practical Extraction and Report Language

SYNOPSIS
perl [ -sTtuUWX ] [ -hv ] [ -V[:configvar] ]
[ -cw ] [ -d[t][:debugger] ] [ -D[number/list] ]
[ -pna ] [ -Fpattern ] [ -l[octal] ] [ -0[octal/
hexadecimal] ]
[ -Idir ] [ -m[-]module ] [ -M[-]’module...’ ] [ -f ]
[ -C [number/list] ] [ -P ] [ -S ] [ -x
[dir] ]
[ -i[extension] ] [ -e ’command’ ] [ -- ] [ program-
file ] [ argument ]...

If you’re new to Perl, you should start with perlintro, which
is a gen-
eral intro for beginners and provides some background to help
you navi-
gate the rest of Perl’s extensive documentation.

For ease of access, the Perl manual has been split up into
several sec-
tions.

Overview

:

The problem is that the program just stops at ':'. Ie, I have to
physically press the space bar on my keyboard to get to the next page.
How would I set it up some the I could have the program do it for me?
 
G

grocery_stocker

Given the following...

[cdalten@localhost oakland]$ more man.pl
#!/usr/bin/perl

use strict;
use warnings;

open my $out, '|-', 'man perl' or die "cannot open pipe to man
pages";

#print $out "find nope a=cdalten\n";

close $out or die "cannot close pipe to man pages: $!";

[cdalten@localhost oakland]$ ./man.pl

I get....

PERL(1) Perl Programmers Reference Guide
PERL(1)

NAME
perl - Practical Extraction and Report Language

SYNOPSIS
perl [ -sTtuUWX ] [ -hv ] [ -V[:configvar] ]
[ -cw ] [ -d[t][:debugger] ] [ -D[number/list] ]
[ -pna ] [ -Fpattern ] [ -l[octal] ] [ -0[octal/
hexadecimal] ]
[ -Idir ] [ -m[-]module ] [ -M[-]’module...’ ] [ -f ]
[ -C [number/list] ] [ -P ] [ -S ] [ -x
[dir] ]
[ -i[extension] ] [ -e ’command’ ] [ -- ] [ program-
file ] [ argument ]...

If you’re new to Perl, you should start with perlintro, which
is a gen-
eral intro for beginners and provides some background to help
you navi-
gate the rest of Perl’s extensive documentation.

For ease of access, the Perl manual has been split up into
several sec-
tions.

Overview

:

The problem is that the program just stops at ':'. Ie, I have to
physically press the space bar on my keyboard to get to the next page.
How would I set it up some the I could have the program do it for me?


Let me try this again. How would I set it up so that I could have the
program do it for me? I can type. I really can.
 
G

grocery_stocker

In our last episode,
<[email protected]>, the
lovely and talented grocery_stocker broadcast on comp.lang.perl.misc:


Given the following...
[cdalten@localhost oakland]$ more man.pl
#!/usr/bin/perl
use strict;
use warnings;
open my $out, '|-', 'man perl' or die "cannot open pipe to man
pages";
#print $out "find nope a=cdalten\n";
close $out or die "cannot close pipe to man pages: $!";
[cdalten@localhost oakland]$ ./man.pl
I get....
PERL(1) Perl Programmers Reference Guide
PERL(1)
NAME
perl - Practical Extraction and Report Language
SYNOPSIS
perl [ -sTtuUWX ] [ -hv ] [ -V[:configvar] ]
[ -cw ] [ -d[t][:debugger] ] [ -D[number/list] ]
[ -pna ] [ -Fpattern ] [ -l[octal] ] [ -0[octal/
hexadecimal] ]
[ -Idir ] [ -m[-]module ] [ -M[-]?module...? ] [ -f ]
[ -C [number/list] ] [ -P ] [ -S ] [ -x
[dir] ]
[ -i[extension] ] [ -e ?command? ] [ -- ] [ program-
file ] [ argument ]...
If you?re new to Perl, you should start with perlintro, which
is a gen-
eral intro for beginners and provides some background to help
you navi-
gate the rest of Perl?s extensive documentation.
For ease of access, the Perl manual has been split up into
several sec-
tions.
Overview
:
The problem is that the program just stops at ':'. Ie, I have to
physically press the space bar on my keyboard to get to the next page.
How would I set it up some the I could have the program do it for me?
Let me try this again. How would I set it up so that I could have the
program do it for me? I can type. I really can.

It appears to me that man is invoking the pager. It shouldn't do this if it
knows it is not writing to a term. I don't know what is wrong here, but
why not:

print `man perl`;

at any rate

perl -e 'print `man perl`;'

seems to work fine from the command line.

because I also want to send stuff like 'esc shift >'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top