Package version numbers

2014-01-14 Thread SSC_perl
I'm trying to number packages the way it's written about on page 406 of 
Programming Perl, 4th ed., e.g. 

package Emailer 1.01;

However, when I do that, I get the following error:

syntax error at ss_files/Emailer.pm line 1, near package Emailer 1.01
Compilation failed in require at admin.cgi line 38.
BEGIN failed--compilation aborted at admin.cgi line 38.

I'm running Perl 5.10.1 on my laptop so that should be new enough to 
handle this.  What am I doing wrong?

Thanks,
Frank

http://www.surfshopcart.com/
Setting up shop has never been easier!


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Package version numbers

2014-01-14 Thread John SJ Anderson
On Tue, Jan 14, 2014 at 2:50 PM, SSC_perl p...@surfshopcart.com wrote:
 I'm trying to number packages the way it's written about on page 406 
 of Programming Perl, 4th ed., e.g.

 package Emailer 1.01;

 However, when I do that, I get the following error:

 syntax error at ss_files/Emailer.pm line 1, near package Emailer 1.01
 Compilation failed in require at admin.cgi line 38.
 BEGIN failed--compilation aborted at admin.cgi line 38.

 I'm running Perl 5.10.1 on my laptop so that should be new enough to 
 handle this.  What am I doing wrong?

I'm not sure exactly when that syntax was added, but for what it's
worth, it fails with 5.10.1 here too. Perl 5.12.5, on the other hand,
works.

You may just need to upgrade.

chrs,
john.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Package version numbers

2014-01-14 Thread SSC_perl
On Jan 14, 2014, at 4:04 PM, John SJ Anderson wrote:
 I'm not sure exactly when that syntax was added, but for what it's
 worth, it fails with 5.10.1 here too. Perl 5.12.5, on the other hand,
 works.
 
 You may just need to upgrade.

Thanks for the test, John.  In the book's example, they have:

use v5.10;

so I thought I was new enough, but maybe not.

I've resorted to adding:

use vars '$VERSION'; $VERSION = '1.01';

after the package declaration.  That works, but it's just not as clean looking. 
 Not a big deal, though.

Thanks again,
Frank

http://www.surfshopcart.com/
Setting up shop has never been easier!


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Package version numbers

2014-01-14 Thread John SJ Anderson
 Thanks for the test, John.  In the book's example, they have:

 use v5.10;

 so I thought I was new enough, but maybe not.

http://use.perl.org/use.perl.org/articles/10/04/13/1953252.shtml also
notes it as a new feature in 5.12. I'm sure the authors regret the
typo. ;^)



j.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/