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

Re: [PBML] When "strict"... isn't

Expand Messages
  • Piroska Devay
    Hi, They are my already. They stay in that subroutine sort. ... [Non-text portions of this message have been removed]
    Message 1 of 5 , Apr 9, 2008
    • 0 Attachment
      Hi,

      They are 'my' already. They stay in that subroutine sort.


      On Apr 10, 2008, at 1:15 PM, merlyn@... wrote:

      > >>>>> "hooyar66" == hooyar66 <pcbcad@...> writes:
      >
      > hooyar66> #!c:/perl/bin/perl.exe
      >
      > hooyar66> use warnings;
      > hooyar66> use strict;
      >
      > hooyar66> my %hash = ('A',2300,'B',64.5,'C',312,'D',5,'E',76);
      >
      > hooyar66> foreach my $key (sort {$hash{$a} <=> $hash{$b}} keys %hash){
      > hooyar66> print "$key: $hash{$key}\n";
      > hooyar66> }
      >
      > hooyar66> ----
      >
      > hooyar66> I expected 'strict' to enforce me to declare $a and $b
      > with the 'my'
      > hooyar66> assignment operator!?
      >
      > "perldoc strict" says:
      >
      > Because of their special use by sort(), the vari-
      > ables $a and $b are exempted from this check.
      >
      > --
      > 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!
      >
      >



      [Non-text portions of this message have been removed]
    • Piroska Devay
      True. that what I wated to say. ... [Non-text portions of this message have been removed]
      Message 2 of 5 , Apr 9, 2008
      • 0 Attachment
        True. that what I wated to say.

        On Apr 10, 2008, at 6:31 PM, merlyn@... wrote:

        > >>>>> "Piroska" == Piroska Devay <piroskadevay@...> writes:
        >
        > Piroska> They are 'my' already. They stay in that subroutine sort.
        >
        > no, they are effectively local, not my.
        >
        > --
        > 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!
        >
        >



        [Non-text portions of this message have been removed]
      • merlyn@stonehenge.com
        ... Piroska They are my already. They stay in that subroutine sort. no, they are effectively local, not my. -- Randal L. Schwartz - Stonehenge Consulting
        Message 3 of 5 , Apr 10, 2008
        • 0 Attachment
          >>>>> "Piroska" == Piroska Devay <piroskadevay@...> writes:

          Piroska> They are 'my' already. They stay in that subroutine sort.

          no, they are effectively local, not my.

          --
          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!
        Your message has been successfully submitted and would be delivered to recipients shortly.