A quick question

Alan Stewart astewart at spawar.navy.mil
Fri Oct 15 11:13:32 CDT 1999


~sdpm~
On 14 Oct 99 at 21:16, Joel Fentin wrote:

>~sdpm~
>The first program works. The second doesn't. What does it want?
>
>
>#use strict;
>$A = 3;
>print $A;
>
>
>
>use strict;
>$A = 3;
>print $A;

my $A = 3;
  or
use vars qw($A);

The first limits the scope of $A to that block or file, the second makes $A global.
Strict wants you to explicitly state what scope each variable gets, the assumption 
being, if you say it out loud, you will make fewer mistakes and it can do more 
checking.

>
>--
>Joel Fentin    tel: 760-749-8863    FAX: 760-749-8864
>
---------------------------------------------------------------
Alan Stewart          )-[]-(           Electronics Engineer
Code D621           ~        ~         Network Operations
SPAWARSYSCEN       ~          ~  \     Satellite Communications
53560 Hull St   ( ~            ~  )    tel (619)524-3625
San Diego,CA  __|___             /|    fax (619)524-2607
92152-5001   ^\____/^^^^^^\    __| |_  astewart at spawar.navy.mil
------------^^^^^^^^^^^^^^^\__|______|_------------------------
~sdpm~

The posting address is: san-diego-pm-list at hfb.pm.org

List requests should be sent to: majordomo at hfb.pm.org

If you ever want to remove yourself from this mailing list,
you can send mail to <majordomo at happyfunball.pm.org> with the following
command in the body of your email message:

    unsubscribe san-diego-pm-list

If you ever need to get in contact with the owner of the list,
(if you have trouble unsubscribing, or have questions about the
list itself) send email to <owner-san-diego-pm-list at happyfunball.pm.org> .
This is the general rule for most mailing lists when you need
to contact a human.




More information about the San-Diego-pm mailing list