Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

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/ line 752."

Replies are listed 'Best First'.
Re^4: Reading through a large bunch of files
by choroba (Chancellor) on Aug 23, 2013 at 15:21 UTC
    Check your syntax. There is a grep missing somewhere.
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1050681]
[stevenlm87]: Needs help. I am taking an online class for perl and is using Padre. How can I get a list from the input in this code? print "What are your favorite hobbies? "; my $hobbies = <STDIN>; chomp $hobbies; print "Your favorite hobbies are '$hobbies'\n";

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2017-02-23 19:48 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (350 votes). Check out past polls.