We’ve discussed a parallel to perldoc, but what about CPAN? I know that
we have RAA, but CPAN’s recursive auto-installer is one of the really big
reasons so many non-programmers can use perl-based software. People are
much less likely to reinvent the wheel if it’s easy for them to explore
existing wheels, and people are much more likely to use your ruby-based
software if they just have to type ‘cpan install ’ and know it
will download, compile, and install everything.
In my experience it always tries to update Perl itself, which is a bit
cheeky if you just wanted HTML-Parser…
There was a bug in the version of CPAN shipped with 5.6.0, I believe,
which caused this. It’s long since fixed, and I think it was only one
subrelease of CPAN.
Its better than what we have, but as I’ve said before, there are better
models than CPAN to emulate (BSD ports/package tree and Debian apt-get
spring to mind).
Frankly, it doesn’t matter to me which one, as long as there’s something.
I’m already starting to feel like a crack addict without a pipe or
lighter. I wrote a small amount in perl yesterday for the first time in
about a month, and it was, um, horrible. I left out all the semicolons
and parens and dollar signs, just like in ruby, and it didn’t work.
Unfortunately, perl has a very mature selection of modules which I’ve come
to depend on, with Net::LDAP being at the top of the list for me (I’m a
sysadmin, and I store lotsa stuff in LDAP), because it’s all perl and
includes SSL support. I expect as I use ruby more I’ll delve into helping
out on the ldap module.
So my basic point is, I definitely don’t want to go back to using perl
(wow, that was fast) but there are definitely some things I miss about it,
and I’d like to do what I can to support bringing those features to ruby,
especially if ruby doesn’t replicate perl’s mistakes.
Luke
···
On Wed, 17 Dec 2003, Rasputin wrote:
–
The death rate on Earth is: … (computing) … One per person.
Well… I’m thinking of man pages here. A typical man page is a lot
longer than the vertical size of a terminal, so sending the output to
stdout is not, on itself, very useful. Something that scrolls would
make more sense. The only good thing about stdout is that you can
redirect the output and pipe it through grep, but you can already do
that. You can pipe and redirect man pages already as it is.
They’re just the standard variables to set to change your pager. The man
command is the main thing that uses them, but anything that supports
paging should use the PAGER variable. I only know about them because I
always reset mine to ‘less’ instead of ‘more’.
I haven’t yet used ri, but it should definitely be coded to use that
variable by default (which means it doesn’t use it if it’s connected to a
pipe instead of a terminal, for instance).
I’ve also written some scripts which use these variables. It’s pretty
easy.
Luke
···
On Wed, 17 Dec 2003, Daniel Carrera wrote:
On Wed, Dec 17, 2003 at 07:07:45AM +0900, Luke A. Kanies wrote:
Shouldn’t it just use the PAGER or READER environment variable? I don’t
really know what the difference is between the two, since they’re always
set the same for me, but I know perldoc uses one of them, and ri should do
the same, at least on Unix. That’s what they’re for, and it certainly
provides a more consistent interface (consistent with man, that is).
I didn’t know about those variables. How do they work?
–
The hypothalamus is one of the most important parts of the brain,
involved in many kinds of motivation, among other functions. The
hypothalamus controls the “Four F’s”: 1. fighting; 2. fleeing;
3. feeding; and 4. mating.
– Psychology professor in neuropsychology intro course
Yeah, I’m using it (and getting segfaults :), but it has to be compiled
against C libraries, whereas Net::LDAP is entirely in perl, depending
(almost) entirely on other perl libraries. This makes portability a
heckuva lot easier, and also reduces the amount you have to distribute to
get ldap working everywhere. I use LDAP a heckuva lot, and I generally do
ldap operations on all of my hosts sometimes, which means I need this
everywhere, and the easier that is for me, the happier I am.
As to SSL, ruby-ldap does not yet support it. I don’t know if I’m up to
helping provide it, either; most of my experience is in perl and shell,
and I’d like to continue my streak of successfully avoiding programming in
C.
Luke
···
On Wed, 17 Dec 2003, Daniel Berger wrote:
“Luke A. Kanies” wrote:
Frankly, it doesn’t matter to me which one, as long as there’s something.
I’m already starting to feel like a crack addict without a pipe or
lighter. I wrote a small amount in perl yesterday for the first time in
about a month, and it was, um, horrible. I left out all the semicolons
and parens and dollar signs, just like in ruby, and it didn’t work.
Unfortunately, perl has a very mature selection of modules which I’ve come
to depend on, with Net::LDAP being at the top of the list for me (I’m a
sysadmin, and I store lotsa stuff in LDAP), because it’s all perl and
includes SSL support. I expect as I use ruby more I’ll delve into helping
out on the ldap module.
See ruby-ldap on the RAA. Dunno about ssl support.
–
Computers are not intelligent. They only think they are.
I didn’t know about those variables. How do they work?
They’re just the standard variables to set to change your pager. The man
command is the main thing that uses them, but anything that supports
paging should use the PAGER variable. I only know about them because I
always reset mine to ‘less’ instead of ‘more’.
I didn’t know you could change that. That’s awesome!
I hate “more” and I’ve been really frustrated ever since I started using
this Solaris box. The fact that, by default, “man” uses “more” under
Solaris was one of the anoyances I’ve had.
Yes, exactly. That’s what I was saying. You can already do
redirections and pipes with “man” so there’s no point in making “man”
send its output to stdout.
···
On Wed, Dec 17, 2003 at 07:25:54AM +0900, Thomas Adam wrote:
Well… I’m thinking of man pages here. A typical man page is a lot
longer than the vertical size of a terminal, so sending the output to
stdout is not, on itself, very useful. Something that scrolls would
make more sense. The only good thing about stdout is that you can
redirect the output and pipe it through grep, but you can already do
that. You can pipe and redirect man pages already as it is.
So says the man who hasn’t looked at the perldoc source…
It actually isn’t quite as simple as it might be: the lack of decent
pipe support under Windows means I’m going to have to go through a
temporary file, which is kind of ugly. Perhaps someone might want to
look at tidying it all up later on. In the meantime, it works…
Cheers
Dave
···
On Dec 16, 2003, at 16:35, Luke A. Kanies wrote:
but anything that supports
paging should use the PAGER variable. I only know about them because I
always reset mine to ‘less’ instead of ‘more’.
…
I’ve also written some scripts which use these variables. It’s pretty
easy.
Just a note about PAGER. Some systems (both my Debian installs, for
example) don’t define PAGER or READER, but use a symlink named ‘pager’.
It may be useful somehow to check for all of those.
My (Debian) “man man” says:
PAGER If $PAGER is set, its value is used as the name of the
program used to display the manual page. By default, exec
/usr/bin/pager -s is used.
A SuSe system here at work has the exact paragraph, so I assume it’s some
sort of standard behavior.
···
On Wed, 17 Dec 2003, Luke A. Kanies wrote:
On Wed, 17 Dec 2003, Daniel Carrera wrote:
On Wed, Dec 17, 2003 at 07:07:45AM +0900, Luke A. Kanies wrote:
Shouldn’t it just use the PAGER or READER environment variable? I don’t
really know what the difference is between the two, since they’re always
set the same for me, but I know perldoc uses one of them, and ri should do
the same, at least on Unix. That’s what they’re for, and it certainly
provides a more consistent interface (consistent with man, that is).
I didn’t know about those variables. How do they work?
They’re just the standard variables to set to change your pager. The man
command is the main thing that uses them, but anything that supports
paging should use the PAGER variable. I only know about them because I
always reset mine to ‘less’ instead of ‘more’.
I haven’t yet used ri, but it should definitely be coded to use that
variable by default (which means it doesn’t use it if it’s connected to a
pipe instead of a terminal, for instance).
I’ve also written some scripts which use these variables. It’s pretty
easy.
Luke
–
The hypothalamus is one of the most important parts of the brain,
involved in many kinds of motivation, among other functions. The
hypothalamus controls the “Four F’s”: 1. fighting; 2. fleeing;
3. feeding; and 4. mating.
– Psychology professor in neuropsychology intro course
“If you’ve got a 5000-line JSP page that has “all in one” support
for three input forms and four follow-up screens, all controlled
by “if” statements in scriptlets, well … please don’t show it
to me :-). Its almost dinner time, and I don’t want to lose my
appetite :-).”
- Craig R. McClanahan
Well… I’m thinking of man pages here. A typical man page is a lot
longer than the vertical size of a terminal, so sending the output to
stdout is not, on itself, very useful. Something that scrolls would
make more sense. The only good thing about stdout is that you can
redirect the output and pipe it through grep, but you can already do
that. You can pipe and redirect man pages already as it is.
man <some_page> | col -b | less
man <some_page> | col -b | grep “something”
man <some_page> | col -b > ~/my_manpage
Yes, exactly. That’s what I was saying. You can already do
redirections and pipes with “man” so there’s no point in making “man”
send its output to stdout.
That’s exactly what “man” is doing here – sending its output to
stdout. Stdout being a tty device is a special case for “man” – in
this case it invokes PAGER command and redirects its own stdout to the
command’s stdin through the pipe.
Sincerely,
Gennady Bystritsky
···
On Dec 16, 2003, at 15:24, Daniel Carrera wrote:
On Wed, Dec 17, 2003 at 07:25:54AM +0900, Thomas Adam wrote:
Hey now, I think I included an “on Unix” disclaimer somewhere, although it
may have been in a different email. Given my total lack of Windows
programming experience, I would not claim to understand those
complexities.
I agree that temp files are ugly; it always amazes me that so many
programmers have not discovered this.
Luke
···
On Wed, 17 Dec 2003, Dave Thomas wrote:
On Dec 16, 2003, at 16:35, Luke A. Kanies wrote:
but anything that supports
paging should use the PAGER variable. I only know about them because I
always reset mine to ‘less’ instead of ‘more’.
…
I’ve also written some scripts which use these variables. It’s pretty
easy.
So says the man who hasn’t looked at the perldoc source…
It actually isn’t quite as simple as it might be: the lack of decent
pipe support under Windows means I’m going to have to go through a
temporary file, which is kind of ugly. Perhaps someone might want to
look at tidying it all up later on. In the meantime, it works…
–
"The leader of Jamestown was “John Smith” (not his real name), under
whose direction the colony engaged in a number of activities,
primarily related to starving. – Dave Barry, “Dave Barry Slept Here”
Just a note about PAGER. Some systems (both my Debian installs, for
example) don’t define PAGER or READER, but use a symlink named ‘pager’.
It may be useful somehow to check for all of those.
My (Debian) “man man” says:
PAGER If $PAGER is set, its value is used as the name of the
program used to display the manual page. By default, exec
/usr/bin/pager -s is used.
A SuSe system here at work has the exact paragraph, so I assume it’s
some
sort of standard behavior.
A SuSe system here at work has the exact paragraph, so I assume it’s some
sort of standard behavior.
I’ve got a gentoo system, and ‘man man’ says this:
MANPAGER
If MANPAGER is set, its value is used as the name of the program to
use to display the man page. If not, then PAGER is used. If that
has no value either, /usr/bin/less -is is used.
Just a note about PAGER. Some systems (both my Debian installs, for
example) don’t define PAGER or READER, but use a symlink named ‘pager’.
It may be useful somehow to check for all of those.
My (Debian) “man man” says:
PAGER If $PAGER is set, its value is used as the name of the
program used to display the manual page. By default, exec
/usr/bin/pager -s is used.
A SuSe system here at work has the exact paragraph, so I assume it’s
some
sort of standard behavior.
“If you’ve got a 5000-line JSP page that has “all in one” support
for three input forms and four follow-up screens, all controlled
by “if” statements in scriptlets, well … please don’t show it
to me :-). Its almost dinner time, and I don’t want to lose my
appetite :-).”
- Craig R. McClanahan
Interesting. So there’s apparantly no consistant way of finding a pager
program.
Somehow I’m not the least bit suprised.
Derek Lewis
···
On Thu, 18 Dec 2003, Jamis Buck wrote:
I’ve got a gentoo system, and ‘man man’ says this:
MANPAGER
If MANPAGER is set, its value is used as the name of the program to
use to display the man page. If not, then PAGER is used. If that
has no value either, /usr/bin/less -is is used.
“If you’ve got a 5000-line JSP page that has “all in one” support
for three input forms and four follow-up screens, all controlled
by “if” statements in scriptlets, well … please don’t show it
to me :-). Its almost dinner time, and I don’t want to lose my
appetite :-).”
- Craig R. McClanahan
Here’s the code I’m using in ‘ri’. Will it work across the systems that
folks use?
for pager in [ ENV['pager'], "less", "more <" ].compact.uniq
if system("#{pager} #{path}")
paged = true
break
end
end
if !paged
@options.use_stdout = true
puts File.read(path)
end
Cheers
Dave
···
On Dec 17, 2003, at 13:25, Thomas Adam wrote:
Interesting. So there’s apparantly no consistant way of finding a
pager
program.
It would be easy to do…
Test for either:
$PAGER
and the like…
if they’re defined use them, otherwise default to a generic one.
Looks good, but you might want to throw “/usr/bin/pager” after the ENV.
···
On Thu, 18 Dec 2003, Dave Thomas wrote:
On Dec 17, 2003, at 13:25, Thomas Adam wrote:
Interesting. So there’s apparantly no consistant way of finding a
pager
program.
It would be easy to do…
Test for either:
$PAGER
and the like…
if they’re defined use them, otherwise default to a generic one.
Here’s the code I’m using in ‘ri’. Will it work across the systems that
folks use?
for pager in [ ENV['pager'], "less", "more <" ].compact.uniq
if system("#{pager} #{path}")
paged = true
break
end
end
if !paged
@options.use_stdout = true
puts File.read(path)
end
“If you’ve got a 5000-line JSP page that has “all in one” support
for three input forms and four follow-up screens, all controlled
by “if” statements in scriptlets, well … please don’t show it
to me :-). Its almost dinner time, and I don’t want to lose my
appetite :-).”
- Craig R. McClanahan
Interesting. So there’s apparantly no consistant way of finding a pager
program.
It would be easy to do…
Test for either:
$PAGER
and the like…
if they’re defined use them, otherwise default to a generic one.
Here’s the code I’m using in ‘ri’. Will it work across the systems that
folks use?
for pager in [ ENV['pager'], "less", "more <" ].compact.uniq
if system("#{pager} #{path}")
paged = true
break
end
end
if !paged
@options.use_stdout = true
puts File.read(path)
end
If that ‘for’ list gets much, it’ll soon be easier to just
write your own terminal handler
But it sounds like every *NIX has its own custom variable/binary.
My 2 euro is just choose an environment variable (I think PAGER is
traditional) and use it. Platform specific installers can set it if
need be. If its not set print a warning to set it maybe?
Interesting. So there’s apparantly no consistant way of finding a
pager
program.
It would be easy to do…
Test for either:
$PAGER
and the like…
if they’re defined use them, otherwise default to a generic one.
Here’s the code I’m using in ‘ri’. Will it work across the systems that
folks use?
for pager in [ ENV['pager'], "less", "more <" ].compact.uniq
if system("#{pager} #{path}")
paged = true
break
end
end
if !paged
@options.use_stdout = true
puts File.read(path)
end
If you want to be like man etc. then you should use ENV[‘PAGER’], I
think.