in reply to Re: Help with making a string into a hash
in thread Help with making a string into a hash

Thanks again guys.. here is a working program.. now I can finally access the data easily.
#!/usr/bin/perl -w use strict; use warnings; use Data::Dumper; my $input; #my $1i; my %luahash = (); my @temp; unless (open (FILE,"CharacterProfiler.lua")) { print "Unable to open file."; exit; } my @ainput = <FILE>; 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; my $temp = '(' . $input . ')'; %luahash = eval($temp); exit;