in reply to Converting Python to Perl and back again
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)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (jeffa) Re: Converting Python to Perl and back again
by Anonymous Monk on Apr 04, 2003 at 06:43 UTC | |
by jeffa (Bishop) on Apr 04, 2003 at 13:32 UTC | |
|
Re: (jeffa) Re: Converting Python to Perl and back again
by Anonymous Monk on Apr 04, 2003 at 08:01 UTC | |
by jeffa (Bishop) on Apr 04, 2003 at 13:48 UTC | |
by Anonymous Monk on Apr 04, 2003 at 19:50 UTC | |
|
Re: (jeffa) Re: Converting Python to Perl and back again
by Anonymous Monk on Apr 04, 2003 at 19:52 UTC |