469,927 Members | 1,867 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

Better perl docs?


This isn't meant as flame fodder ...

Are there perl docs available anywhere on a par with the Javadocs on
Sun's site for example?

For instance, I am writing a script which needs date/time
functionality. I am using perldoc.com to try to find out what I have
available and how it works, so I found the Time::localtime package
docs here

http://www.perldoc.com/perl5.8.0/lib...localtime.html

(I know localtime() doesn't necessarily need the wrapper class, but
just for example ... )

It doesn't really tell me much, not as much as I need, anyway. What
are the members of the class? What are the methods? Two methods are
mentioned in passing ... apparently there's a localtime->year()
method, but what other methods are available? year() appears to
return a centuryless year, are there other methods that return a year
with century?

In this particular case I can probably guess my way through it; I
need to build a string of the form YYYYMMDD so I guess month will be a
month() method and date will be a day() or date() method, but a
comprehensive list of the class methods and members ala Javadocs would
definitely be nice ...

I am somewhat new to Perl, I have programmed with it in the past but
not comprehensively, mostly just to alter or fix existing code, so if
this is newbie stuff I apologize

--
Joe Cosby
http://users.zhonka.net/joecosby/
"Evil is a dunghill, Mr. Angel. Everybody climbs up on theirs to
speak out against somebody else's"
- Satan

Jul 19 '05 #1
6 3379
Joe Cosby wrote:
This isn't meant as flame fodder ...

Are there perl docs available anywhere on a par with the Javadocs on
Sun's site for example?
Check out the Perl Cookbook. It's one of the O'Reilly books. Not sure
if it's available on line.

In this particular case I can probably guess my way through it; I
need to build a string of the form YYYYMMDD so I guess month will be a
month() method and date will be a day() or date() method, but a
comprehensive list of the class methods and members ala Javadocs would
definitely be nice ...

perldoc -f localtime

To do that, the easiest way would be something like:
my $yyyymmdd = sprintf("%04d%02d%02d", (localtime(time))[5] + 1900,
(localtime(time))[4], (localtime(time))[3]);
Jul 19 '05 #2
Joe Cosby wrote:
This isn't meant as flame fodder ...

Are there perl docs available anywhere on a par with the Javadocs on
Sun's site for example?
Check out the Perl Cookbook. It's one of the O'Reilly books. Not sure
if it's available on line.

In this particular case I can probably guess my way through it; I
need to build a string of the form YYYYMMDD so I guess month will be a
month() method and date will be a day() or date() method, but a
comprehensive list of the class methods and members ala Javadocs would
definitely be nice ...

perldoc -f localtime

To do that, the easiest way would be something like:
my $yyyymmdd = sprintf("%04d%02d%02d", (localtime(time))[5] + 1900,
(localtime(time))[4], (localtime(time))[3]);
Jul 19 '05 #3
Joe Cosby wrote:
This isn't meant as flame fodder ...

Are there perl docs available anywhere on a par with the Javadocs on
Sun's site for example?
Check out the Perl Cookbook. It's one of the O'Reilly books. Not sure
if it's available on line.

In this particular case I can probably guess my way through it; I
need to build a string of the form YYYYMMDD so I guess month will be a
month() method and date will be a day() or date() method, but a
comprehensive list of the class methods and members ala Javadocs would
definitely be nice ...

perldoc -f localtime

To do that, the easiest way would be something like:
my $yyyymmdd = sprintf("%04d%02d%02d", (localtime(time))[5] + 1900,
(localtime(time))[4], (localtime(time))[3]);
Jul 19 '05 #4
Joe Cosby wrote:
For instance, I am writing a script which needs date/time
functionality. I am using perldoc.com to try to find out what I
have available and how it works, so I found the Time::localtime
package docs here

http://www.perldoc.com/perl5.8.0/lib...localtime.html

(I know localtime() doesn't necessarily need the wrapper class, but
just for example ... )

It doesn't really tell me much, not as much as I need, anyway.
What are the members of the class? What are the methods? Two
methods are mentioned in passing ... apparently there's a
localtime->year() method, but what other methods are available?
year() appears to return a centuryless year, are there other
methods that return a year with century?
Well, the quality of the Perl module docs varies, and the docs for the
Time::localtime module is apparently not one of the better.
In this particular case I can probably guess my way through it; I
need to build a string of the form YYYYMMDD


If that's all there is, personally I would probably have done it
without using a module, i.e. something like Will's suggestion. Another
option is to explore another module, such as Time::Format.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

Jul 19 '05 #5
On Sun, 21 Mar 2004 22:47:56 GMT, Gunnar Hjalmarsson
<no*****@gunnar.cc> wrote:
Joe Cosby wrote:
For instance, I am writing a script which needs date/time
functionality. I am using perldoc.com to try to find out what I
have available and how it works, so I found the Time::localtime
package docs here

http://www.perldoc.com/perl5.8.0/lib...localtime.html

(I know localtime() doesn't necessarily need the wrapper class, but
just for example ... )

It doesn't really tell me much, not as much as I need, anyway.
What are the members of the class? What are the methods? Two
methods are mentioned in passing ... apparently there's a
localtime->year() method, but what other methods are available?
year() appears to return a centuryless year, are there other
methods that return a year with century?


Well, the quality of the Perl module docs varies, and the docs for the
Time::localtime module is apparently not one of the better.
In this particular case I can probably guess my way through it; I
need to build a string of the form YYYYMMDD


If that's all there is, personally I would probably have done it
without using a module, i.e. something like Will's suggestion. Another
option is to explore another module, such as Time::Format.


Thanks, like I say I know I could just use the localtime() perl
function, I'm just trying to get the hang of the day to day of working
with perl.

Having a list of a class's functions and members is very useful, it's
a pity there isn't something comparable. Docs make all the difference
in a language.

--
Joe Cosby
http://users.zhonka.net/joecosby/
"Mind control is being able to make all the voices in your head take
turns." (from alt.slack)

Jul 19 '05 #6
Joe Cosby wrote:
Thanks, like I say I know I could just use the localtime() perl
function, I'm just trying to get the hang of the day to day of working
with perl.

Having a list of a class's functions and members is very useful, it's
a pity there isn't something comparable. Docs make all the difference
in a language.

Just like in Java, the QUALITY of the documentation will vary. My
experience is that by and large, the doc for the more widely-used (by
nature) is going to be quite good. In the case of Time::localtime,
there's not much doc on it because it's just an OO interface to the
already widely-used localtime function family (localtime, gmtime, etc.)

And if you're just trying to find out HOW to do a particular chore, the
Perl Cookbook is quite valuable. Otherwise, MOST of the modules have
far better documentation.
Jul 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

220 posts views Thread by Brandon J. Van Every | last post: by
14 posts views Thread by Xah Lee | last post: by
6 posts views Thread by timh | last post: by
4 posts views Thread by Radek G. | last post: by
385 posts views Thread by Xah Lee | last post: by
3 posts views Thread by Paul Mc Gee | last post: by
8 posts views Thread by Tom Allison | last post: by
4 posts views Thread by John K Masters | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.