>>>>> "Ron" == Ron Smith <[EMAIL PROTECTED]> writes:

Ron> Is it just me, or does anyone out there notice that the example
Ron> subroutine on pg. 57 of "Learning Perl" (Third Edition) doesn't work,
Ron> as presented?

Ron> When written like:
Ron> ----------------snip------------------
Ron> #!/usr/bin/perl -w
Ron> use strict;

Ron> sub marine {
Ron>     my $n += 1; # Global variable $n

There is no "my" when it's presented.  Please read carefully.

Ron>     print "Hello, sailor number $n!\n";
Ron> }

Ron> &marine;
Ron> &marine;
Ron> &marine;
Ron> &marine;


-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <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!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to