Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Word and Excel

by Athanasius (Monsignor)
on Nov 17, 2012 at 02:20 UTC ( #1004277=note: print w/ replies, xml ) Need Help??


in reply to Word and Excel

Hello PerlStart, and welcome to the Monastery!

open('FILE',$srs) or die $1; while(<FILE>)

Let’s assume for the moment that $srs is a text file. Here are some things to consider:

  • 'FILE' is a string, but FILE is a typeglob, which is a different entity. Remove the quotes from around FILE in the open statement.
  • $1 contains the first capture from the last successful pattern match. I think you meant $!, which contains the last system error.
  • It’s better practice to use lexical filehandles and the 3-argument form of open:
    open(my $FILE, '<', $srs) or die $!;

But $srs is not a text file, it’s Word file, so you can’t read it this way at all! You need a suitable CPAN module. Not my area of expertise, but a quick CPAN search turns up Text::Extract::Word, which looks promising.

Athanasius <°(((><contra mundum


Comment on Re: Word and Excel
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (16)
As of 2014-09-22 14:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (194 votes), past polls