On Feb 16, 2006, at 18:35, Mike Martin wrote:

I have problems with reading in a file variable in Spreadsheet::Parsexcel.
This is the relevant code.



use strict;
use warnings;

open (INPUT,"tele1");
my @input1=<INPUT>;

If those are filenames it would be more robust to chomp them right here:

    chomp @input1;

foreach my $input1 (@input1){
my @out1=split (/\./,$input1);
my $ext='.tab';
my $output1= "$out1[0]$ext";

To change the extension you may do something more simple like

    $input1 =~ s/[.]\w+$/.tab/;

open (OUT1,">>",$output1);
open (IN1,$input1) or die $!;
print $input1;
my $excel_file=$input1;
    use Spreadsheet::ParseExcel;
    my $oBook =
        Spreadsheet::ParseExcel::Workbook->Parse($excel_file) ;
    my($iR, $iC, $oWkS, $oWkC);

If I put in a literal file name it works - any ideas

Debug it:

    print $excel_file and exit;

-- fxn




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to