#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my $input; my %luahash = (); my @temp; unless (open (FILE,"CharacterProfiler.lua")) { print "Unable to open file."; exit; } my@ainput = ; close FILE; $input = join("", @ainput); $input =~ s/\[\"(\w+)\"\]/\"$1\"/g; $input =~ s/=/=\>/g; $input =~ s/(\[)(\d|\d\d)(\])/"$2"/g; $input =~ s/(\d+|\d+\.\d+),/"$1",/g; $input =~ s/(\w+) =\> \{/"$1" => \(/g; $input =~ s/(true|false)/"$1"/ig; $input =~ s/\}\,\n$/\}/; $input =~ s/\n\}\n/\n\)\n/g; @temp = split(/\n\)\n/,$input); my $inx = 0; foreach (@temp) { $temp[$inx++] .= "\n)"; } $temp[0] =~ s/\"\w+\"\s=\>\s\(/\(/; %luahash = eval($temp[0]); print Dumper(%luahash);