RE: Hello! Help me please!

2006-01-05 Thread Daley, Ryan M.
 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of DZ-Jay
> Sent: Thursday, January 05, 2006 11:44 AM
> To: Hicks, Robert
> Cc: perl-win32-users@listserv.ActiveState.com
> Subject: Re: Hello! Help me please!
> 
> Hicks, Robert wrote:
> > I believe that if you inline a heredoc like that the 
> contents of the heredoc have to be left aligned all the way 
> to the left margin.
> 
> Not the *contents* of the heredoc, but the closing label must 
> be the first thing on its line.  This should be fine:
> 
>  if(!(m~^http://~))
>  {
>$url='http://127.0.0.1/'.$_;
>$content=getContent($url);
>print<<"EOF";
>content of this $url is:
>$content
> EOF
>  }
> 
> 
> If that is too ugly for you (it is for me!), then perhaps you 
> should use a standard double-quoted string:
> 
>   print "\ncontent of this $url is:\n$content";
> 
>   dZ.
> 

I think you can also rewrite the heredoc as such (with a 4 space
indentation):

print <<"EOF";
content of this $url is:
$content
EOF

I've used this for some things in the past.

hth,
rmd

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Hello! Help me please!

2006-01-05 Thread DZ-Jay

Hicks, Robert wrote:

I believe that if you inline a heredoc like that the contents of the heredoc 
have to be left aligned all the way to the left margin.


Not the *contents* of the heredoc, but the closing label must be the 
first thing on its line.  This should be fine:


if(!(m~^http://~))
{
  $url='http://127.0.0.1/'.$_;
  $content=getContent($url);
  print<<"EOF";
  content of this $url is:
  $content
EOF
}


If that is too ugly for you (it is for me!), then perhaps you should use 
a standard double-quoted string:


print "\ncontent of this $url is:\n$content";

dZ.

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Hello! Help me please!

2006-01-05 Thread Bruno Georges
Gao

In a nutshell you have to wrtie the closing print string: EOF
at the beginning of the line, without spaces nor tabs.


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:  Perl-Win32-Users@listserv.ActiveState.com   
 |
  |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
Perl-Win32-Users@listserv.ActiveState.com
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
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Hello! Help me please!

2006-01-05 Thread Hicks, Robert
=== your code ===

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
    }

==

I believe that if you inline a heredoc like that the contents of the heredoc 
have to be left aligned all the way to the left margin. If you find that too 
ugly you can factor out the heredocs into a constant and then use the constant 
name in the actual code.

Robert

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Hello! Help me please!

2006-01-05 Thread Bruno Georges
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:  Perl-Win32-Users@listserv.ActiveState.com   
 |
  |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
Perl-Win32-Users@listserv.ActiveState.com
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
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Hello! Help me please!

2006-01-05 Thread gao perlone
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="">    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
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Win32::Ole (MAPI) and Win2K scheduler

2006-01-05 Thread Rod Butcher

Christopher Taranto wrote:

Hi Ken,

Wednesday, January 4, 2006, 5:07:58 AM, you wrote:

LK> Thanks to Steven Manross, I'm a step further along in
LK> troubleshooting this.  Using Steven's suggestion, I got the
LK> following from OLE->LastError: 'Win32::OLE(0.1403) error
LK> 0x80070005: "Access is denied"'.  Does anyone out there know
LK> anything about how the Win2k scheduler accesses objects (and, more
LK> importantly, how to circumvent this problem)?  As I stated
LK> earlier, the scheduled task is running under the same userid I use
LK> to log on when I successfully run my program at a command prompt.
[% snip %]
LK> I created a program using ActiveState's perl 5.8.4, compiled it using
LK> perlapp 5.3.0 and ran it on Windows 2000 Professional SP4 against
LK> Outlook 2000 SR-1 (9.0.0.3821).  It runs properly both from a command
LK> prompt and as a scheduled task.  I released it into production on
LK> Windows 2000 server SP4 using the identical version of Outlook 2000.
LK> Again, it runs great from a command prompt.  When I run it as a
LK> scheduled task, however, it dies because it's not able to get the
LK> Outlook Application.
I also had problems on Win2k SP4 running Perl scripts via scheduler that 
had worked fine from the command prompt.
I came to the conclusion that scheduler does not exactly simulate a dos 
command prompt and things like automatically invoking perl by the suffix 
.pl didn't work, and I suspect it doesn't use Path either. I had to set 
the "start in" value to give it a kickoff point. You could try playing 
with that.
LK>  
LK> Here's the relevant code:
LK>  
LK>  
LK> Win32::OLE->Initialize(Win32::OLE::COINIT_OLEINITIALIZE); 
LK> die Win32::OLE->LastError(),"\n" if Win32::OLE->LastError(  );

LK> eval { $Outlook =
LK> Win32::OLE->GetActiveObject('Outlook.Application')
LK> };
LK> die "Outlook is not installed" if $@;
LK> unless (defined $Outlook) {
LK> $Outlook = Win32::OLE->new('Outlook.Application', sub
{$_[0]->>Quit;});
LK> or die "Oops, cannot start Outlook";
LK> <=== dies here under Win2k srvr as a scheduled task

I'm not sure if this will help or solve your problem - but you could
give Outlook Redemption a look - http://www.dimastr.com/redemption/

"Outlook Redemption works around limitations imposed by the Outlook Security Patch 
and Service Pack 2 of MS Office 98/2000 and Office 2002 and 2003 (which include Security 
Patch) plus provides a number of objects and functions to work with properties and 
functionality not exposed through the Outlook object model."

Good luck!



--
-

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs