Hi Try changing your code to something formatted this way:
FROM:
if(!(m~^http://~))
{
$url='http://127.0.0.1/'.$_ ;
$content=getContent($url);
print<<"EOF";
content of this $url is:
$content
EOF
}
to:
if(!(m~^http://~))
{
$url='http://127.0.0.1/'.$_ ;
$content=getContent($url);
print <<"EOF";
content of this $url is:
$content
EOF
}
I tried it works for me.
Hope this helps.
Bruno Georges
Glencore International AG
Tel. +41 41 709 3204
Fax +41 41 709 3000
|---------+------------------------------------------------->
| | gao perlone <[EMAIL PROTECTED]> |
| | Sent by: |
| | [EMAIL PROTECTED]|
| | veState.com |
| | |
| | |
| | 05.01.06 13:13 |
| | |
|---------+------------------------------------------------->
>--------------------------------------------------------------------------------------------------------------|
|
|
| To: [email protected]
|
| cc:
|
| Subject: Hello! Help me please!
|
|
|
|Distribute:
|
|Personal? |-------|
|
| | [ ] x |
|
| |-------|
|
|
|
>--------------------------------------------------------------------------------------------------------------|
I compile the fellowing perl program and meet a problem:
use HTTP::Request;
use LWP::UserAgent;
$content=getContent('http://127.0.0.1/index.htm');
@html=split(/\n/,$content);
for(@html)
{
do
{
$2 and push(@link,$2);
}while m
{
<\s*A\s+HRE\s*=\s*(['''])(.*?)\l\s*>
}gsix;
print "All links in this page:\n";
for(@link)
{
print $_,"\n";
}
print "Visit all links in this page: \n";
for(@link)
{
if(!(m~^http://~))
{
$url='http://127.0.0.1/'.$_ ;
$content=getContent($url);
print<<"EOF";
content of this $url is:
$content
EOF
}
if((m~^http://127.0.0.1~)or(m~^http://localhost~))
{
$conten=getContent($_);
print<<"EOF";
content of this $url is:
$content
EOF
}
}
}
########################################
sub getContent
########################################
{
my $url=shift;
my $ua=new LWP::UserAgent();
my $request=new HTTP::Request('GET',"$url");
my $response=$ua->request($request);
my $content=$response->content;
return $content;
}
When I compile it the compiler show me:
Can't find string terminator "EOF" anywhere before EOF at robot.pl line
84.##(red as I marked).##
Please tell how to......?
thanks a lot!_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
LEGAL DISCLAIMER. The contents of this e-mail and any attachments are strictly
confidential and they may not be used or disclosed by someone who is not a
named recipient.
If you have received this email in error please notify the sender by replying
to this email inserting the word "misdirected" as the message and delete this
e-mail from your system.
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs