Eugen Konkov
Eugen Konkov

Reputation: 25133

How to fix error: Can't find string terminator "^@" anywhere before EOF?

I got the error when try to run:

/home/kes/perl5/perlbrew/perls/perl-5.8.9/bin/perl -I/home/kes/work/projects/perl_libs/t/lib -I/home/kes/work/projects/perl_libs/t/../lib -d:DbInteract="t();q" -e "sub t {
return ( 1, undef, undef, 2 );
}
sub a {
my @list =  ( 1, undef, undef, 2 );
return @list;
}
1;
"
Can't find string terminator "^@" anywhere before EOF at /home/kes/work/projects/perl_libs/t/lib/Devel/DbInteract.pm line 15.
Compilation failed in require.
BEGIN failed--compilation aborted.

What should I change to fix error?

Upvotes: 0

Views: 541

Answers (2)

Eugen Konkov
Eugen Konkov

Reputation: 25133

The library you are calling is producing the error message. The source line is

15:  my $endline = $1 // ';';

Your old Perl (5.8.9) does not support the // operator.

Upvotes: 3

Wayne Booth
Wayne Booth

Reputation: 422

Try escaping your @ symbols (so you have \@list). Alternatively, change your script capture from double to single quotes. eg

... DbInteract="t();q" -e 'sub t { ..... } 1;'

Upvotes: -1

Related Questions