Bear with me as I'm new to Perl, but I am having an error in compilation on a use statement, but I'm not entirely sure why I'd get one there. I am using perlbrew on Mac Sierra. The perl version is 5.26.1.
I'm not quite sure where to really start. I did a little research and the only thing I found close to what I needed was an invalid shebang line, which I'm not using. I did try with a valid shebang line with no change.
I did comment the offending line to see what would happen and it just failed on the very next one so it's my use statements.
use warnings;
use strict;
# Lib Folders;
use lib "/Users/user/perl5/lib/perl5/darwin-thread-multi-2level"
# Load Modules
use DBI;
use DBD::MariaDB;
use Text::CSV;
use Excel::Writer::XLSX;
use Time::Piece;
use Log::Log4perl qw(get_logger);
Since I can't compile past this point, I can't verify if anything else beyond it doesn't work. I'm at a loss as to why this is causing an error.
I would expect another compilation error or a successful compilation if I wrote everything else properly.
"use" not allowed in expression at report.pl line 8, at end of line
syntax error at report.pl line 8, near "use DBI"
BEGIN not safe after errors--compilation aborted at report.pl line 9.
Command terminated with non-zero status.
Command [perl report.pl] terminated with exit code 255 ($? = 65280) under the following perl environment:
Current perl:
Name: perl-5.26.1
Path: /Users/user/perl5/perlbrew/perls/perl-5.26.1/bin/perl
Config: -de -Dprefix=/Users/user/perl5/perlbrew/perls/perl-5.26.1 -Aeval:scriptdir=/Users/user/perl5/perlbrew/perls/perl-5.26.1/bin
Compiled at: Jun 4 2019 12:12:08
This is what the terminal is giving me when I run perlbrew exec perl report.pl
. I must've missed something but I'm not sure what exactly.