472,353 Members | 1,656 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

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 3454
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

220
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's...
14
by: Xah Lee | last post by:
Just bumped into another irresponsibility in perl. the crime in question this time is the module File::Basename. Reproduction: 1. create a...
6
by: timh | last post by:
Hello group, I'm interested in starting to learn Perl and CGI. I'm not having any problems with that. However, setting everything up is not clear...
4
by: Radek G. | last post by:
Hello I must implemend sorting in perl (that's not too dificult;) ) but...i must sort some array with grouping (like in sql). I meen... For...
385
by: Xah Lee | last post by:
Jargons of Info Tech industry (A Love of Jargons) Xah Lee, 2002 Feb People in the computing field like to spur the use of spurious jargons....
3
by: Paul Mc Gee | last post by:
hi everyone i have just downloaded the latest version of postgresql and was doing the installation according to the article at...
8
by: Tom Allison | last post by:
I'm used to using the DBI modules in perl. The online docs mention DBD as expiremental. I'm thinking of sticking with DBI, unless there's some...
4
by: John K Masters | last post by:
I am currently working my way through Jeffrey Friedl's book Mastering Regular Expressions. Great book apart from the fact it uses Perl for the...
1
by: houh | last post by:
I have a java app that generates openoffice docs. When I run the java app in a shell script, as: export...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.