Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTTP::Date - Only first two functions exported by default

Status
Not open for further replies.

Tarnish

Technical User
Joined
Nov 13, 2006
Messages
221
Location
US
Hi all,

I'm trying to use the HTTP::Date module which I believe is a part of the lib package. I believe I've properly installed the lib and I've tested a little code using one of the functions from HTTP::Date and it seems to work.

However, the function I tested was one of the first two functions in the documentation, and the documentation also says this:

"This module provides functions that deal the date formats used by the HTTP protocol (and then some more). Only the first two functions, time2str() and str2time(), are exported by default."

I need to use a function in the module that is NOT one of those first two functions listed above. What does it mean that the function I need 'isn't exported by default'? How do I get access to it?

Thanks,
Tarnish
 
After a trillion searches, I finally found the answer. I needed to add this to the top of my code:

use HTTP::Date qw(parse_date);

Maybe that will help someone else in the future.

Thanks,
Tarnish
 
It's all documented on perldoc -f use (or man perlfunc and search for "use").

Annihilannic.
 
If you wanted to use it without importing it, you could do, for example:
Code:
my $parsed_date = HTTP::Date::parse_date( $raw_date );
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top