Loading ...
Sorry, an error occurred while loading the content.

Needed Help in writing contents of a file to a hash in perl

Expand Messages
  • vivek_pcte
    Hi All, I am new to perl. I want to solve the following problem in perl. I know how to parse the file and split it using any delimiter but i am not getting how
    Message 1 of 9 , Apr 8 9:40 PM
    • 0 Attachment
      Hi All,

      I am new to perl.
      I want to solve the following problem in perl.

      I know how to parse the file and split it using any delimiter but i am
      not getting how to write it to hash on the fly.

      can anybody help me with it.

      Please send it to my email: vivek_malhotra@...

      Problem:
      Write a program that reads a file with two fields. The first field is
      a customer ID and the second field is the customer name. Use the !
      character as a separator between the fields. Store the information
      into a hash with the customer id as the key and the customer name as
      the value.
    • merlyn@stonehenge.com
      ... vivek Problem: vivek Write a program that reads a file with two fields. The first field is vivek a customer ID and the second field is the customer
      Message 2 of 9 , Apr 8 10:41 PM
      • 0 Attachment
        >>>>> "vivek" == vivek pcte <vivek_malhotra@...> writes:

        vivek> Problem:
        vivek> Write a program that reads a file with two fields. The first field is
        vivek> a customer ID and the second field is the customer name. Use the !
        vivek> character as a separator between the fields. Store the information
        vivek> into a hash with the customer id as the key and the customer name as
        vivek> the value.

        No. We're not helping you cheat by solving your homework for you.
        Shame on you.

        --
        Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
        <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
        Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
        See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
      • vivek_pcte
        Its not my homework u bleddy moron.. I was just stucked in lot of work, so cudn t find so much info.. U mother fuker I m a sftwr proffessional not a student..
        Message 3 of 9 , Apr 8 11:00 PM
        • 0 Attachment
          Its not my homework u bleddy moron..

          I was just stucked in lot of work, so cudn't find so much info..

          U mother fuker I m a sftwr proffessional not a student..

          I will find it when I get time..

          Then will shouw u the fucking..

          Go to hell ass hole..



          --- In perl-beginner@yahoogroups.com, merlyn@... wrote:
          >
          > >>>>> "vivek" == vivek pcte <vivek_malhotra@...> writes:
          >
          > vivek> Problem:
          > vivek> Write a program that reads a file with two fields. The first
          field is
          > vivek> a customer ID and the second field is the customer name. Use
          the !
          > vivek> character as a separator between the fields. Store the
          information
          > vivek> into a hash with the customer id as the key and the customer
          name as
          > vivek> the value.
          >
          > No. We're not helping you cheat by solving your homework for you.
          > Shame on you.
          >
          > --
          > Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503
          777 0095
          > <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
          > Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
          > See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
          training!
          >
        • Kalyan Raj
          Mr.Vivek, As you mentioned that you re a software professional and working in a good reputed organisation Persistant systems. This is a forum which helps lot
          Message 4 of 9 , Apr 8 11:08 PM
          • 0 Attachment
            Mr.Vivek,

            As you mentioned that you're a software professional and working in a good reputed organisation Persistant systems.

            This is a forum which helps lot of people in resolving the problems and this is not the way to express your feeling in a foul language.

            Be a professional and Is it the way you behave with your manager if he says the same thing. if so, think where you will be...


            vivek_pcte <vivek_malhotra@...> wrote: Its not my homework u bleddy moron..

            I was just stucked in lot of work, so cudn't find so much info..

            U mother fuker I m a sftwr proffessional not a student..

            I will find it when I get time..

            Then will shouw u the fucking..

            Go to hell ass hole..

            --- In perl-beginner@yahoogroups.com, merlyn@... wrote:
            >
            > >>>>> "vivek" == vivek pcte <vivek_malhotra@...> writes:
            >
            > vivek> Problem:
            > vivek> Write a program that reads a file with two fields. The first
            field is
            > vivek> a customer ID and the second field is the customer name. Use
            the !
            > vivek> character as a separator between the fields. Store the
            information
            > vivek> into a hash with the customer id as the key and the customer
            name as
            > vivek> the value.
            >
            > No. We're not helping you cheat by solving your homework for you.
            > Shame on you.
            >
            > --
            > Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503
            777 0095
            > <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
            > Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
            > See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
            training!
            >





            __________________________________________________
            Do You Yahoo!?
            Tired of spam? Yahoo! Mail has the best spam protection around
            http://mail.yahoo.com

            [Non-text portions of this message have been removed]
          • vivek_pcte
            YEs that is true.. but he also used wrong words first, as he said me cheat, shame on you and all that stupid stuff... if anybody does not knw answer he shd not
            Message 5 of 9 , Apr 9 3:14 AM
            • 0 Attachment
              YEs that is true..

              but he also used wrong words first, as he said me cheat, shame on you
              and all that stupid stuff...

              if anybody does not knw answer he shd not reply...

              i just replied him back...





              --- In perl-beginner@yahoogroups.com, Kalyan Raj <kalyanraj55@...> wrote:
              >
              > Mr.Vivek,
              >
              > As you mentioned that you're a software professional and working in
              a good reputed organisation Persistant systems.
              >
              > This is a forum which helps lot of people in resolving the problems
              and this is not the way to express your feeling in a foul language.
              >
              > Be a professional and Is it the way you behave with your manager if
              he says the same thing. if so, think where you will be...
              >
              >
              > vivek_pcte <vivek_malhotra@...> wrote:
              Its not my homework u bleddy moron..
              >
              > I was just stucked in lot of work, so cudn't find so much info..
              >
              > U mother fuker I m a sftwr proffessional not a student..
              >
              > I will find it when I get time..
              >
              > Then will shouw u the fucking..
              >
              > Go to hell ass hole..
              >
              > --- In perl-beginner@yahoogroups.com, merlyn@ wrote:
              > >
              > > >>>>> "vivek" == vivek pcte <vivek_malhotra@> writes:
              > >
              > > vivek> Problem:
              > > vivek> Write a program that reads a file with two fields. The first
              > field is
              > > vivek> a customer ID and the second field is the customer name. Use
              > the !
              > > vivek> character as a separator between the fields. Store the
              > information
              > > vivek> into a hash with the customer id as the key and the customer
              > name as
              > > vivek> the value.
              > >
              > > No. We're not helping you cheat by solving your homework for you.
              > > Shame on you.
              > >
              > > --
              > > Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503
              > 777 0095
              > > <merlyn@> <URL:http://www.stonehenge.com/merlyn/>
              > > Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
              > > See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
              > training!
              > >
              >
              >
              >
              >
              >
              > __________________________________________________
              > Do You Yahoo!?
              > Tired of spam? Yahoo! Mail has the best spam protection around
              > http://mail.yahoo.com
              >
              > [Non-text portions of this message have been removed]
              >
            • David Francos (XayOn)
              ... First of all, read the nettiquete, this is top-posting. After that, stop talking like this, non-native english speakers (like me) won t understand you. ...
              Message 6 of 9 , Apr 9 5:18 AM
              • 0 Attachment
                vivek_pcte wrote:
                >
                > YEs that is true..
                >
                > but he also used wrong words first, as he said me cheat, shame on you
                > and all that stupid stuff...
                >
                > if anybody does not knw answer he shd not reply...
                >
                > i just replied him back...

                First of all, read the nettiquete, this is top-posting.
                After that, stop talking like this, non-native english speakers (like
                me) won't understand you.

                >
                > --- In perl-beginner@yahoogroups.com, Kalyan Raj <kalyanraj55@...> wrote:
                > >
                > > Mr.Vivek,
                > >
                > > As you mentioned that you're a software professional and working in
                > a good reputed organisation Persistant systems.
                > >
                > > This is a forum which helps lot of people in resolving the probl
                >
                > ems
                > and this is not the way to express your feeling in a foul language.
                > >
                > > Be a professional and Is it the way you behave with your manager if
                > he says the same thing. if so, think where you will be...
                > >
                > >
                > > vivek_pcte <vivek_malhotra@...> wrote:
                > Its not my homework u bleddy moron..
                > >
                > > I was just stucked in lot of work, so cudn't find so much info..
                > >
                > > U mother fuker I m a sftwr proffessional not a student..
                > >
                > > I will find it when I get time..
                > >
                > > Then will shouw u the fucking..
                > >
                > > Go to hell ass hole..
                Finally, you're idiot, you think you're the best or something?
                Why, if you need help, are you talking us like this.
                It's usual to see people right here asking about "homeworks" in perl,
                and you seemed to be one of them, mainly because of your speech.
                Ask right, you'll get right answers

                > > --- In perl-beginner@yahoogroups.com, merlyn@ wrote:
                > > >
                > > > >>>>> "vivek" == vivek pcte <vivek_malhotra@> writes:
                > > >
                > > > vivek> Problem:
                > > > vivek> Write a program that reads a file with two fields. The first
                > > field is
                > > > vivek> a customer ID and the second field is the customer name. Use
                > > the !
                > > > vivek> character as a separator between the fields. Store the
                > > information
                > > > vivek> into a hash with the customer id as the key and the customer
                > > name as
                > > > vivek> the value.

                You sould start trying with split, I mean, splitting things into an
                array, and using that array to create the hash.

                > > > No. We're not helping you cheat by solving your homework for you.
                > > > Shame on you.
              • Jenda Krynicky
                From: vivek_pcte ... You have been killfiled. I ve instructed my mail client to send your emails to the trashbin
                Message 7 of 9 , Apr 9 4:30 PM
                • 0 Attachment
                  From: "vivek_pcte" <vivek_malhotra@...>
                  > Its not my homework u bleddy moron..
                  >
                  > I was just stucked in lot of work, so cudn't find so much info..
                  >
                  > U mother fuker I m a sftwr proffessional not a student..
                  >
                  > I will find it when I get time..
                  >
                  > Then will shouw u the fucking..
                  >
                  > Go to hell ass hole..

                  You have been killfiled. I've instructed my mail client to send your
                  emails to the trashbin automaticaly and I suggest everyone else does
                  the same. No need to reply, your swearing will not be heard.

                  This is not how you should behave in here and only the problems
                  yahoogroups.com has at the moment prevented me from baning you from
                  the group immediately.

                  Jenda
                  ===== Jenda@... === http://Jenda.Krynicky.cz =====
                  When it comes to wine, women and song, wizards are allowed
                  to get drunk and croon as much as they like.
                  -- Terry Pratchett in Sourcery
                • merlyn@stonehenge.com
                  ... Jenda This is not how you should behave in here and only the problems Jenda yahoogroups.com has at the moment prevented me from baning you from Jenda
                  Message 8 of 9 , Apr 9 4:56 PM
                  • 0 Attachment
                    >>>>> "Jenda" == Jenda Krynicky <Jenda@...> writes:

                    Jenda> This is not how you should behave in here and only the problems
                    Jenda> yahoogroups.com has at the moment prevented me from baning you from
                    Jenda> the group immediately.

                    Thank you.

                    Shakespeare wrote "methinks the lady doth protest too much",
                    or in simpler terms, "I struck a nerve".

                    As in, there would not have been this kind of reaction had I been completely
                    incorrect in my assessment. So I'm feeing rather vindicated here, although
                    y'all can certainly have your own opinion.

                    --
                    Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
                    <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
                    Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
                    See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
                  • Mike Southern
                    ... That was no lady ...
                    Message 9 of 9 , Apr 9 5:44 PM
                    • 0 Attachment
                      On 4/9/08 7:56 PM, merlyn@... at merlyn@... wrote:

                      > Shakespeare wrote "methinks the lady doth protest too much",

                      That was no lady ...
                    Your message has been successfully submitted and would be delivered to recipients shortly.