Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Read text from HTML file and display it

by 2teez (Priest)
on Oct 29, 2012 at 05:51 UTC ( #1001309=note: print w/ replies, xml ) Need Help??


in reply to Read text from HTML file and display it

OR, if you have lynx on your system,
you can do like so:

use warnings; use strict; my $filename = $ARGV[0]; my $ascii = system("lynx -dump $filename"); print $ascii;

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me


Comment on Re: Read text from HTML file and display it
Download Code
Re^2: Read text from HTML file and display it
by Lotus1 (Chaplain) on Oct 29, 2012 at 20:35 UTC
    use warnings; use strict; my $filename = $ARGV[0]; my $ascii = system("lynx -dump $filename"); print $ascii;

    Your $ascii variable will contain the return value, a number, from system which is not what you seem to be expecting. Backticks or qx() will return what normally goes to STDOUT.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2015-07-06 04:37 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 (70 votes), past polls