Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: File Open Error

by cdarke (Prior)
on May 09, 2012 at 13:49 UTC ( #969627=note: print w/ replies, xml ) Need Help??


in reply to File Open Error

Did you notice there were a few syntax errors?
You probably meant something like this:

foreach my $file (glob('*.txt')) { open(my $fh, $file) or die("Unable to open '$file': $!"); while (my $line = <$fh>) { if ($line =~ m/(Apple|Orange|Litchi)/) { $Sheet->Cells($row,$col-1)->{'Value'} = $file; $Sheet->Cells($row,$col+6)->{'Value'} = $line ; $row=$row+1; } } # close file close($fh); }


Comment on Re: File Open Error
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2014-11-20 21:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (102 votes), past polls