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

Re: Word and Excel

by Athanasius (Canon)
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?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2015-10-05 04:48 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (107 votes), past polls