The forward slash to backslash is the way things work on windows -- I always use forward slashes in path names and Perl happily flips them to backslashes when it talks to the windows. The program {as y'all will see} shows what the parse returned and that's exactly right. I put in the 'open' to double-check that the hardwired excel path was correct.
I neglected to include that this is with Strawberry Perl running on a win10/64 system.
Here's the little test program:
#!/usr/bin/perl
use v5.10 ;
use strict;
use warnings ;
use Excel::Table ;
use constant WORKBOOK => "d:/desktop/testWB.xlsx" ;
# test if the path works
open(P, "<", WORKBOOK)
or die "Can't find the workbook: $!\n" ;
close P ;
my $xs = getWB(WORKBOOK) ;
exit ;
sub getWB
{ my ($dir, $wb) = $_[0] =~ /(.*)\/(.*)/ ;
say "Directory is $dir" ;
say "Excel file is $wb" ;
my $xs = Excel::Table->new(dir => $dir) ;
$xs->open($wb) ;
return $xs ;
}
I don't know how to upload the Excel worksheet that the file needs {anything will do, since I am only trying to open it and {for the nonce} don't care about whats *in* the file}, but when I run the program I get.
d:\Desktop>testWb.pl
Directory is d:/desktop
Excel file is testWB.xlsx
Log4perl: Seems like no initialization happened. Forgot to call init()
+?