Howto covert to Hash structure?

Discussion in 'Perl Misc' started by ipellew@pipemedia.co.uk, Dec 21, 2004.

  1. Guest

    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
    , Dec 21, 2004
    #1
    1. Advertising

  2. Jim Keenan Guest

    wrote:
    > 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



    > [snip]



    > 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
    Jim Keenan, Dec 21, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    4
    Views:
    479
    Andrew Thompson
    Jul 29, 2005
  2. =?Utf-8?B?aGVuaw==?=

    Covert UTC String to UTC Datetime

    =?Utf-8?B?aGVuaw==?=, May 7, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    18,702
    Egbert Nierop \(MVP for IIS\)
    May 7, 2006
  3. Morgan Cheng
    Replies:
    4
    Views:
    616
    Morgan Cheng
    Dec 17, 2004
  4. Jim Florence
    Replies:
    3
    Views:
    6,786
    Ken Cox [Microsoft MVP]
    Jun 25, 2006
  5. rp
    Replies:
    1
    Views:
    491
    red floyd
    Nov 10, 2011
Loading...

Share This Page