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?


In reply to Expat.pm and Parser.pm errors by jpinones

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.