On Thu, May 27, 2010 at 12:48 PM, Robert Morales
<[email protected]> wrote:
> Final $ should be \$ or $name at ./script.pl line 11, within string
> syntax error at ./script.pl line 11, near "= "^((?!total).)*$""
> Execution of ./script.pl aborted due to compilation errors.
>
> It might be something with the regex, but I can't see exactly what??
** snip **
> $regex = "^((?!total).)*$";

The problem is that Perl is interpreting the $ to mean something
special (i.e., an embedded variable). You can escape it with \$, as
suggested by the error message.

perl -e '
use strict;
use warnings;

#my $regex = "^((?!total).)*$";
my $regex = "^((?!total).)*\$";
'

-- 
Brandon McCaig <[email protected]>
V zrna gur orfg jvgu jung V fnl. Vg qbrfa'g nyjnlf fbhaq gung jnl.
Castopulence Software <http://www.castopulence.org/> <[email protected]>

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/


Reply via email to