[29565] in Perl-Users-Digest
Perl-Users Digest, Issue: 809 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 30 16:09:46 2007
Date: Thu, 30 Aug 2007 13:09:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 30 Aug 2007 Volume: 11 Number: 809
Today's topics:
Re: 2D array of real numbers <stoupa@practisoft.cz>
Re: Appending a character to a field bokjasong@gmail.com
Re: Appending a character to a field <jurgenex@hotmail.com>
Re: Appending a character to a field bokjasong@gmail.com
Re: Appending a character to a field <jurgenex@hotmail.com>
Re: Appending a character to a field bokjasong@gmail.com
Re: Appending a character to a field <anno4000@radom.zrz.tu-berlin.de>
Re: Appending a character to a field <jurgenex@hotmail.com>
Re: great and better hash eval <john.swilting@wanadoo.fr>
How to continue process without waiting for the output <zencod@gmail.com>
Re: How to continue process without waiting for the out <Narthring@gmail.com>
Re: How to continue process without waiting for the out xhoster@gmail.com
Re: Important Research Project <cbfalconer@yahoo.com>
Re: Important Research Project <dave.willmer@gmail.com>
Memory leaks with SOAP Lite <jrpfinch@gmail.com>
Re: Memory leaks with SOAP Lite <jrpfinch@gmail.com>
Re: Searching in a line <lerameur@yahoo.com>
Re: Searching in a line <paduille.4061.mumia.w+nospam@earthlink.net>
Re: Searching in a line <lerameur@yahoo.com>
Re: Searching in a line <uri@stemsystems.com>
Re: Searching in a line <jurgenex@hotmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 30 Aug 2007 16:44:57 +0200
From: "Petr Vileta" <stoupa@practisoft.cz>
Subject: Re: 2D array of real numbers
Message-Id: <fb6luk$6oc$1@ns.felk.cvut.cz>
John W. Krahn wrote:
> Petr Vileta wrote:
>>> $no_rows = 50;
>>> $no_columns = 63;
>>
>> my $no_rows = 50;
>> my $no_columns = 63;
>> my @row=(0.0)x$no_columns;
>> my @array=([@row])x$no_rows;
>
> You are making $no_rows copies of the *same* anonymous array so any
> change to $array[0] will also show up in $array[1] and $array[2] and
> $array[3] and etc.
Right ;-)
my $no_rows = 50;
my $no_columns = 63;
my @row=(0.0)x$no_columns;
my @array;
foreach (1..$no_rows) { push @array,[@row]; }
>> But you must address element as $array[row]->[col] instead of
>> $array[row][col].
>
Right too. I remember that in some case $array[row][col] generate error at
runtime, some like "$array[row][col] is not allowed while use strict refs",
but I forgot details and context.
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
------------------------------
Date: Thu, 30 Aug 2007 15:29:50 -0000
From: bokjasong@gmail.com
Subject: Re: Appending a character to a field
Message-Id: <1188487790.037813.305880@r23g2000prd.googlegroups.com>
Hi Ben,
Thanks for your various suggestions. I embedded all of them into my
code but I cannot figure out how to push "$_%" onto my array. I keep
getting some syntax error when I tried with push(@df, $_%). Could you
give me some example?
Thank you.
- Bok
> To add the % back on, the simplest means is to push "$_%" onto your
> array instead of $_. A better answer may be to use the Filesys::Df or
> Filesys::DfPortable module, and get the information straight from
> statvfs(2) without needing to invoke df(1).
>
> Ben
------------------------------
Date: Thu, 30 Aug 2007 15:45:54 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Appending a character to a field
Message-Id: <SCBBi.6424$J65.2040@trndny08>
bokjasong@gmail.com wrote:
> getting some syntax error when I tried with push(@df, $_%). Could you
> give me some example?
$_ = 'whatever';
print "$_%";
jue
------------------------------
Date: Thu, 30 Aug 2007 16:06:18 -0000
From: bokjasong@gmail.com
Subject: Re: Appending a character to a field
Message-Id: <1188489978.916382.227730@i38g2000prf.googlegroups.com>
Hi Jurgen,
Thanks for your suggestion but I need to add the % sign back to the
5th field of the df output. If I do print "$_%" then I think % will be
appended to the very last field for the filesystem mount points.
- Bok
On Aug 30, 8:45 am, "J=FCrgen Exner" <jurge...@hotmail.com> wrote:
> bokjas...@gmail.com wrote:
> > getting some syntax error when I tried with push(@df, $_%). Could you
> > give me some example?
>
> $_ =3D 'whatever';
> print "$_%";
>
> jue
------------------------------
Date: Thu, 30 Aug 2007 16:11:55 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Appending a character to a field
Message-Id: <f%BBi.7515$sg5.6955@trndny07>
bokjasong@gmail.com wrote:
> On Aug 30, 8:45 am, "Jürgen Exner" <jurge...@hotmail.com> wrote:
>> bokjas...@gmail.com wrote:
>>> getting some syntax error when I tried with push(@df, $_%). Could
>>> you give me some example?
>>
>> $_ = 'whatever';
>> print "$_%";
>>
> Thanks for your suggestion but I need to add the % sign back to the
> 5th field of the df output.
Dude,
besides the different function do you notice any other difference between
push(@df, $_%)
and
print "$_%"
Hint: how do you denote a string with variable interpolation?
Oh, and BTW:
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
jue
------------------------------
Date: Thu, 30 Aug 2007 17:07:05 -0000
From: bokjasong@gmail.com
Subject: Re: Appending a character to a field
Message-Id: <1188493625.613535.181820@r23g2000prd.googlegroups.com>
On Aug 30, 9:11 am, "J=FCrgen Exner" <jurge...@hotmail.com> wrote:
> bokjas...@gmail.com wrote:
> > On Aug 30, 8:45 am, "J=FCrgen Exner" <jurge...@hotmail.com> wrote:
> >> bokjas...@gmail.com wrote:
> >>> getting some syntax error when I tried with push(@df, $_%). Could
> >>> you give me some example?
>
> >> $_ =3D 'whatever';
> >> print "$_%";
>
> > Thanks for your suggestion but I need to add the % sign back to the
> > 5th field of the df output.
>
> Dude,
>
> besides the different function do you notice any other difference between
> push(@df, $_%)
> and
> print "$_%"
>
> Hint: how do you denote a string with variable interpolation?
>
> Oh, and BTW:
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?
> A: Top-posting.
> Q: What is the most annoying thing on usenet and in e-mail?
>
> jue
Jue,
I didn't clearly specify and simplified the last part with a print but
I push $_ to @df and then have another block that follows, which is
outside the while loop, to send @df by sendmail, so I need to take
care of @df inside the while loop with % added back.
Thanks.
- Bok
------------------------------
Date: Thu, 30 Aug 2007 19:47:25 +0200
From: Anno Siegel <anno4000@radom.zrz.tu-berlin.de>
Subject: Re: Appending a character to a field
Message-Id: <5joe5dFij9kU1@mid.dfncis.de>
On 2007-08-29 22:22:31 +0200, bokjasong@gmail.com said:
>
>
> Hi,
>
>
> I'm a perl newbie and would like to ask this question.
>
> Let's say I have the following code. Trying to check the disk space,
> it's to truncate the percent sign % from the df -k output, compare the
> percentage field to see if it's bigger than 90%, and grasp only those
> lines that are and push those to an array @df. But how can I add the
> percentage sign back to the percentage field on each line for the
> proper output? I put down ??????? as below to find out what regexp
> needs to be there in the below.
>
>
> $percent=90;
>
> open(DFOUT, "/usr/bin/df -k|");
> while (<DFOUT>) {
> next if ($_ =~ /Filesystem/i);
> s/\%//; # to remove the percent sign for comparison
> if ( (split)[4] >= $percent ) {
> ???????
> push(@df, $_);
> }
> }
>
> print "@dfoutput\n";
You can use the percent character to single out the number without
removing it.
my $percent = 90;
my @dfoutput;
open(DFOUT, "/bin/df -k|");
while (<DFOUT>) {
my $perc_full;
next unless ( $perc_full) = /(\d+)%/ and $perc_full >= $percent;
push @dfoutput, $_;
}
print "@dfoutput\n";
or, more compact:
my @dfoutput = grep {
my $perc_full;
( $perc_full) = /(\d+)%/ and $perc_full >= $percent;
} `/bin/df`;
It skips lines that have no "%" (the header line) and those that are below
the percentage limit.
Anno
------------------------------
Date: Thu, 30 Aug 2007 18:39:38 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Appending a character to a field
Message-Id: <K9EBi.6442$J65.5044@trndny08>
bokjasong@gmail.com wrote:
> On Aug 30, 9:11 am, "Jürgen Exner" <jurge...@hotmail.com> wrote:
>> bokjas...@gmail.com wrote:
>>> On Aug 30, 8:45 am, "Jürgen Exner" <jurge...@hotmail.com> wrote:
>>>> bokjas...@gmail.com wrote:
>>>>> getting some syntax error when I tried with push(@df, $_%). Could
>>>>> you give me some example?
>>
>>>> $_ = 'whatever';
>>>> print "$_%";
>>
>>> Thanks for your suggestion but I need to add the % sign back to the
>>> 5th field of the df output.
>>
>> Dude,
>>
>> besides the different function do you notice any other difference
>> between push(@df, $_%)
>> and
>> print "$_%"
>>
>> Hint: how do you denote a string with variable interpolation?
>
> I didn't clearly specify and simplified the last part with a print but
> I push $_ to @df and then have another block that follows, which is
> outside the while loop, to send @df by sendmail, so I need to take
> care of @df inside the while loop with % added back.
Ok, ok, spoonfeeding:
C:\tmp>type t.pl
push (@df, $_%);
C:\tmp>perl -c t.pl
syntax error at t.pl line 1, near "%)"
t.pl had compilation errors.
C:\tmp>type t.pl
push (@df, "$_%");
C:\tmp>perl -c t.pl
t.pl syntax OK
Do you see the difference now?
Aside of that IMNSHO you are still going about your general task in a very
odd way.
Several people have pointed out different and IMO much better ways to
compare the percentage value.
I am asking again: what about simply ignoring the percentage sign? Perl will
take care of the value automatically:
my $limit = 90;
my @df = ('80%', '95%', '7%', '100%', 'garbage');
for (@df) {
print "$_\n" if $_ > $limit;}
prints
95%
100%
just as you would expect. Sure, you have to disable warnings in that block,
because otherwise you will get a "Argument ... isn't numeric" warning. But
so what?
jue
------------------------------
Date: Thu, 30 Aug 2007 17:30:10 +0200
From: john swilting <john.swilting@wanadoo.fr>
Subject: Re: great and better hash eval
Message-Id: <46d6e283$0$27386$ba4acef3@news.orange.fr>
Michele Dondi wrote:
> On Wed, 29 Aug 2007 16:25:23 +0200, john swilting
> <john.swilting@wanadoo.fr> wrote:
>
>>Michele Dondi wrote:
> [snip]
>>> Yep, except that the verb "arribaltare" does not exist, but may sound
>>> like a dialectal form of "ribaltare" and "copperchio" should be
>>> written with one "p". Oh, and although the whole phrase is
>>> syntactically correct in Italian, it also sounds somewhat strange with
>>> the verbs at infinitive. But I understood it in the sense of: throw
>>> this into the water closet and flush. All in all, if I got it right,
>>> the most comprehensible of the OP's posts thus far. (Hence the
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
>>1/88 day
>
> What was I saying?
>
>
> Michele
00:16:22
00:32:44
00:49:05
01:05:27
01:21:49
01:38:11
01:54:33
02:10:55
02:27:16
02:43:38
03:00:00
03:16:22
03:32:44
03:49:05
04:05:27
04:21:49
04:38:11
04:54:33
05:10:55
05:27:16
05:43:38
06:00:00
06:16:22
06:32:44
06:49:05
07:05:27
07:21:49
07:38:11
07:54:33
08:10:55
08:27:16
08:43:38
09:00:00
09:16:22
09:32:44
09:49:05
10:05:27
10:21:49
10:38:11
10:54:33
11:10:55
11:27:16
11:43:38
12:00:00
12:16:22
12:32:44
12:49:05
13:05:27
13:21:49
13:38:11
13:54:33
14:10:55
14:27:16
14:43:38
15:00:00
15:16:22
15:32:44
15:49:05
16:05:27
16:21:49
16:38:11
16:54:33
17:10:55
17:27:16
17:43:38
18:00:00
18:16:22
18:32:44
18:49:05
19:05:27
19:21:49
19:38:11
19:54:33
20:10:55
20:27:16
20:43:38
21:00:00
21:16:22
21:32:44
21:49:05
22:05:27
22:21:49
22:38:11
22:54:33
23:10:55
23:27:16
23:43:38
00:00:00
------------------------------
Date: Thu, 30 Aug 2007 07:57:23 -0700
From: Cod <zencod@gmail.com>
Subject: How to continue process without waiting for the output of system()?
Message-Id: <1188485843.516378.166530@x40g2000prg.googlegroups.com>
For example , I wrote:
system("calc");
print "hello";
Before the calc program is closed, the print statement will not
excute.
Any way to change the behavior?
I have tried fork, and system("calc&"), all failed.
My OS is WinXP, and I use Active Perl 5.8.8.
Thanks for your help!
------------------------------
Date: Thu, 30 Aug 2007 08:45:45 -0700
From: Narthring <Narthring@gmail.com>
Subject: Re: How to continue process without waiting for the output of system()?
Message-Id: <1188488745.144899.79710@w3g2000hsg.googlegroups.com>
On Aug 30, 9:57 am, Cod <zen...@gmail.com> wrote:
> For example , I wrote:
>
> system("calc");
> print "hello";
>
> Before the calc program is closed, the print statement will not
> excute.
>
> Any way to change the behavior?
> I have tried fork, and system("calc&"), all failed.
>
> My OS is WinXP, and I use Active Perl 5.8.8.
>
> Thanks for your help!
If you want to use threads this will work:
use strict;
use warnings;
use threads;
my $thread = threads->create(sub { thread()});
print "hello\n";
$thread->join();
sub thread{
system("calc");
1;
}
------------------------------
Date: 30 Aug 2007 16:41:05 GMT
From: xhoster@gmail.com
Subject: Re: How to continue process without waiting for the output of system()?
Message-Id: <20070830124106.986$ah@newsreader.com>
Cod <zencod@gmail.com> wrote:
> For example , I wrote:
>
> system("calc");
> print "hello";
Without a newline in the print, you have to careful that buffering
isn't going to get you.
>
> Before the calc program is closed, the print statement will not
> excute.
>
> Any way to change the behavior?
> I have tried fork, and system("calc&"), all failed.
What do you mean by "failed"?
>
> My OS is WinXP, and I use Active Perl 5.8.8.
H:\>perl -e "fork or do {system('calc'); exit}; $|=1; print 'hello' "
Does what I expect.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Thu, 30 Aug 2007 09:45:50 -0400
From: CBFalconer <cbfalconer@yahoo.com>
Subject: Re: Important Research Project
Message-Id: <46D6CA0E.E66ED5C8@yahoo.com>
"E.D.G." wrote:
>
> This report is being posted to a number of Internet Newsgroups to
> see if there are any experienced computer programmers who would
> like to provide some assistance with an effort to develop a Perl
> language computer program.
Where is Perl described in the C standard? This seems rather OT.
--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>
--
Posted via a free Usenet account from http://www.teranews.com
------------------------------
Date: Thu, 30 Aug 2007 18:55:39 -0000
From: dave_w <dave.willmer@gmail.com>
Subject: Re: Important Research Project
Message-Id: <1188500139.411988.127100@q5g2000prf.googlegroups.com>
On Aug 30, 2:54 pm, Paul McGuire <pt...@austin.rr.com> wrote:
> On Aug 30, 8:12 am, "E.D.G." <edgrs...@ix.netcom.com> wrote:
>
> > Important Research Project (Related to computer programming)
>
> > Posted by E.D.G. on August 30, 2007 edgrs...@ix.netcom.com
>
> > This report is being posted to a number of Internet Newsgroups
>
> Always the hallmark of a considerate poster.
>
> > to see if
> > there are any experienced computer programmers who would like to provide
> > some assistance with an effort to develop a Perl language computer program.
>
> > Interested parties can try contacting me by e-mail or by posting a
> > response note to the comp.lang.perl.misc newsgroup. They would need to
> > download a recent (free) MSI copy of Perl from the ActiveState Web site and
> > get it running on a Windows XP or Vista system.
>
> >http://www.activestate.com
>
> This is a little backwards, one usually presents their research topic
> *first* and their contact info *last*. The reason? SO PEOPLE KNOW
> WHAT THE @#$(&#!@ YOU ARE WORKING ON! Ok, I'll bite, keep reading...
>
> > I am presently using Perl 5.8.8
>
> Whoop-de-doo for you.
>
> > but plan to upgrade to the latest
> > version as soon as possible. People can use Windows 98 if that is the only
> > operating system available. Perl also runs on other operating systems. But
> > at this time I specifically need help with the Windows version.
>
> I suspect Perl is largely the same Perl on all those platforms. Win
> 98? Is this a zombie spam from the turn of the century?
>
> > The goal is to have a single Perl program (or modules) perform functions
> > that have been done by a sizeable collection of other language programs in
> > the past.
>
> Doing what!? Grrr..., keep reading, there's gotta be a punch line...
>
> > Help is presently needed with learning how to get Perl to generate
> > charts and also produce standalone .exe copies of itself. The plan is to
> > then make those .exe copies available to other scientific researchers around
> > the world for free use along with free use updates when they become
> > available. If other researchers wish to get Perl running on their own
> > computers then they will probably also be given the source code for the
> > original program for free use so that they can do their own development
> > work.
>
> Ohmigod, is Google broken? Or has Perl gone this long and this far
> without support for creating charts and graphs? Sounds like about 10
> minutes of research.
>
> > Perl was originally chosen because it is quite versatile, is a free
> > download, and is supported both by ActiveState and quite a few independent
> > programmers. So other researchers could get their own versions running
> > without having to worry about viruses or cost.
>
> (Why is this posted on all these non-Perl newsgroups, then? I've
> *seen* Perl already, and never want to again!)
>
> > So far the work is fairly advanced. The effort has been underway for at
> > least a decade.
>
> ... and we are just getting around to plotting some data.
>
> > The core data generation program was formally copyrighted
> > several years ago.
>
> Red flag #37 - "formally copyrighted", wooo-ooooh
>
> > My present version of Perl will send data to Windows as
> > if it were being manually typed into the keyboard (important for controlling
> > other programs). And it can directed to respond to most keystrokes even
> > when another program is the active one. Unfortunately, Windows also
> > presently responds to those keystrokes. And that complicates things a bit.
>
> ... and has for the past decade, and I still haven't figured it out.
>
> > Not being a professional computer programmer I have been finding it
> > difficult to get new features such as a chart generating ability merged with
> > and running with Perl. And the entire research project is now being slowed
> > as a result. One of my colleagues has done an extensive amount of work with
> > Basic. And I even offered to pay him to help with the Perl development
> > effort. But after he downloaded a copy of Perl and examined it he decided
> > that this would involve too much effort. I have to agree with him.
>
> Maybe that up-front language choice could stand a review...
>
> > Once it is possible to create charts and .exe versions the plan is for
> > researchers around the world to develop Perl modules for generating a
> > variety of data related to sun, moon, planet, ocean tide crest and trough,
> > and Solid Earth Tide locations. Most of those data can already be generated
> > with other programs. Some of the data are not yet available anywhere as far
> > as I am aware. If the effort is unusually successful the Perl program (or
> > modules) might eventually be converted to CGI programs that will run at one
> > or more Internet Web sites.
>
> AHHH! The "research", I almost forgot! Why is it left to the end of
> the message? And do we still know what the @#(*&$ this "variety of
> data" is for? I'm going to take a wild guess here - earthquake
> prediction? perpetual motion? picking guaranteed-to-win lottery
> numbers?
>
> After a pitch like that, who could not be tempted at the prospect of
> "generating a variety of data related to sun, moon, etc. etc."? Sign
> me up - NOT!
>
> GTFA,
> -- Paul
Thanks for the amusing reply Paul, i think you summed up a few
people's feelings quite fairly, but maybe a little more tact next
time? :-)
I'm going to begin my answer with the age old taboo of 'use a
different language', but since you cross-posted to comp.lang.python, i
feel justified.
so... use python.
you didnt exactly state what you wanted out of the project, so i'm
going to take a few guesses.
if you want astrophysical data, there is a python module which is
based on NASA JPL's ephemerides system, you can find it here:
http://www.cv.nrao.edu/~rfisher/Python/py_solar_system.html
and yes, i know there is Astro::SLA on CPAN.
if you want (basic) ocean/tidal modelling, you can use this (again...
python)
http://geosci.uchicago.edu/~cdieterich/swom/
or take a look at this PDF entitled 'python for assembling climate
modelling toolkits':
www.esmf.ucar.edu/presentations/pres_0305_jacobs.pdf
if you want to connect to online databases etc., using urllib2 (a
standard python module), you can fetch the data you need in only a few
lines of code (and i mean 2 or 3 lines for basic requests)
for plotting... use matplotlib, in most python programmers minds it
has reached legendary status.
if you're still thinking about plotting in Perl, look here
http://biptest.weizmann.ac.il/course/prog/graphics/success.html
it is the graphing page from the Weizmann institute in Israel which
does a course entitled 'Perl programming course for bioinformatics and
internet'; perhaps you could use some of your research money to send
someone on the course?
and if you want to put graphs online, you can use matplotlib server
side to generate a jpg for example, and then show that using html
(again, not very many lines of code).
without knowing exactly what needs accomplished, i ts difficult to
help, but it seems like most of your programming has already been
done, and just needs some code to glue different modules together
(trust me on this one - use python).
with python, matplotlib etc, everything is cross platform, if it is
web-based access you're after, it doesnt matter what platform you
develop on
you also talk about generating standalone .exe files - use py2exe w/
NSIS, or pyInstaller, both of which have tutorials online.
most importantly of all... re-read Paul's post above.
if you don't find it as amusing as the rest of us, here's the gist...
"Ohmigod, is Google broken?"
cheers
Dave
------------------------------
Date: Thu, 30 Aug 2007 07:40:56 -0700
From: jrpfinch <jrpfinch@gmail.com>
Subject: Memory leaks with SOAP Lite
Message-Id: <1188484856.408989.34380@19g2000hsx.googlegroups.com>
I would be interested to know why the following script eats up an ever-
increasing amount of memory. I have tried it with perl 5.8.8 on Intel
Solaris 9, Sparc Solaris 8 and Redhat Linux boxes all with the same
result. Assigned SOAP Lite to a variable and printing that instead
yields the same result.
use strict;
use warnings;
use SOAP::Lite;
while (1)
{
print SOAP::Lite
-> uri("http://172.19.17.252:443")
-> proxy("http://172.19.17.252:443", timeout => 5)
-> kickWatchdog("gerard")
-> result."\n";
sleep 5;
}
Many thanks
Jon
------------------------------
Date: Thu, 30 Aug 2007 09:28:16 -0700
From: jrpfinch <jrpfinch@gmail.com>
Subject: Re: Memory leaks with SOAP Lite
Message-Id: <1188491296.706424.309910@22g2000hsm.googlegroups.com>
Solution is to use the OO version:
use strict;
use warnings;
use SOAP::Lite;
my $soap = SOAP::Lite
-> uri('http://172.19.17.252:443/')
-> proxy('http://172.19.17.252:443/');
my $response;
while (1)
{
$response = $soap
-> kickWatchdog("gerard")
-> result;
print "$response\n";
sleep 5;
}
------------------------------
Date: Thu, 30 Aug 2007 07:28:54 -0700
From: lerameur <lerameur@yahoo.com>
Subject: Re: Searching in a line
Message-Id: <1188484134.210356.192980@r34g2000hsd.googlegroups.com>
On Aug 30, 9:35 am, lerameur <leram...@yahoo.com> wrote:
> On Aug 30, 8:28 am, "J=FCrgen Exner" <jurge...@hotmail.com> wrote:
>
>
>
> > lerameur wrote:
> > > my $log =3D 'file.txt';
> > > open my $fh, '<', $log or die "cannot open '$log': $!\n";
> > > while (<$fh>) {
>
> > > my $val =3D(split( /,/,$log))[3]
> > > print $val, "\n";
>
> > > }
> > > close $fh;
>
> > > getting compilation error.
>
> > Well, the indentation gives it away: the my $val=3D... statement is mis=
sing
> > the trailing semicolon, dude.
>
> > > New to perl, different then C and Basic
>
> > Put neither of those is accepting syntax errors, either.
>
> > jue
>
> Indeed...
> not getting any errors.
> BUt there is no output, when I type >./program_name.pl
> it skips two lines and returns to the prompt.
>
> k
Ok I got it working by removing the $log in the my val line, also
removing the my's
k
------------------------------
Date: Thu, 30 Aug 2007 09:20:14 -0500
From: "Mumia W." <paduille.4061.mumia.w+nospam@earthlink.net>
Subject: Re: Searching in a line
Message-Id: <13ddm28kah37h43@corp.supernews.com>
On 08/30/2007 08:13 AM, lerameur wrote:
>
> Indeed...
> not getting any errors.
> BUt there is no output, when I type >./program_name.pl
> it skips two lines and returns to the prompt.
>
> k
>
Why are your posts duplicated as much as six times?
------------------------------
Date: Thu, 30 Aug 2007 07:53:48 -0700
From: lerameur <lerameur@yahoo.com>
Subject: Re: Searching in a line
Message-Id: <1188485628.412683.190380@w3g2000hsg.googlegroups.com>
On Aug 30, 9:35 am, lerameur <leram...@yahoo.com> wrote:
> On Aug 30, 8:28 am, "J=FCrgen Exner" <jurge...@hotmail.com> wrote:
>
>
>
> > lerameur wrote:
> > > my $log =3D 'file.txt';
> > > open my $fh, '<', $log or die "cannot open '$log': $!\n";
> > > while (<$fh>) {
>
> > > my $val =3D(split( /,/,$log))[3]
> > > print $val, "\n";
>
> > > }
> > > close $fh;
>
> > > getting compilation error.
>
> > Well, the indentation gives it away: the my $val=3D... statement is mis=
sing
> > the trailing semicolon, dude.
>
> > > New to perl, different then C and Basic
>
> > Put neither of those is accepting syntax errors, either.
>
> > jue
>
> Indeed...
> not getting any errors.
> BUt there is no output, when I type >./program_name.pl
> it skips two lines and returns to the prompt.
>
> k
Ok I got it working by removing the $log in the my val line, also
removing the my's
k
------------------------------
Date: Thu, 30 Aug 2007 14:58:00 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Searching in a line
Message-Id: <x7y7ftysqu.fsf@mail.sysarch.com>
>>>>> "l" == lerameur <lerameur@yahoo.com> writes:
l> Ok I got it working by removing the $log in the my val line, also
l> removing the my's
removing my's is not a way to fix perl code. this is like disabling
brakes on a car because you don't want two pedals to deal with.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Thu, 30 Aug 2007 15:50:41 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Searching in a line
Message-Id: <lHBBi.2386$Lz5.801@trndny04>
lerameur wrote:
> On Aug 30, 8:28 am, "Jürgen Exner" <jurge...@hotmail.com> wrote:
>> lerameur wrote:
>>> my $log = 'file.txt';
>>> open my $fh, '<', $log or die "cannot open '$log': $!\n";
>>> while (<$fh>) {
>>
>>> my $val =(split( /,/,$log))[3]
>>> print $val, "\n";
> BUt there is no output, when I type >./program_name.pl
> it skips two lines and returns to the prompt.
That's odd. You should at least have gotten a warning that $val is
undefined. Aren't you using warnings and strict?
Anyway, you are splitting $log which just contains 'file.txt'. Nothing to
split on a comma there. Use $_ instead.
Oh, and BTW: we heard you the first time. No need to flood the NG with a
dozen identical posts.
Oh, and BTW2:
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
jue
------------------------------
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 V11 Issue 809
**************************************