hummm, never mind. i decided to stop being stupid in multiple ways. i need to read more on writeexcel, and i've modified my crappy pass and moved that connector to another file so that i don't get stupid again:
#!/usr/bin/perl -T use strict; use warnings; use Spreadsheet::ParseExcel; use Spreadsheet::WriteExcel; use Carp::Assert; require './dbconnect.pl'; my( $infile ) = $ARGV[0] =~ m/^([A-Z0-9_.-]+)$/ig; my( $outfile ) = $ARGV[0] =~ m/^([A-Z0-9_.-]+)$/ig; my ( @xldata, $i ); my $parser = Spreadsheet::ParseExcel->new(); my $workbookin = $parser->parse( $infile ); my $workbookout = Spreadsheet::WriteExcel->new( $outfile ); On Sun, Nov 14, 2010 at 11:44 AM, shawn wilson <ag4ve...@gmail.com> wrote: > so, i'm guessing that i have to mess with ARGV when i use -T on my code? > i'm getting this error: > Insecure dependency in open while running with -T switch at > /usr/lib/perl/5.10/IO/File.pm line 66 > > now, i didn't get this before spreadsheet::writeexcel. so i'm thinking that > i can't use ARGV when i define a 'new' package? here's my code: > > #!/usr/bin/perl -T > > use strict; > use warnings; > > use DBI; > use Spreadsheet::ParseExcel; > use Spreadsheet::WriteExcel; > use Carp::Assert; > > my ( @xldata, $i ); > > my $parser = Spreadsheet::ParseExcel->new(); > my $workbookin = $parser->parse($ARGV[ 0 ]); > > > my $workbookout = Spreadsheet::WriteExcel->new( $ARGV[ 1 ]); > > > my $dbh = DBI->connect('DBI:mysql:ais;host=localhost', 'shawn', 'Pa55W0rd') > or die "Database connection: $!"; > > if ( !defined $workbookin ) { > die "Can\'t read spreadsheet: ", $parser->error(), ".\n"; > } > > if ( !defined $workbookout ) { > die "Can\'t write spreadsheet: $!\n" > } > > my $worksheetin = $workbookin->worksheet(0); > > my ( $row_min, $row_max ) = $worksheetin->row_range(); > my ( $col_min, $col_max ) = $worksheetin->col_range(); > > for my $row ( $row_min .. $row_max ) { > for my $col ( $col_min .. $col_max ) { > > my $cell = $worksheetin->get_cell( $row, $col ); > next unless $cell; > > $xldata[ $row ][ $col ] = $cell->unformatted() ; > } > } > > my $worksheetout = $workbookout->add_worksheet( 'Data' ); > > $worksheetout->write_row( 'A1', \...@xldata ); > > > > #for my $row ( 0 .. $#xldata ) { > > # print "ROW $row :\t"; > # for my $col ( 0 .. $#{ $xldata[ $row ] } ) { > > # print "$xldata[ $row ][ 13 ]," if defined( $xldata[ $row ][ > 13 ] ); > # } > > # print "\n"; > #} >