in reply to Reading through a large bunch of files

It works for me. What do you mean by "it just stops" - does it end? What is the exit status? Or does it hang?
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
  • Comment on Re: Reading through a large bunch of files

Replies are listed 'Best First'.
Re^2: Reading through a large bunch of files
by Dr Manhattan (Beadle) on Aug 23, 2013 at 14:50 UTC

    It reads in all of the files, processes the first file correctly as it should, then stop and exit without touching the other files

      I tried putting the xml files in a array instead

      my @filelist = (-f, <*.xml>); foreach my $file (@filelist) { print "Working on... $file\n"; my $twig = new XML::Twig(TwigRoots => {title => 1, text => 1}); $twig->parsefile($file); open(Output, ">:utf8", "2_$file") or die "can't open file $!\n"; + $twig->root->print(\*Output); close (Output); }

      And got the error message "Use of uninitialized value $_[0] in -f at C:/Perl/site/lib/XML/Twig.pm line 752."

        Check your syntax. There is a grep missing somewhere.
        لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ