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

Re: [PBML] func

Expand Messages
  • Piroska Devay
    In one case you set the global x to 0 and if you call this subr. x the value of x will be changed. When you say local the local x will not be seen outside of
    Message 1 of 4 , Feb 26, 2010
    • 0 Attachment
      In one case you set the global x to 0 and if you call this subr. x
      the value of x will be changed.
      When you say local the local x will not be seen outside of the subr.
      and won't change global x.
      Instead of local it is better to use my $x=0;


      On Feb 26, 2010, at 7:28 AM, Jagadesh wrote:

      > what is the difference between
      > $x=12;
      > sub abcd
      > {
      > $x=0;
      > print $x;
      > }
      >
      > and
      >
      > $x=12;
      > sub abcd
      > {
      > local $x=0;
      > print $x;
      > }
      >
      >



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