in reply to Re: Calculate date with days
in thread Calculate date with days

hie pg, i am totally new to perl. for the Data::Dumper, do i need to install this component or it is already included in the system? Cheers, Darren

Replies are listed 'Best First'.
Re^3: Calculate date with days
by pg (Canon) on Aug 24, 2005 at 05:42 UTC

    Data::Dumper is actually not needed, and it was just a handy way to display the result:

    use strict; use warnings; my $offset = 3; display(reverse((localtime(time()))[0 .. 5])); display(reverse((localtime(time() + 24 * 3600 * $offset))[0 .. 5])); sub display { my @t = @_; printf("%d-%02d-%02d-%02d:%02d:%02d\n", $t[0] + 1900, $t[1] + 1, @ +t[2 .. 5]); }
Re^3: Calculate date with days
by sk (Curate) on Aug 24, 2005 at 05:20 UTC
    Data::Dumper is a core perl Module i.e. should come with Perl. Check the link to see more information about it.

    A simple use case

    #!/usr/bin/perl use Data::Dumper; use strict; use warnings; my @list = qw (hi there); print Dumper(@list);

    Output

    $VAR1 = 'hi'; $VAR2 = 'there';