dev > perl
document updated 10 years ago, on Feb 20, 2012

Ways to quickly pretty-print ALL information that's within a type.


print $obj->datetime;

Example output:


print $obj->strftime("%F %r");

Example output:

2011-09-07 07:20:19 PM


print Dumper { $obj->deltas };

Example output:

$VAR1 = {
          'seconds' => 49,
          'minutes' => 466,
          'nanoseconds' => 0,
          'days' => 3,
          'months' => 0

Or, normalized:     ("We cannot convert between these units, because there is no fixed conversion between the two units")

print DateTime::Format::Duration->new(pattern => "%p %F %r", normalise => 1)->format_duration($obj);

Example output:

+ 0000-00-03 08:14:36


print $cookie_jar->as_string;

Example output:

Set-Cookie3: ASP.NET_SessionId=m0fqx155kdo20svot0dqczy3; path="/";; path_spec; secure; discard; HttpOnly; version=0
Set-Cookie3: NSC_XJ_10.0.40.69_443_mcwjq=44531629378b; path="/";; path_spec; discard; version=0
Set-Cookie3: WINGDevice="\"\""; path="/Citrix/XenApp/";; path_spec; secure; expires="2013-02-20 19:01:30Z"; HttpOnly; version=0
Set-Cookie3: WINGSession="\"\""; path="/Citrix/XenApp/";; path_spec; secure; discard; HttpOnly; version=0