in reply to Re^2: Hash creation
in thread Hash creation

A few points:

Here's the code

use strict; use warnings; use Data::Dumper; my @inputFields = ( q{Requester Email:fredb@big.com}, q{Project Manager Name:Fred Bloggs}, ); my %inputs = map { split m{:} } @inputFields; my $defRef = { requester_email => $inputs{ q{Requester Email} }, requester_name => $inputs{ q{Project Manager Name} }, }; print Data::Dumper->Dumpxs( [ \ @inputFields, \ %inputs, $defRef ], [ qw{*inputFields *inputs defRef} ], );

and here's the output

@inputFields = ( 'Requester Email:fredb@big.com', 'Project Manager Name:Fred Bloggs' ); %inputs = ( 'Requester Email' => 'fredb@big.com', 'Project Manager Name' => 'Fred Bloggs' ); $defRef = { 'requester_name' => 'Fred Bloggs', 'requester_email' => 'fredb@big.com' };

I hope this is helpful.

Cheers,

JohnGG