abaxaba has asked for the wisdom of the Perl Monks concerning the following question:
That works okay, but I should be able to skip an assignment, and go straight through Add_Delta_Days with the map, like so:my @eDate=map{$cgi->param($_)}qw(eYear eMonth eDate); @eDate=Add_Delta_Days(@eDate,1);
Now, to me, that's but a simple replace, replacing @eDate in the original Add_Delta_Days call with my map, which originally defines @eDate. But Date::Calc throws this:my @eDate= Add_Delta_Days(map{$cgi->param($_)} qw(eYear eMonth eDate),1);
Usage: Date::Calc::Add_Delta_Days(year, month, day, Dd)
Soooo, I tried this:And explictly wrap the map in parens. It worked! Whats the difference, and thanks in advance for shedding the light!my @eDate=Add_Delta_Days((map{$cgi->param($_)}qw(eYear eMonth eDate)), +1);
| ÅßÅ×ÅßÅ
"It is a very mixed blessing to be brought back from the dead." -- Kurt Vonnegut |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: List context with map
by tachyon (Chancellor) on Nov 05, 2004 at 01:40 UTC | |
by ysth (Canon) on Nov 05, 2004 at 09:11 UTC | |
|
Re: List context with map
by VSarkiss (Monsignor) on Nov 05, 2004 at 03:35 UTC | |
|
•Re: List context with map
by merlyn (Sage) on Nov 05, 2004 at 08:08 UTC | |
by tachyon (Chancellor) on Nov 05, 2004 at 08:14 UTC | |
|
Re: List context with map
by NetWallah (Canon) on Nov 05, 2004 at 03:55 UTC |