I can say that a Python tuple is analogous to a Perl list, not a Perl array (a Python list is what we Perl folk call an array). As for converting complex data structures ... well ... Perl is not really that much different from Python, at least it doesn't have to be:
Python:
thingy = [ { 'artist' : 'Genesis', 'genre' : ['pop','rock','progressive'], 'albums' : [ { 'title' : 'Foxtrot', 'year' : 1972 }, { 'title' : 'Duke', 'year' : 1980 }, { 'title' : 'Genesis', 'year' : 1983 }, ], }, ]
Perl:
We can help you convert Python code to Perl, but i doubt you'll get much help from us converting Perl code to Python. ;)$thingy = [ { artist => 'Genesis', genre => [qw(pop rock progressive)], albums => [ { title => 'Foxtrot', year => 1972 }, { title => 'Duke', year => 1980 }, { title => 'Genesis', year => 1983 }, ], }, ];
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to (jeffa) Re: Converting Python to Perl and back again
by jeffa
in thread Converting Python to Perl and back again
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |