in reply to Evil Interview Questions
Pass. Though I was not too sure about the "for x map" one.
I'd probably respond that map in void context is not a good idea, because it's simply not what the function was supposed to mean and that I'm not sure whether it would provide the same context to the function, whether the void context of the map propagates into the block.
I think it would be better to check ask what does
print. I bet a lot of people would respond that it would print three lines with formatted dates 1970-01-01 with slightly different times.my @dates = map {localtime($_)} (0,1000,2000); print join("\n", @dates);
Update: erm. Oops. Thanks zby, it was not supposed to be there, I just added it when testing and forgot to remove it again.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Evil Interview Questions
by zby (Vicar) on Feb 09, 2008 at 07:30 UTC |