473,583 Members | 3,435 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3504
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%0 2d%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%0 2d%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%0 2d%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::localtim e 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
18932
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 answers. I don't know beans about Ruby or have any preconceived ideas about it. I have noticed, however, that every programmer I talk to who's aware of Python is also talking about Ruby. So it...
14
2560
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 directory containing a file of this name: "cdrom.html". 2. "use File::Basename;", with the line: ($name,$path,$suffix) = fileparse($File::Find::name, ('.html', '.m'));
6
2302
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 to me. What should I do to run my CGI scripts on my computer, with my browser. I need to be able to run these CGI scripts on my own browser, so I can test what I'm doing. I'm not interested in...
4
6067
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 Example I have array with first and last names: @names= ('a a','a b','a c',' b b', 'b d' ). And i must sort it first by first name from 'z' to 'a' and by last name from 'a' to 'z'. so after sorting i...
385
17051
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. The less educated they are, the more they like extraneous jargons, such as in the Unix & Perl community. Unlike mathematicians, where in mathematics there are no fewer jargons but each and every...
3
1697
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 http://www.faqs.org/docs/ppbook/x486.htm when i got to the point where the perl and python modules are to be installed. the distribution used in that article is an older version of postgresql and i cant seem to find...
8
341
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 compelling reason to do otherwise. ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail...
4
1481
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 examples. One particular expression that interests me is '$/ = ".\n"' which, rather than splitting a file into lines, splits on a period-newline boundary. Combined with Perl's 'while (<>)' construct...
1
1971
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 JAVA_HOME=/opt/corp/projects/metrics/Java/jdk1.5.0_07/bin/java export CONST_LOC=/home/methct/metrics/MGConfig/staging_8103.xml $JAVA_HOME view.main.MetricsMainFrame $CONST_LOC I can close the openoffice doc that are generated by the...
0
7893
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7821
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8172
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8188
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6574
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5695
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5369
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3813
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2326
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.