http://www.perlmonks.org?node_id=994244

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi please find below for the code.I am taking a date and getting the next three dates.Also i am assigning all these to a hash table and printing it

use Data::Dumper; use Date::Simple; #initializing the variable $a[0]="2012-08-16"; $i=1; $dateplus=$a[0]; #Getting next 3 dates while($i<=3) { $dateplus = Date::Simple->new($dateplus); $dateplus++; $a[$i]=$dateplus; $i++; } #-----Saving the next week dates in a hash table---------- %datesofnextWeek_var1 = ( "1" => ["Sunday",$a[0]], "2" => ["Monday",$a[1]], "3" => ["Tuesday",$a[2]], "4" => ["Wednesday",$a[3]], ); print Dumper %datesofnextWeek_var1; @test=@{$datesofnextWeek_var1{2}}; print $test[1];

For print Dumper %datesofnextWeek_var1; m getting $a1,$a2 etc as bless( do{\(my $o = 15570)}, 'Date::Simple' ) but $a[0] is coming properly. Also from hashtable if m taking values i wil get it properly.Thr problem is while printing the entire hashtable.Please help.If you have any confusion in my question u can run the above mentioned code.Then it will be clear