Howto covert to Hash structure?

I

ipellew

Hi all;

Whats the fastest way to convert the likes of:-
it var=`A` list=who;loves;"me"
it list='D|"abc.htm"|Abc dynamite;B|xyz.htm|Here =go' var=C
it var=S list="Multi|S001|S103|Saxsoph
maybe;Mono|S84|S634|Pea=\"green\";|S011|S973|'Informix';";
it etc etc

To sumthing like:-
%HoH= {
it0 => {
val => {A1=>'who',
A1=>'loves',
A1=>'me'},
it1 => {
val => {C1=>'D',
C2=>'"abc.htm"',
C3=>'Abc dynamite'},
{C1=>'B',
C2=>'xyz.htm',
C3=>'Here =go'}},
it2 => {
val => {S1=>'Multi',
S2=>'S001',
S3=>'S103',
S4=>'Saxsoph maybe'},
{S1=>'Mono',
S2=>'S84',
S3=>'S634',
S4=>'Pea=green'},
{S1=>'',
S2=>'S011',
S3=>'S973',
S4=>'Informix'}}
it3 => etc
}

The quote variations are me trying to allow sysadmin loose choice of
defining the variables.
My skills are not good enough to get this to work in Perl.
Maybe theres a module that would do it for me?

Regards
Ian
 
J

Jim Keenan

Hi all;

Whats the fastest way to convert the likes of:-
it var=`A` list=who;loves;"me"
it list='D|"abc.htm"|Abc dynamite;B|xyz.htm|Here =go' var=C
it var=S list="Multi|S001|S103|Saxsoph
maybe;Mono|S84|S634|Pea=\"green\";|S011|S973|'Informix';";
it etc etc


My skills are not good enough to get this to work in Perl.

Then improve your skills by learning to use the documentation supplied
with Perl.

perldoc -f split

perldoc perlvar

perldoc perlreftut

etc.

Jim Keenan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top