I use Win32 also and screwed with this for almost an hour before just trying to print the $text variable out. The output was everything minus "@mail", surely it's not going to find @mail.cp. I don't know how you are putting the information into the text variable, I assume you are using LWP::Simple and trying to fetch email address' from the web. I uploaded a page with some text similar to yours and used this script to retrieve it. Try it out, I will leave the page up for awhile. Hope this helps you.
Mosley
use LWP::Simple;
print "Content-type: text/html\n\n";
$URL = "http://www.weedlinks.f2s.com/joeblow.html";
$page = get($URL);
$page =~ s/\s+/ /g;
@text = split(/\s/, $page);
foreach $line (@text) {
if ($line =~ /\@/) {
@line = split(/\@/, $line);
print "@line[0]<br>";
# If you just want to collect whole email address'.
# Un (#) the next line.
#print "$line<br>";
# Or print to a database. Un (#) the next 3 lines.
#open (DATABASE,">>joeblow.txt");
#print DATABASE "$line\n";
#close (DATABASE);
}
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.