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

Re: [PBML] Hashes

Expand Messages
  • Mike Southern
    ... Maybe a better way is not to work on the code, but work on the data-flow. What are you doing with the 25 mil records ... and could you refine your search
    Message 1 of 6 , Mar 2, 2004
    • 0 Attachment
      At 03/02/2004, you wrote:
      >Hello All,
      > I am fetching data from oracle database using select statement. Once I
      >fetch, I am putting the required fields into key and auto incrementing the
      >value something like $unq{$year."|".$month}++. Later I am retreving the data
      >from the hash using foreach loop. Its working fine for small output, but
      >my output from the select statement is about 25 million..Yes.. You read it
      >correctly..25 million records..so my foreach loop is not printing the values
      >what I expected, instead its printing some binary characters like
      >2|STGo1wvs7T-204Q|. I can tune my select statement using count(*) and group
      >by function,, but I get this error
      >DBD::Oracle::st execute failed: ORA-01652: unable to extend temp segment by
      >18206 in tablespace and I don't have permissions to modify Oracle database
      >config.
      >So can someone suggest my how to go about this or any other better method of
      >processing huge files. I am using perl 5.6.1 on SunOS 5.6 Generic_105181-23
      >sun4u sparc SUNW,Ultra-Enterprise
      >Thanks in advance
      >Krishna.

      Maybe a better way is not to work on the code, but work on the data-flow.
      What are you doing with the 25 mil records ... and could you refine your
      search so the result is less records with a more select target. Or limit
      the selection to groups of several thousand for processing.

      "What are you trying to process". That may be the key to an efficient
      method of processing it.
    • rohitgole2003
      hi, I have some problem in printing a hash.... problem is :I have a hash which contains two keys and one of the key has an array element and the element of
      Message 2 of 6 , Jun 26, 2005
      • 0 Attachment
        hi,

        I have some problem in printing a hash....

        problem is :I have a hash which contains two keys and one of the key
        has an array element and the element of array is again a hash and "I
        want to access that hash value"

        please sort out the problem and send me the answer




        rohit singh gole
        BSBE ,IIT Kanpur
      • Charles K. Clarkson
        ... Use Data::Dumper for printing complex data structures. ... No. This is not a help desk. Instead, you show us some code and we ll help you fix that code. Or
        Message 3 of 6 , Jun 26, 2005
        • 0 Attachment
          rohitgole2003 <> wrote:
          :
          : I have some problem in printing a hash....

          Use Data::Dumper for printing complex data structures.


          : please sort out the problem and send me the answer

          No. This is not a help desk. Instead, you show us some code
          and we'll help you fix that code. Or you ask a general question
          and we answer with a general reply. In most circumstances answers
          go to the list, not to you.


          HTH,

          Charles K. Clarkson
          --
          Mobile Homes Specialist
          254 968-8328
        • Sudharsanam Dhamodharan
          Hi Rohit, Here is a sample program that prints the elements of the hash of array of hashes. Hope this will help you. %HoAoH = ( flintstones = [ { husband =
          Message 4 of 6 , Jun 28, 2005
          • 0 Attachment
            Hi Rohit,

            Here is a sample program that prints the elements of the hash of array of
            hashes. Hope this will help you.


            %HoAoH = (
            flintstones => [
            {
            husband => "barney",
            wife => "betty",
            son => "bamm bamm",
            },
            {
            husband => "george",
            wife => "jane",
            son => "elroy",
            },

            {
            husband => "homer",
            wife => "marge",
            son => "bart",
            },
            ],
            jetsons => [ "george", "jane", "elroy" ],
            simpsons => [ "homer", "marge", "bart" ],

            );
            foreach $family (keys %HoAoH)
            {
            foreach $member (0 .. $#{ $HoAoH{$family} } )
            {
            print "Elements of hash of array = $HoAoH{$family}[$member]"."\n"; #
            printing the elements of hash of arrays
            foreach $role (keys %{${$HoAoH{$family}}[$member]} )
            {

            print "Elements of Hash of Array of Hashes =
            $HoAoH{$family}[$member]->{$role}"; # printing elements of hash of array of
            hashes
            print "\n";
            }

            }
            print "\n";
            }

            Thanks,

            Sudharsanam.


            On 6/26/05, rohitgole2003 <rohitgole2003@...> wrote:
            >
            > hi,
            >
            > I have some problem in printing a hash....
            >
            > problem is :I have a hash which contains two keys and one of the key
            > has an array element and the element of array is again a hash and "I
            > want to access that hash value"
            >
            > please sort out the problem and send me the answer
            >
            >
            >
            >
            > rohit singh gole
            > BSBE ,IIT Kanpur
            >
            >
            >
            >
            >
            >
            > Unsubscribing info is here:
            > http://help.yahoo.com/help/us/groups/groups-32.html
            >
            >
            > ------------------------------
            > *Yahoo! Groups Links*
            >
            > - To visit your group on the web, go to:
            > http://groups.yahoo.com/group/perl-beginner/
            > - To unsubscribe from this group, send an email to:
            > perl-beginner-unsubscribe@yahoogroups.com<perl-beginner-unsubscribe@yahoogroups.com?subject=Unsubscribe>
            > - Your use of Yahoo! Groups is subject to the Yahoo! Terms of
            > Service <http://docs.yahoo.com/info/terms/>.
            >
            >


            [Non-text portions of this message have been removed]
          • Prasanna Goupal
            Dear Rohit, Please find sample code. ****************************************** #!/usr/bin/perl my %hash =( Data1 = [{11 = Test1 ,22 = Test2 }], Data2
            Message 5 of 6 , Jul 18, 2005
            • 0 Attachment
              Dear Rohit,

              Please find sample code.

              ******************************************

              #!/usr/bin/perl

              my %hash =( Data1 =>[{11 => "Test1",22 => "Test2"}],
              Data2 =>["44","55"]
              );

              print $hash{Data1}[0];
              print "\n";
              my $key;
              foreach $key (sort keys %{$hash{Data1}[0]})
              {
              print "Key is $key\n";
              }

              exit 0;

              ******************************************

              Regards,
              Prasanna
              ~


              rohitgole2003 <rohitgole2003@...> wrote:
              hi,

              I have some problem in printing a hash....

              problem is :I have a hash which contains two keys and one of the key
              has an array element and the element of array is again a hash and "I
              want to access that hash value"

              please sort out the problem and send me the answer




              rohit singh gole
              BSBE ,IIT Kanpur






              Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html



              ---------------------------------
              Yahoo! Groups Links

              To visit your group on the web, go to:
              http://groups.yahoo.com/group/perl-beginner/

              To unsubscribe from this group, send an email to:
              perl-beginner-unsubscribe@yahoogroups.com

              Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



              ---------------------------------
              Start your day with Yahoo! - make it your home page

              [Non-text portions of this message have been removed]
            Your message has been successfully submitted and would be delivered to recipients shortly.