[Chicago-talk] Script creates bad file when not run as root

Warren Lindsey warren.lindsey at gmail.com
Wed Dec 13 19:49:13 PST 2006


Check from the shell:
echo $PERL5LIB

and add this to the head of your script:
print join(':', @INC), "\n";

On 12/13/06, Jim Jacobus <JJacobus at ponyx.com> wrote:
>
>  This is probably a Linux problem, but I'm so perplexed I thought I'd ask
> here. I have script that produces an Excel spreadsheet using the
> "Spreadsheet-WriteExcel-2.17" package from John McNamara -- which is
> excellent by the way. The symptom is a corrupt output file. I have a
> stripped down test script  that just creates  a workbook and one worksheet,
> then closes it--so it is trivial and proves that the code is ok. When I run
> it logged in as root, the file can be loaded into Excel, when not run as
> root, it's corrupt.
>
>  I've done all the checking I can think of: looking for duplicate modules,
> checking directory and file ownership and permissions, and can't figure out
> what's going on. I have access to another, shared Linux system. When I
> copied the code to the second machine, script creates a good file even
> though I'm running from a non-root account on that machine.
>  This is most likely a Linux problem, but could anyone suggest any debugging
> techniques I could use besides -W and -T? Believe it or not I've been
> looking at this code for over 14 hours.
>
>  For what it's worth, here's my script.
>  #!/usr/bin/perl -w
>      use strict;
>      use Spreadsheet::WriteExcel;
>      my $workbook = Spreadsheet::WriteExcel->new("perl.xls");
>      if (defined($workbook)) { print "workbook defined\n"; } else { print
> "workbook error\n"; }
>      my $sheet1 = $workbook->add_worksheet("First sheet");
>      if (defined($sheet1)) { print "sheet1 defined\n"; } else { print
> "sheet1 not defined\n"; }
>      $workbook->close();
>      exit;
>
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk
>
>


More information about the Chicago-talk mailing list