I am running a Dual G4 with OS X 10.2 and I keep getting this when trying to run sample code from this site.
syntax error at phone.pl line 5, near "+=="
"use" not allowed in expression at phone.pl line 19, at end of line
BEGIN not safe after errors--compilation aborted at phone.pl line 20.
I am a "serious" newbie, so any help would be welcome. I know that this is something to do with "use" on line 5, but why? Here is a copy of the code to help:
#!/usr/bin/perl -w
package Cellular::Automata::1D;
#=====================================================================
+========
#
# $Id: 1D.pm,v 0.01 2001/07/05 20:37:34 mneylon Exp $
# $Revision: 0.01 $
# $Author: mneylon $
# $Date: 2001/07/05 20:37:34 $
# $Log: 1D.pm,v $
# Revision 0.01 2001/07/05 20:37:34 mneylon
# Initial Release
#
#
#=====================================================================
+========
use strict;
use Exporter;
use Carp;
use Data::Dumper;
BEGIN {
use Exporter ();
use vars qw($VERSION @ISA @EXPORT %EXPORT_TAGS);
$VERSION = sprintf( "%d.%02d", q($Revision: 0.01 $) =~ /\s(\d+
+)\.(\d+)/ );
@ISA = qw(Exporter);
@EXPORT = qw();
%EXPORT_TAGS = ( );
}
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|