Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: "Should be a simple thing" not going well for me

by sundialsvc4 (Monsignor)
on Nov 03, 2011 at 14:11 UTC ( #935670=note: print w/ replies, xml ) Need Help??


in reply to "Should be a simple thing" not going well for me

Try reading the POD.

/me nods ...

Unfortunately for the OP, BrowerUK’s admonition here is right on the mark.   Click on the link in this sentence to look at the search.cpan.org description of Date::Manip::Date, and you will see, at the very beginning of that page in the SYNOPSIS section, that the too-brief example code uses the module, then instantiates a new object.   Unfortunately the synopsis is not complete:   it does not tell you what to do next.

Objects like these are designed to be instantiated, and then to provide the service of parseing a date string, thus obtaining its value (or throwing an error), and to answer questions about the value, and to print the formatted value.

In a case like this, I find that sometimes the best source of “but how does it actually work?” information is to look at the test-library (a directory t) within the package subdirectory.   Here you will find code that is designed to work as well as code that is designed to fail in certain ways.   Perl runs all of these tests before installing the module permanently.   They can be an excellent source of information, usually written by the author himself.

P.S.:   “Simple things” never are.


Comment on Re: "Should be a simple thing" not going well for me

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://935670]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2014-08-30 15:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls