[28587] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 9951 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 10 14:10:22 2006

Date: Fri, 10 Nov 2006 11:10:13 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 10 Nov 2006     Volume: 10 Number: 9951

Today's topics:
        Perl modules installed <hillmw@charter.net>
    Re: Perl modules installed <andy@andyh.co.uk>
    Re: Perl modules installed <hillmw@charter.net>
    Re: Perl modules installed <hillmw@charter.net>
    Re: Perl modules installed <andy@andyh.co.uk>
    Re: Perl modules installed <mikedawg@gmail.com>
    Re: Perl modules installed anno4000@radom.zrz.tu-berlin.de
    Re: perl threading; ->join; best method? <zentara@highstream.net>
    Re: perl threading; ->join; best method? <jdhedden@1979.usna.com>
        Permission Denied error when moving files - Perl <kstulce@gmail.com>
    Re: Permission Denied error when moving files - Perl <glex_no-spam@qwest-spam-no.invalid>
    Re: Permission Denied error when moving files - Perl <kstulce@gmail.com>
    Re: Permission Denied error when moving files - Perl anno4000@radom.zrz.tu-berlin.de
    Re: Permission Denied error when moving files - Perl <glex_no-spam@qwest-spam-no.invalid>
        Reading config file with line break character? <bernd.fischer@xignalerif.r'4054-50];p5.de>
    Re: Reading config file with line break character? <andy@andyh.co.uk>
    Re: Reading config file with line break character? <bernd.fischer@xignalerif.r'4054-50];p5.de>
    Re: simple regular expression <tzz@lifelogs.com>
        SOAP::LITE neil.holmes@zoom.co.uk
    Re: SOAP::LITE <glex_no-spam@qwest-spam-no.invalid>
    Re: using grep in Perl <jurgenex@hotmail.com>
    Re: using grep in Perl <someone@example.com>
    Re: What is more detailled than $^O ? <tzz@lifelogs.com>
        Win32::Internet fetch url question <hoffmanamps@citcom.net>
    Re: Win32::Internet fetch url question <glex_no-spam@qwest-spam-no.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 10 Nov 2006 09:30:14 -0800
From: "mike" <hillmw@charter.net>
Subject: Perl modules installed
Message-Id: <1163179814.478176.118510@e3g2000cwe.googlegroups.com>

Does anyone know how I can run a script and see what Perl modules are
installed on my box?

Mike



------------------------------

Date: Fri, 10 Nov 2006 17:32:14 +0000
From: Andy Hassall <andy@andyh.co.uk>
Subject: Re: Perl modules installed
Message-Id: <gsd9l2duj014c0nvjs75i71op92qbhl23m@4ax.com>

On 10 Nov 2006 09:30:14 -0800, "mike" <hillmw@charter.net> wrote:

>Does anyone know how I can run a script and see what Perl modules are
>installed on my box?

 perldoc -q installed

-- 
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool


------------------------------

Date: 10 Nov 2006 09:58:08 -0800
From: "mike" <hillmw@charter.net>
Subject: Re: Perl modules installed
Message-Id: <1163181488.589541.24650@f16g2000cwb.googlegroups.com>

% perldoc -q installed
No documentation for perl FAQ keyword `installed' found


Andy Hassall wrote:
> On 10 Nov 2006 09:30:14 -0800, "mike" <hillmw@charter.net> wrote:
>
> >Does anyone know how I can run a script and see what Perl modules are
> >installed on my box?
>
>  perldoc -q installed
>
> --
> Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
> http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool



------------------------------

Date: 10 Nov 2006 09:58:28 -0800
From: "mike" <hillmw@charter.net>
Subject: Re: Perl modules installed
Message-Id: <1163181508.792402.147430@m73g2000cwd.googlegroups.com>

% perldoc -q installed
No documentation for perl FAQ keyword `installed' found


Andy Hassall wrote:
> On 10 Nov 2006 09:30:14 -0800, "mike" <hillmw@charter.net> wrote:
>
> >Does anyone know how I can run a script and see what Perl modules are
> >installed on my box?
>
>  perldoc -q installed
>
> --
> Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
> http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool



------------------------------

Date: Fri, 10 Nov 2006 18:01:49 +0000
From: Andy Hassall <andy@andyh.co.uk>
Subject: Re: Perl modules installed
Message-Id: <kif9l21fv2rqio05mduuq5s9ua2nc4603c@4ax.com>

On 10 Nov 2006 09:58:08 -0800, "mike" <hillmw@charter.net> wrote:

>% perldoc -q installed
>No documentation for perl FAQ keyword `installed' found

 What version of Perl are you using?

 This is what you should get:

http://perldoc.perl.org/perlfaq3.html#How-do-I-find-which-modules-are-installed-on-my-system%3f

-- 
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool


------------------------------

Date: 10 Nov 2006 10:02:07 -0800
From: "Mike" <mikedawg@gmail.com>
Subject: Re: Perl modules installed
Message-Id: <1163181727.260441.206030@b28g2000cwb.googlegroups.com>

mike wrote:
> % perldoc -q installed
> No documentation for perl FAQ keyword `installed' found
>
>
> Andy Hassall wrote:
> > On 10 Nov 2006 09:30:14 -0800, "mike" <hillmw@charter.net> wrote:
> >
> > >Does anyone know how I can run a script and see what Perl modules are
> > >installed on my box?
> >
> >  perldoc -q installed
> >
> > --
> > Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
> > http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

http://perldoc.perl.org/perlfaq3.html#How-do-I-find-which-modules-are-installed-on-my-system%3F



------------------------------

Date: 10 Nov 2006 18:04:39 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: Perl modules installed
Message-Id: <4rjt9nFrqn99U2@mid.dfncis.de>

mike <hillmw@charter.net> wrote in comp.lang.perl.misc:
> % perldoc -q installed
> No documentation for perl FAQ keyword `installed' found

Read it at

    http://perldoc.perl.org/ExtUtils/Installed.html

or get a newer Perl.

Anno


------------------------------

Date: Fri, 10 Nov 2006 14:03:12 GMT
From: zentara <zentara@highstream.net>
Subject: Re: perl threading; ->join; best method?
Message-Id: <ph19l251s9nkoqm99f032f09us7un6mgb6@4ax.com>

On 9 Nov 2006 11:30:03 -0800, "robert.waters" <robert.waters@gmail.com>
wrote:

>I have a function that does a repetitive task, each task identified by
>a unique index; I would like this task to be shared amongst a number of
>threads.  My question is, in what manner should I call 'join' in order
>to be sure that each thread has completed it's task before the end of
>the program?
>My current logic is this:

Just remember that in order for a thread to be joinable, it must finish,
or somehow return from it's code block.

With LWP, you will need to set a timeout on the connection, or use an
alarm block, to detect LWP connections which hang. Otherwise, those
hanging threads will NEVER be joinable, and you will stay in your
join loop forever.

If you kill the main thread, you will get the error " a thread exited
while x threads running".



-- 
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html


------------------------------

Date: 10 Nov 2006 07:44:09 -0800
From: "jdhedden" <jdhedden@1979.usna.com>
Subject: Re: perl threading; ->join; best method?
Message-Id: <1163173449.030082.108480@f16g2000cwb.googlegroups.com>

Robert Waters wrote:
> # JOIN ALL THREADS
> foreach $thread (threads->list) {
>     $thread->join;
> }
>
> My question is: In what manner should I call 'join' in
> order to be sure that each thread has completed it's task
> before the end of the program?

The method you have above is perfectly correct.  It can be
compacted a bit using:

    $_->join() foreach threads->list();

> This technique, while working fine enough, just does not
> seem to be "The Right Way" to do it;  I would assume that
> the process of waiting for threads to finish should be
> asynchronous.

If you upgrade to the lastest version of 'threads' off of
CPAN, you can do this asynchronously;

    while (threads->list()) {
        $_->join() foreach threads->list(threads::joinable);
        sleep(1);
    }

Hope this helps.



------------------------------

Date: 10 Nov 2006 09:13:28 -0800
From: "Ken" <kstulce@gmail.com>
Subject: Permission Denied error when moving files - Perl
Message-Id: <1163178808.676038.236910@h54g2000cwb.googlegroups.com>

Hello,

I have a script that is reading the contents of a directory, only for
files with a *.PDF extension.  Once the files names are read into a
list, the pdf's are looked at to determine the number of pages in the
file.  Based on the number of pages, I'm wanting a new directory to be
created or used, if it already exists, and move the pdf files with the
matching number of pages into the directory.  When trying to move/copy
& delete I get a Permission Denied error from the script.

Here's my script for you to review:
###########################
use strict;
use warnings;

use File::chmod;
use Cwd;
use Carp;
use Getopt::Long;
use PDF;
use POSIX;
use File::Copy;
use File::Basename;

# find out current working directory
my $cwd = getcwd;
#print "$cwd\n";

opendir(DIR, "$cwd") || die ("Unable to open directory");
my @pdfname = grep { /\.pdf$/ } readdir(DIR);
closedir(DIR);

# Find all files with "*.pdf" extension
#my @pdfname = glob("*.pdf");
my $pdfcount = @pdfname;
my $pdfFile;
if($pdfcount != 0)
{
        foreach $pdfFile(@pdfname)
        {
                do_the_dirty_job_on($pdfFile);
        }

}

exit(1);

sub do_the_dirty_job_on
{
  my $file = shift;
  my $PDFfile = PDF->new($file);
  if ($PDFfile->IsaPDF)
  {
        print "File $file has ",$PDFfile->Pages," page",$PDFfile->Pages
> 1
? "s" :"","\n";
        print $file,":",$PDFfile->Pages,"\n";
        my $PDFPages = $PDFfile->Pages;
        my $newpgcount = $PDFPages -2;
        my $newfile;
        unless (-d '$newpgcount')
        {
                mkdir($newpgcount);
                $newfile = "/$newpgcount/$file";
                move($file,$newfile) or die "move failed: $!";
                #rename($file,$newfile) or die "move failed: $!";
                #system("move","$file","/$newpgcount/$file") or die
"move failed:
$!";
                #unlink($file) or die "delete failed: $!";
        }
        else
        {
                $newfile = "/$newpgcount/$file";
                move($file,$newfile) or die "move failed: $!";
                #rename($file,$newfile) or die "move failed: $!";
                #system("move","$file","/$newpgcount/$file") or die
"move failed:
$!";
                #unlink($file) or die "delete failed: $!";
        }
  }
  else
  {
    print "File $file isn't a PDF file\n";
  }
}

###########################

I have left in the commented lines that I have tried for you to see the
different steps that I have taken.

Thanks in advance for your help and advise.

--Ken



------------------------------

Date: Fri, 10 Nov 2006 11:21:53 -0600
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Permission Denied error when moving files - Perl
Message-Id: <4554b53e$0$502$815e3792@news.qwest.net>

Ken wrote:
>[...]   When trying to move/copy
> & delete I get a Permission Denied error from the script.
> 
> Here's my script for you to review:

Since PDF isn't your issue, narrow down the problem by
removing all the extra code, which will simplify the
issue for you and us.

>         my $newfile;
>         unless (-d '$newpgcount')
>         {
>                 mkdir($newpgcount);
>                 $newfile = "/$newpgcount/$file";

That initial '/' is probably the problem.

>                 move($file,$newfile) or die "move failed: $!";

To see the issue, change that to a more helpful error message:

     move( $file, $newfile )
          or die "move( $file, $newfile ) failed: $!";


------------------------------

Date: 10 Nov 2006 09:57:56 -0800
From: "Ken" <kstulce@gmail.com>
Subject: Re: Permission Denied error when moving files - Perl
Message-Id: <1163181476.051312.96690@h54g2000cwb.googlegroups.com>

J. Gleixner,

Thanks for your reply.

Per your advise, below is the exact message from the command prompt:
##########
D:\Scripts>perl Copy_pdf_pages.pl
File mcp_1678576.pdf has 3 pages
mcp_1678576.pdf:3
move( mcp_1678576.pdf, D:\Scripts\1\mcp_1678576.pdf ) failed:
Permission denied
at Copy_pdf_pages.pl line 61.
##########

Line 61 contains: move($file,$newfile) or die "move( $file, $newfile )
failed: $!";.
I changed line 60 to this: $newfile = "$newpgcount/$file";.

I have tried moving the file in a command prompt and that worked fine,
so I'm baffled why Perl is not able to move the file.

Any other suggestions?

Thanks again for your help.

--Ken

On Nov 10, 11:21 am, "J. Gleixner" <glex_no-s...@qwest-spam-no.invalid>
wrote:
Since PDF isn't your issue, narrow down the problem by
removing all the extra code, which will simplify the
issue for you and us.

>         my $newfile;
>         unless (-d '$newpgcount')
>         {
>                 mkdir($newpgcount);
>                 $newfile = "/$newpgcount/$file";

That initial '/' is probably the problem.

>                 move($file,$newfile) or die "move failed: $!";

To see the issue, change that to a more helpful error message:

     move( $file, $newfile )
          or die "move( $file, $newfile ) failed: $!";



------------------------------

Date: 10 Nov 2006 18:22:03 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: Permission Denied error when moving files - Perl
Message-Id: <4rjuabFrikmpU1@mid.dfncis.de>

Ken <kstulce@gmail.com> wrote in comp.lang.perl.misc:
> Hello,
> 
> I have a script that is reading the contents of a directory, only for
> files with a *.PDF extension.  Once the files names are read into a
> list, the pdf's are looked at to determine the number of pages in the
> file.  Based on the number of pages, I'm wanting a new directory to be
> created or used, if it already exists, and move the pdf files with the
> matching number of pages into the directory.  When trying to move/copy
> & delete I get a Permission Denied error from the script.
> 
> Here's my script for you to review:
> ###########################
> use strict;
> use warnings;
> 
> use File::chmod;
> use Cwd;
> use Carp;
> use Getopt::Long;
> use PDF;
> use POSIX;
> use File::Copy;
> use File::Basename;
> 
> # find out current working directory
> my $cwd = getcwd;
> #print "$cwd\n";
> 
> opendir(DIR, "$cwd") || die ("Unable to open directory");

There's no need to quote $cwd.  See perldoc -q quoting.

Incidentally, you don't need the working directory explicitly, '.'
will do nicely.

> my @pdfname = grep { /\.pdf$/ } readdir(DIR);
> closedir(DIR);
> 
> # Find all files with "*.pdf" extension
> #my @pdfname = glob("*.pdf");
> my $pdfcount = @pdfname;
> my $pdfFile;
> if($pdfcount != 0)

It's unnecessary to check for the existence of files.  The loop below
will simply not run if there aren't any.

> {
>         foreach $pdfFile(@pdfname)
>         {
>                 do_the_dirty_job_on($pdfFile);
                                      ^^^^^^^^
This is probably your error.  $pdfFile holds only the file name relative
to the directory $cwd.  So to access the file, you'd need

                  do_the_dirty_job_on("$cwd/$pdfFile");

[rest snipped]

Anno


------------------------------

Date: Fri, 10 Nov 2006 12:31:08 -0600
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Permission Denied error when moving files - Perl
Message-Id: <4554c579$0$508$815e3792@news.qwest.net>

Ken wrote:
> J. Gleixner,
> 
> Thanks for your reply.

Sure.  Thanks in advance for not top-posting again. :-)

> 
> Per your advise, below is the exact message from the command prompt:
> ##########
> D:\Scripts>perl Copy_pdf_pages.pl
> File mcp_1678576.pdf has 3 pages
> mcp_1678576.pdf:3
> move( mcp_1678576.pdf, D:\Scripts\1\mcp_1678576.pdf ) failed:
> Permission denied
> at Copy_pdf_pages.pl line 61.
> ##########
> 
> Line 61 contains: move($file,$newfile) or die "move( $file, $newfile )
> failed: $!";.
> I changed line 60 to this: $newfile = "$newpgcount/$file";.
> 
> I have tried moving the file in a command prompt and that worked fine,
> so I'm baffled why Perl is not able to move the file.

I took at look at your script again..

 > unless (-d '$newpgcount')

Change that to:

    unless( -d $newpgcount )

Also, if

$newpgcount=1;
$newfile = "$newpgcount/$file"

Then I'd think

die "move( $file, $newfile ) failed: $!";

Would print:

move( mcp_1678576.pdf, 1/mcp_1678576.pdf ) failed: Permission denied

but.. if the above change to your unless fails, then try something 
simple, as I suggested before.

e.g. ensure the directory '1' exists and you have permissions to create 
files there.

use File::Copy;
my $file = 'mcp_1678576.pdf';
my $newfile = "1/$file";
move( $file, $newfile )
     or die "move( $file, $newfile ) failed: $!";


------------------------------

Date: Fri, 10 Nov 2006 18:03:31 +0100
From: Bernd Fischer <bernd.fischer@xignalerif.r'4054-50];p5.de>
Subject: Reading config file with line break character?
Message-Id: <4rjpncFrnke3U1@mid.individual.net>

Hi,

I have a config file with a key value pair

KEY = VALUE

which I read in with

while ( <CONFIG> ) {
	chomp;					# no newline
	s/#.*//;				# no comment
	s/^\s+//;				# no leading withespaces
	s/\s+$//;				# no ending withespaces
	next unless length;			# unless something to read
	( $var, $value )	=	split( /\s*=\s*/, $_, 2 );
	$preferences{ $var }	=	$value;
}

I'm now looking for a solution to read something like

KEY = VALUE1 VALUE2 VALUE3 \
       VALUE4 VALUE5

How to modify the regular expressions to accept '\' as a
intentionally linebreak character?

Thanks Bernd


------------------------------

Date: Fri, 10 Nov 2006 17:31:27 +0000
From: Andy Hassall <andy@andyh.co.uk>
Subject: Re: Reading config file with line break character?
Message-Id: <qjd9l21rtq0ll93aqq7vvp33vk020dpsel@4ax.com>

On Fri, 10 Nov 2006 18:03:31 +0100, Bernd Fischer
<bernd.fischer@xignalerif.r'4054-50];p5.de> wrote:

>I have a config file with a key value pair
>
>KEY = VALUE
>
>which I read in with
>
>while ( <CONFIG> ) {
>	chomp;					# no newline
>	s/#.*//;				# no comment
>	s/^\s+//;				# no leading withespaces
>	s/\s+$//;				# no ending withespaces
>	next unless length;			# unless something to read
>	( $var, $value )	=	split( /\s*=\s*/, $_, 2 );
>	$preferences{ $var }	=	$value;
>}
>
>I'm now looking for a solution to read something like
>
>KEY = VALUE1 VALUE2 VALUE3 \
>       VALUE4 VALUE5
>
>How to modify the regular expressions to accept '\' as a
>intentionally linebreak character?

 Accumulate partial lines in a variable and go back around the loop. For
example:

my $line = '';
while ( <CONFIG> ) {
	chomp;					# no newline
	s/#.*//;				# no comment
	s/^\s+//;				# no leading withespaces
	s/\s+$//;				# no ending withespaces
	next unless length;			# unless something to read

	if (s/\s+\\$/ /) {                      # multi-line expression
	    $line .= $_;
	    next;
	}

        # use $line in the split (may contain multiple previous lines)
	( $var, $value )	=	split( /\s*=\s*/, $line . $_, 2 );
	$preferences{ $var }	=	$value;
	$line = ''; # clear accumulated lines
}

 Whether this does what you expect with multi-line expressions with blank lines
or comments in them is up to you. There's also probably more elegant ways of
doing it, perhaps by modifying the while() condition and pushing the partial
lines back onto the source of lines there.

-- 
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool


------------------------------

Date: Fri, 10 Nov 2006 18:55:37 +0100
From: Bernd Fischer <bernd.fischer@xignalerif.r'4054-50];p5.de>
Subject: Re: Reading config file with line break character?
Message-Id: <4rjsopFrracdU1@mid.individual.net>

Thanks I got it.

Bernd


------------------------------

Date: Fri, 10 Nov 2006 18:05:14 +0000
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: simple regular expression
Message-Id: <g693b8rw52d.fsf@lifelogs.com>

On  8 Nov 2006, asandstrom@accesswave.ca wrote:

> There's a time and a place for regular expressions. But the string
> functions exist for a reason and sometimes they're better.

Are there any cases (within the scope of intended usage--fixed offsets
and search strings) that index, length, and substr are slower than
regular expressions?  I don't know of any, and I'm curious.

Ted


------------------------------

Date: 10 Nov 2006 03:44:06 -0800
From: neil.holmes@zoom.co.uk
Subject: SOAP::LITE
Message-Id: <1163159046.159066.35450@k70g2000cwa.googlegroups.com>

I am trying to make use of SOAP::LITE for calling Web Services from
Perl.

I have Windows and Linux Installations.

On Windows the following works fine :-

#!/usr/local/bin/perl
 use SOAP::Lite;
  print SOAP::Lite
    -> service('http://neilvmes3:8082/ws/EcsAddEntry?wsdl')
    -> TK_ADD_ENTRY('Neil Holmes','Greatest Hits
Volume','CD','9.99','www.proiv.com');

The data is added to the application behind the web services and a
success flag is returned.

The Linux version of the same call :-

#!perl
  use SOAP::Lite;
  print SOAP::Lite
    -> service('http://neilvmes3:8082/ws/EcsAddEntry?wsdl')
    -> TK_ADD_ENTRY('Neil Holmes','Greatest
Hits','CD','9.99','www.proiv.com');

Appears to run (no errors) but the application is not updated and no
success flag is returned.

Does anyone have some suggestions as to what might be causing this ? Or
what I can do to try and track down the problem.

Any suggestions very greatfully received.

Many Thanks

Neil



------------------------------

Date: Fri, 10 Nov 2006 10:08:33 -0600
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: SOAP::LITE
Message-Id: <4554a40d$0$63458$815e3792@news.qwest.net>

neil.holmes@zoom.co.uk wrote:
> I am trying to make use of SOAP::LITE for calling Web Services from
> Perl.
> 
> I have Windows and Linux Installations.
> 
> On Windows the following works fine :-
> 
> #!/usr/local/bin/perl
>  use SOAP::Lite;
>   print SOAP::Lite
>     -> service('http://neilvmes3:8082/ws/EcsAddEntry?wsdl')
>     -> TK_ADD_ENTRY('Neil Holmes','Greatest Hits
> Volume','CD','9.99','www.proiv.com');
> 
> The data is added to the application behind the web services and a
> success flag is returned.
> 
> The Linux version of the same call :-
> 
> #!perl
   ^^^^^^  Why isn't this the same as above?

>   use SOAP::Lite;
>   print SOAP::Lite
>     -> service('http://neilvmes3:8082/ws/EcsAddEntry?wsdl')
>     -> TK_ADD_ENTRY('Neil Holmes','Greatest
> Hits','CD','9.99','www.proiv.com');
> 
> Appears to run (no errors) but the application is not updated and no
> success flag is returned.
> 
> Does anyone have some suggestions as to what might be causing this ? Or
> what I can do to try and track down the problem.

Same versions of SOAP::Lite?

How do you know there aren't any errors?  I don't see any error handling 
in your example.

Check the logs on neilvmes3's Web server.

Add logging to the service.

Adding +trace (see documentation) will show you what's being sent and 
received.


------------------------------

Date: Fri, 10 Nov 2006 11:59:58 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: using grep in Perl
Message-Id: <2RZ4h.3671$Ue.483@trndny03>

Kimi wrote:
> The command  ---> ps -awwwx | grep 'Applications\|System' gives the
> list of process which has Application OR System
>
> When i try to use the similar expression in my Perl scripts, I am not
> getting the expected output. Are the syntax different in perl?

Of coure it is. After all the language is Perl instead of ksh or csh or tcsh 
or ...

> The corresponding line for grepping in my perl read as ---->
>
> my $output = ` cat $accumulated_mail_body | grep
> 'Application\|System\|Corrupt block' | sort | uniq -c`;

Why are you trying so hard to program shell in Perl?
- perldoc -f grep
- perldoc -f sort
- perldoc -q duplicate

Oh, yes, and as for your RegEx
- perldoc perlretut
but you are not using Perl's grep there, you know that, do you?

jue
 




------------------------------

Date: Fri, 10 Nov 2006 14:18:38 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: using grep in Perl
Message-Id: <2T%4h.51493$P7.1915@edtnps89>

Kimi wrote:
> 
> I am trying to use grep mutiple values using grep command in my perl
> script.
> 
> The command  ---> ps -awwwx | grep 'Applications\|System' gives the
> list of process which has Application OR System
> 
> When i try to use the similar expression in my Perl scripts, I am not
> getting the expected output. Are the syntax different in perl? Can
> somebody help me out in this case...
> 
> The corresponding line for grepping in my perl read as ---->
> 
> my $output = ` cat $accumulated_mail_body | grep
> 'Application\|System\|Corrupt block' | sort | uniq -c`;

In Perl that would be written as:

open my $fh, '<', $accumulated_mail_body
    or die "Cannot open '$accumulated_mail_body' $!";

my %uniq;
while ( <$fh> ) {
    $uniq{ $_ }++ if /Application|System|Corrupt block/;
    }
close $fh;

my $output = join '', map "$uniq{$_} $_", sort keys %uniq;




John
-- 
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order.       -- Larry Wall


------------------------------

Date: Fri, 10 Nov 2006 17:11:27 +0000
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: What is more detailled than $^O ?
Message-Id: <g69ejsbw7k0.fsf@lifelogs.com>

On  7 Nov 2006, ynl@nsparks.net wrote:

> In article <g69u01bxksg.fsf@lifelogs.com>, tzz@lifelogs.com says...
>> Well then that's too bad for you :)  You can't just decide that
>> reality should suit you.  Either you test for the features you want,
>> or you write unreliable code.  Anyhow, what you are saying below leads
>> me to believe you don't really need to know about OS features.
>>
>
> You surely know the sentence : "Tell me what you need and I'll tell you
> how to do without"... Really and independently to the kindly of your 
> post, I'll don't debate about the pertinence or not of the choice, but 
> how to achieve this precise choice : I'm not alone here, but just the 
> one who has to achieve this specific choice these days... So, I'll do it 
> whatever be the way to succeed... 

That's great.  Just remember, the right solution is not always the one
that works immediately, or the easiest one.  Sometimes, in Perl as in
life in general, you have to see past the immediate problem and
anticipate the problems you'll have later because of a fast/easy
solution now.  

Just because your team thinks fast/easy is right doesn't make it the
right choice, either.  Sometimes you have to stop the team if they are
walking off a cliff blindfolded ("but it's downhill!").

Ted


------------------------------

Date: 10 Nov 2006 08:38:39 -0800
From: "EL34" <hoffmanamps@citcom.net>
Subject: Win32::Internet fetch url question
Message-Id: <1163176719.844046.214150@e3g2000cwe.googlegroups.com>

I have an app that goes out to my company web site and checks a file to

see if an order has been placed on my shopping cart.

Everything works fine unless the server is down, is being re-booted,
etc.


My perl app hangs up and I cannot exit it unless I kill the Perl
process in windows.


I am using fetch to open the file.
$INET->FetchURL("$FileOnServer");


Is there a way to
see if a files exist on a server or if,
if the internet connection is down or,
any sort of reason why Perl cannot fetch the file within say 10
seconds?


I looked over the win32::internet docs but I don't quite understand how

to go about doing this.
a short example would be much appreciated. 
thanks



------------------------------

Date: Fri, 10 Nov 2006 11:11:17 -0600
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Win32::Internet fetch url question
Message-Id: <4554b2c1$0$10304$815e3792@news.qwest.net>

EL34 wrote:
[...]
> I am using fetch to open the file.
> $INET->FetchURL("$FileOnServer");

Next time, show the code that creates $INET.


> Is there a way to
> see if a files exist on a server or if,
> if the internet connection is down or,
> any sort of reason why Perl cannot fetch the file within say 10
> seconds?
> 
> 
> I looked over the win32::internet docs but I don't quite understand how
> 
> to go about doing this.
> a short example would be much appreciated. 

Maybe you should look through the documentation for Win32::Internet, 
instead. :-)

I've never used it, however I took a few seconds and searched the 
documentation for 'timeout', and found a 'ConnectTimeout' method.  That 
should provide you with a solution.


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 9951
***************************************


home help back first fref pref prev next nref lref last post