in reply to Re: variable list assignment
in thread variable list assignment
update just tried mr robot's solution and found, to my surprise, that the double curlies aren't required. I would have expected
Actually, you missed a comma that impossiblerobot's code contained. His code was:
my @record = map { bytes => $_ }, get_bytes($num);and that comma between the arguments to map makes map interpret the first argument as an EXPR not a BLOCK.
BTW, my perl (5.6.1) chokes on the code in your update:
perl -e '@a = map {k => $_} (1..3)' syntax error at -e line 1, near "}("
-sauoq "My two cents aren't worth a dime.";
|
|---|