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

Srtting System variables

Expand Messages
  • Dukelow, Don
    How do you set a UNIX system variable from inside Perl? ... Don Dukelow e-mail: dukelow@hp.com
    Message 1 of 7 , Mar 10, 2008
    • 0 Attachment
      How do you set a UNIX system variable from inside Perl?

      -----
      Don Dukelow
      e-mail: dukelow@...
    • Ozgur Ozturk
      first hit to search: perl unix system variable
      Message 2 of 7 , Mar 10, 2008
      • 0 Attachment
        first hit to search: "perl unix system variable"
        http://www.google.com/search?q=perl+unix+system+variable&sourceid=navclient-ff&ie=UTF-8&rlz=1B3GGGL_enUS232US233

        On Mon, Mar 10, 2008 at 1:01 PM, Dukelow, Don <dukelow@...> wrote:

        >
        > How do you set a UNIX system variable from inside Perl?
        >
        > -----
        > Don Dukelow
        > e-mail: dukelow@... <dukelow%40hp.com>
        >
        >



        --
        Best regards,
        Ozgur (Oscar) Ozturk,
        http://www.stanford.edu/~ozturk/
        Mobile Phone: (614) 805-4370


        [Non-text portions of this message have been removed]
      • merlyn@stonehenge.com
        ... Dukelow, How do you set a UNIX system variable from inside Perl? I ve been using Unix for 30 years. I have never heard the term Unix system variable .
        Message 3 of 7 , Mar 10, 2008
        • 0 Attachment
          >>>>> "Dukelow," == Dukelow, Don <dukelow@...> writes:

          Dukelow,> How do you set a UNIX system variable from inside Perl?

          I've been using Unix for 30 years. I have never heard the term
          "Unix system variable". Perhaps you should restate your request
          in terms of what is actually there, instead of what you're making up.

          --
          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!
        • aditi gupta
          Hello All: I was wondering whether it is possible to have arrays as hash keys. For example: %hash = { [ a , b ] = [ c , d ] }; I came across hash slices
          Message 4 of 7 , Mar 11, 2008
          • 0 Attachment
            Hello All:

            I was wondering whether it is possible to have arrays as hash keys. For example:

            %hash = { ["a", "b"] => ["c", "d"] };

            I came across hash slices while searching for this, but they seem to map individual keys to individual values.

            I'd appreciate any help in this regard.
            Thanks
            Aditi


            ---------------------------------
            Forgot the famous last words? Access your message archive online. Click here.

            [Non-text portions of this message have been removed]
          • merlyn@stonehenge.com
            ... aditi I was wondering whether it is possible to have arrays as hash keys. For example: No. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. -
            Message 5 of 7 , Mar 11, 2008
            • 0 Attachment
              >>>>> "aditi" == aditi gupta <aditi9783@...> writes:

              aditi> I was wondering whether it is possible to have arrays as hash keys. For example:

              No.

              --
              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!
            • Jenda Krynicky
              To: perl-beginner@yahoogroups.com From: aditi gupta Date sent: Tue, 11 Mar 2008 22:28:11 +0000 (GMT)
              Message 6 of 7 , Mar 12, 2008
              • 0 Attachment
                To: perl-beginner@yahoogroups.com
                From: aditi gupta <aditi9783@...>
                Date sent: Tue, 11 Mar 2008 22:28:11 +0000 (GMT)
                Subject: [PBML] Could arrays be used as hash keys?
                Send reply to: perl-beginner@yahoogroups.com

                > Hello All:
                >
                > I was wondering whether it is possible to have arrays as hash keys. For example:
                >
                > %hash = { ["a", "b"] => ["c", "d"] };
                >
                > I came across hash slices while searching for this, but they seem to map individual keys to individual values.
                >
                > I'd appreciate any help in this regard.
                > Thanks
                > Aditi

                A quick search on http://search.cpan.org reveals those:

                http://search.cpan.org/~osfameron/Tie-Hash-StructKeyed-
                0.03/lib/Tie/Hash/StructKeyed.pm

                http://search.cpan.org/~snowhare/Tie-ListKeyedHash-
                1.02/lib/Tie/ListKeyedHash.pod

                http://search.cpan.org/~nuffin/Tie-RefHash-1.38/lib/Tie/RefHash.pm

                Please keep in mind that
                [1,2] != [1,2]
                because each [] created a brand new reference to a new array!
                Which causes the Tie::Refhash to behave differently than
                Tie::ListKeyedHash or Tie::Hash::Structkeyed!

                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
              • Alexander Saydakov
                ... Hashes (and arrays) can only hold scalars, that is, a string, a number or a reference. So in your example the hash will look like (if dumped with
                Message 7 of 7 , Mar 13, 2008
                • 0 Attachment
                  --- In perl-beginner@yahoogroups.com, aditi gupta <aditi9783@...> wrote:
                  >
                  > I was wondering whether it is possible to have arrays as hash keys.
                  For example:
                  >
                  > %hash = { ["a", "b"] => ["c", "d"] };

                  Hashes (and arrays) can only hold scalars, that is, a string, a number
                  or a reference. So in your example the hash will look like (if dumped
                  with Data::Dumper):

                  $VAR1 = {
                  'ARRAY(0x804e15c)' => [
                  'c',
                  'd'
                  ]
                  };

                  Of course, that number is quite random, and, more importantly, if you
                  tried to overwrite it like this:

                  $hash{["a", "b"]} = 'something else';

                  you would actually insert one more pair with some other random
                  reference instead:

                  $VAR1 = {
                  'ARRAY(0x804e15c)' => [
                  'c',
                  'd'
                  ],
                  'ARRAY(0x809add4)' => 'something else'
                  };


                  /sandy http://myperlquiz.com/
                Your message has been successfully submitted and would be delivered to recipients shortly.