jpinones has asked for the wisdom of the Perl Monks concerning the following question:
I run my script and outputs:
Use of uninitialized value in subroutine entry at /usr/lib/perl5/XML/P +arser/Expat.pm line 475. no element found at line 1, column 0, byte -1 at /usr/lib/perl5/XML/Pa +rser.pm line 187
code is like this:
#!/usr/bin/perl -W use strict; use Archive::Zip; use Spreadsheet::ParseExcel; use Class::CSV; use Text::CSV; use Text::CSV_XS; use XML::Parser; use LWP::Simple; # used to fetch the chatterbox ticker die "You must provide a filename to $0 to be parsed as an Excel/Word f +ile" unless @ARGV; my $count; my $count2; my $count3; my $ARGV; my $d; my $b; my $a; my $c; my @array1 = ((undef),(undef)); my @array2 = ((undef),(undef)); my @array3 = ((undef),(undef)); my $string1; my $string2; my $message; # Hashref containing infos on a message my $oBook; my $cb_ticker; my $string0; if ($ARGV[$count] =~ "casoUso") { print "$count\n"; print "$ARGV[$count]\n"; $string0 = $ARGV[$count]; print "$string0\n"; print "mkdir $string0.dir\n"; ###gets the filename from the ARG given +from the command line run. system ("mkdir $string0.dir"); ###gets the filename from the ARG given + from the command line run. print "/usr/bin/unzip $ARGV[$count] -d ./$ARGV[$count].dir\n"; ###gets + the filename from the ARG given from the command line run. system ("/usr/bin/unzip $ARGV[$count] -d ./$ARGV[$count].dir"); ###get +s the filename from the ARG given from the command line run. $string1 = "./".$string0.".dir"."/word/document.xml"; print "$string1\n"; $cb_ticker = get("$string1"); print "paso cb ticker\n"; my $parser = new XML::Parser ( Handlers => { # Creates our parser obje +ct Start => \&hdl_start, End => \&hdl_end, Char => \&hdl_char, Default => \&hdl_def, }); print "paso parser\n"; $parser->parse($cb_ticker); print "paso parser2\n";
Any clue?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Expat.pm and Parser.pm errors
by runrig (Abbot) on Oct 16, 2012 at 21:55 UTC | |
by jpinones (Initiate) on Oct 16, 2012 at 21:59 UTC | |
by runrig (Abbot) on Oct 16, 2012 at 22:13 UTC | |
Re: Expat.pm and Parser.pm errors
by brap (Pilgrim) on Oct 17, 2012 at 12:25 UTC | |
by jpinones (Initiate) on Oct 17, 2012 at 17:54 UTC | |
by brap (Pilgrim) on Oct 17, 2012 at 18:25 UTC | |
by jpinones (Initiate) on Oct 19, 2012 at 20:57 UTC | |
by jpinones (Initiate) on Oct 17, 2012 at 20:59 UTC | |
by jpinones (Initiate) on Oct 17, 2012 at 21:03 UTC | |
by runrig (Abbot) on Oct 17, 2012 at 21:48 UTC | |
|
Back to
Seekers of Perl Wisdom