Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Is there a "poor man's" perldoc?

Reply
Thread Tools

Is there a "poor man's" perldoc?

 
 
jl_post@hotmail.com
Guest
Posts: n/a
 
      03-04-2010
Hi,

I use the perldocs frequently when I'm programming in Perl.
However, on some systems I've used, "perldoc" is apparently not
installed (despite the fact that Perl is). What I'd like is a way to
cleanly extract the perldoc documentation from a module that is
installed on that system. (For example, I'd like to view the
documentation that I'd normally see with "perldoc Time::Local" on a
system that unfortunately doesn't have "perldoc" installed.)

I know that I can go to cpan.org and look up the documentation, but
sometimes I'm working on a system cut off from the internet. Just
extracting the perl documentation from an already installed module
doesn't seem to me to be a very complex issue (although maybe I'm
wrong).

So what I'm asking is: Is there a pure-Perl way to view a module's
perldoc documentation, particularly if the "perldoc" package is not
installed (and I have no power to install it)?

Thanks.

-- Jean-Luc
 
Reply With Quote
 
 
 
 
John Bokma
Guest
Posts: n/a
 
      03-04-2010
"" <> writes:

> So what I'm asking is: Is there a pure-Perl way to view a module's
> perldoc documentation, particularly if the "perldoc" package is not
> installed (and I have no power to install it)?


perldoc *is* pure Perl.

Install Pod:erldoc and locally [1], it comes with perldoc.
Just set a path to it, or:

perl -MPod:erldoc -e'Pod:erldoc->run()' Time::Local

perldoc -q 'own module'

--
John Bokma j3b

Hacking & Hiking in Mexico - http://johnbokma.com/
http://castleamber.com/ - Perl & Python Development
 
Reply With Quote
 
 
 
 
jl_post@hotmail.com
Guest
Posts: n/a
 
      03-04-2010
> "jl_p...@hotmail.com" <jl_p...@hotmail.com> asked:
> > * *So what I'm asking is: *Is there a pure-Perl way to view
> > a module's perldoc documentation, particularly if the
> > "perldoc" package is not installed (and I have no power to
> > install it)?

>
> perldoc *is* pure Perl.



On Mar 4, 12:44*pm, John Bokma <j...@castleamber.com> replied:
>
> Install Pod:erldoc and locally [1], it comes with perldoc.
> Just set a path to it, or:
>
> perl -MPod:erldoc -e'Pod:erldoc->run()' Time::Local



Excellent! I just tried that one command on one system that
doesn't have "perldoc" installed, and the perldoc documentation for
Time::Local appeared! (So ironically Pod:erldoc is apparently
already installed, even though the "perldoc" package is not.)

It even works for regular perldoc pages, like "perlpacktut", like
this:

perl -MPod:erldoc -e "Pod:erldoc->run()" perlpacktut

If I want to look up a core function, like split(), I can't figure
out how to emulate "perldoc -f split", but I CAN do:

perl -MPod:erldoc -e "Pod:erldoc->run()" perlfunc

and look it up from there. However, I still can't figure out how to
do things like "perldoc -q 'own module'". (I'd read through the
"perldoc Pod:erldoc" documentation, but apparently there isn't
any...)

Anyway, John, your solution goes above and beyond what I was hoping
for. (Now I just need to commit it to memory for those times when I
can't look it up.)

Thanks again!

-- Jean-Luc
 
Reply With Quote
 
Jürgen Exner
Guest
Posts: n/a
 
      03-04-2010
"" <> wrote:
> I use the perldocs frequently when I'm programming in Perl.
>However, on some systems I've used, "perldoc" is apparently not
>installed (despite the fact that Perl is).


Then you may want to kick the administrator until he fixes the broken
installation.

jue
 
Reply With Quote
 
Bart Lateur
Guest
Posts: n/a
 
      03-05-2010
Jürgen Exner wrote:

>"" <> wrote:
>> I use the perldocs frequently when I'm programming in Perl.
>>However, on some systems I've used, "perldoc" is apparently not
>>installed (despite the fact that Perl is).

>
>Then you may want to kick the administrator until he fixes the broken
>installation.


Yeah, yeah.

Why not complain against the people making the Linux distributions. A
lot of them, if not all, separate the perl binary from the core modules.

--
Bart.
 
Reply With Quote
 
jl_post@hotmail.com
Guest
Posts: n/a
 
      03-05-2010
On Mar 4, 4:21*pm, Jürgen Exner <jurge...@hotmail.com> wrote:
>
> Then you may want to kick the administrator until he fixes the broken
> installation.


That might work, if only I lived anywhere near the administrator.
But in some cases, (s)he's in another country altogether.

Sadly, some people just don't think the perldocs are all that
important. Once I was working on a system maintained by a fellow co-
worker who lived all the way across the country, and I needed the
documentation for an important Perl script. I tried "perldoc"ing it,
of course, but unfortunately the "perldoc" package was not installed.

Over the phone I begged my co-worker to install the "perldoc"
package but he didn't see the point. He figured that since we already
had access to the Camel book there was nothing more that the perldocs
could offer. Nevertheless, I succeeded in having him install the
perldocs, after which I instantly pulled up all the relevant
documentation.

He was surprised. "How did you find that information so quickly?"
he asked. I explained him it that all good modules have documentation
that can be extracted with the "perldoc" package, but that the
documentation can only be viewed if the "perldoc" package is properly
installed.

He then muttered something about the perldocs being more than what
he thought they were, and went on his way to do something else.

(With other administrators I haven't been so lucky. Many of them I
don't even know personally, so I fire off an e-mail, and never hear
from them.)

While I agree with you 100% that system administrators should
install the "perldoc" package along with Perl, if they happen to think
it's redundant and not needed, convincing them otherwise is a bit like
moving mountains.

-- Jean-Luc
 
Reply With Quote
 
jl_post@hotmail.com
Guest
Posts: n/a
 
      03-05-2010
On Mar 4, 3:27*pm, Ben Morrow <b...@morrow.me.uk> wrote:
>
> perldoc almost certainly *is* installed somewhere,
> it's just not in your PATH. Check to see if your
> /usr/bin/perl is a symlink somewhere, and if
> the real binary has a 'perldoc' next to it.



I just tried your suggestion on one account (where "perldoc"
doesn't work) and sure enough, the file that "which perl" revealed was
indeed a symlink to... another symlink! I followed that new symlink,
and in that directory I found both the perl and the perldoc
executables.

So at least on that system, I can solve the perldoc problem by
creating an alias.

I'll have to try your suggestion on the system that lacks internet
access -- next time I use it, that is.

Thanks for your input, Ben.

-- Jean-Luc
 
Reply With Quote
 
John Bokma
Guest
Posts: n/a
 
      03-05-2010
Sherm Pendley <> writes:

> "" <> writes:
>
>> That might work, if only I lived anywhere near the administrator.
>> But in some cases, (s)he's in another country altogether.

>
> There's this thing called "email," you see...
>
>> Sadly, some people just don't think the perldocs are all that
>> important.

>
> Having perldocs on a production server is *not* important. You
> shouldn't be using that server for development work anyway. With
> VirtualBox et al, you can easily mirror whatever deployment config
> you need, right on your desktop, and install the tools and docs
> you need on that.


There is such a thing as working on a remote development server .
While you can mimick the development environment on your own machine, it
might not always be easy to do so.

--
John Bokma j3b

Hacking & Hiking in Mexico - http://johnbokma.com/
http://castleamber.com/ - Perl & Python Development
 
Reply With Quote
 
Jürgen Exner
Guest
Posts: n/a
 
      03-05-2010
Bart Lateur <> wrote:
>Jürgen Exner wrote:
>
>>"" <> wrote:
>>> I use the perldocs frequently when I'm programming in Perl.
>>>However, on some systems I've used, "perldoc" is apparently not
>>>installed (despite the fact that Perl is).

>>
>>Then you may want to kick the administrator until he fixes the broken
>>installation.

>
>Yeah, yeah.
>
>Why not complain against the people making the Linux distributions. A
>lot of them, if not all, separate the perl binary from the core modules.


Not sure if you really meant core modules or rather perl documentation.

As for the documentation being in a separate package that is actually
logical when thinking about servers (of all kind). Documentation is for
human consumption during code development and nobody in his right mind
would develop code on a live server. On the contrary, in a server
environment you want the configuration to be as slick and streamlined as
possible to reduce any even far-fetched chance of interference.
Therefore I would expect servers not to contain any documentation.

Of course omitting the docs in a developer's environment is
unforegivable.

jue
 
Reply With Quote
 
Jürgen Exner
Guest
Posts: n/a
 
      03-05-2010
Sherm Pendley <> wrote:
>Ben Morrow <> writes:
>
>> perldoc almost certainly *is* installed somewhere

>
>That's not necessarily true. Many Linux systems package perldoc
>and the various .pod files into a separate perl-dev or similar
>package.


Which actually makes sense because you need those only while
_dev_-eloping Perl code but not on any server that is running perl as a
utility.

jue
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a java.util.Scanner that works in 1.4.2 out there? Danno Java 2 04-26-2006 04:41 AM
Are there any Belkin router users out there? OM UK VOIP 12 10-04-2005 08:32 AM
is there a hardware / driver combination out there the lets win2k connect to the network before login?? christiane kewitz Wireless Networking 1 02-13-2005 01:08 AM
I am getting loads of spam by e-mail.Most of it is not even addressed to me so god knows how I am receiving it. Any ideas . Is there a spam guard available on blueyonder? How do I get it on my system if there is?Cheers GW Geoff/Elaine Computer Support 11 11-16-2004 11:17 PM
Are there any free .pdf writers out there Goonigoogoo Computer Support 5 11-22-2003 03:27 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57