in reply to Python dict to perl hash
use strict; use warnings; use Inline Python => <<'EOP'; def rot13(): return dict({ 'a':'n', 'b':'o', 'c':'p', 'd':'q', 'e':'r', 'f':'s', 'g':'t', + 'h':'u', 'i':'v', 'j':'w', 'k':'x', 'l':'y', 'm':'z', 'n':'a', 'o':'b', + 'p':'c', 'q':'d', 'r':'e', 's':'f', 't':'g', 'u':'h', 'v':'i', 'w':'j', + 'x':'k', 'y':'l', 'z':'m', 'A':'N', 'B':'O', 'C':'P', 'D':'Q', 'E':'R', + 'F':'S', 'G':'T', 'H':'U', 'I':'V', 'J':'W', 'K':'X', 'L':'Y', 'M':'Z', + 'N':'A', 'O':'B', 'P':'C', 'Q':'D', 'R':'E', 'S':'F', 'T':'G', 'U':'H', + 'V':'I', 'W':'J', 'X':'K', 'Y':'L', 'Z':'M'}) EOP my $hash = rot13 ();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Python dict to perl hash
by LanX (Saint) on Mar 31, 2015 at 15:48 UTC |