Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: Reading through a large bunch of files

by Dr Manhattan (Beadle)
on Aug 23, 2013 at 15:18 UTC ( #1050681=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Reading through a large bunch of files
in thread Reading through a large bunch of 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."


Comment on Re^3: Reading through a large bunch of files
Download Code
Re^4: Reading through a large bunch of files
by choroba (Canon) on Aug 23, 2013 at 15:21 UTC
    Check your syntax. There is a grep missing somewhere.
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1050681]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2015-07-07 03:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (86 votes), past polls