[24032] in Perl-Users-Digest
Perl-Users Digest, Issue: 6229 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Mar 7 09:05:40 2004
Date: Sun, 7 Mar 2004 06:05:07 -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 Sun, 7 Mar 2004 Volume: 10 Number: 6229
Today's topics:
Cheap CPU, RAM. PIV2.8E only US$200!!! " Sales" <hologrammachinery@vsnl.net
Re: CPAN shell complains about MD5 <usenet@morrow.me.uk>
Re: If elsif beautification <perl@my-header.org>
Re: Is it possible to impose a timeout on <>? (Bob Dubery)
Re: need help for a regex (Alex Shi)
Re: Need help with Undeliverable Emails <abcsydney@ans.com.au>
Re: Need info: <gnari@simnet.is>
Re: Perl program and database locked but alive <gnari@simnet.is>
Re: Perl program and database locked but alive <invalid-email@rochester.rr.com>
Re: Perl program and database locked but alive <theforce@forcet.net>
Re: Protecting CGI Scripts <pkent77tea@yahoo.com.tea>
replacing modules? <tmohr@s.netic.de>
Re: replacing modules? (Anno Siegel)
Re: Set::CrossProduct -> random <invalid-email@rochester.rr.com>
Re: Slow Sorting $_@_.%_
Re: Slow Sorting <gnari@simnet.is>
Re: Slow Sorting $_@_.%_
Re: Slow Sorting $_@_.%_
Re: Slow Sorting <tadmc@augustmail.com>
SOAP::Lite in a Safe ? <wherrera@lynxview.com>
Re: socket communication / callback <remove_Hannes.Krueger@uibk.ac.at>
Re: triggering callback from "outside" <xxala_qumsiehxx@xxyahooxx.com>
Re: triggering callback from "outside" <remove_Hannes.Krueger@uibk.ac.at>
Re: Unpack binary file with C Struct to text? (RT)
Using IO::Socket::INET for grabbing web pages (David Morel)
Re: Using IO::Socket::INET for grabbing web pages <theforce@forcet.net>
Video/DVD <marx@netzteil.com>
Re: Video/DVD <pkent77tea@yahoo.com.tea>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 7 Mar 2004 05:26:08 GMT
From: " Sales" <hologrammachinery@vsnl.net
Subject: Cheap CPU, RAM. PIV2.8E only US$200!!!
Message-Id: <c2ebpg$dto1732@imsp212.netvigator.com>
We sell cheap computer hardwares, CPU, RAM, Motherboard etc.
Call: +86 13708077010 for a quote
------------------------------
Date: Sun, 7 Mar 2004 02:10:10 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: CPAN shell complains about MD5
Message-Id: <c2e0a2$l88$1@wisteria.csv.warwick.ac.uk>
Uranus Corporation wrote:
> I was checking out Schilli's ebay code as shown in Feb 04 (European)
> Linux Magazine, and it's got a sidebar titled "ebaywatch requirements"
> directing the use of the CPAN shell (which I've never used before). So
> I figured, heck, this looks simpler than screwing around searching for
> modules, downloading, uncompressing, make-ing, etc etc etc. So... the
> config process seemed to go okay, but when I got to the install
> WWW::Search::Ebay, it complained about MD5 and wouldn't proceed... in
> fact, everything I tried complained about MD5, specifically:
>
> 'Can't locate object method "new" via package MD5
> (perhaps you forgot to load "MD5"?) at
> /usr/lib/local/perl5/5.6.1/CPAN.pm line 4212'
>
> except install MD5, which proclaimed "MD5 is up to date."
>
> Hmmmm... it's up to date, but it's not there. What gives, and how to
> fix it?
Do you have and MD5.pm installed? Where? Is it in your @INC? Is its .so in a
suitable place?
What happens if you 'install Digest::MD5' instead? (MD5.pm is deprecated
in favour of Digest::MD5.)
Ben
--
Razors pain you / Rivers are damp
Acids stain you / And drugs cause cramp. [Dorothy Parker]
Guns aren't lawful / Nooses give
Gas smells awful / You might as well live. ben@morrow.me.uk
------------------------------
Date: Sun, 07 Mar 2004 14:32:56 +0100
From: Matija Papec <perl@my-header.org>
Subject: Re: If elsif beautification
Message-Id: <hv8m40taip6ajdg6vp6v94ech5aghfbvg5@4ax.com>
X-Ftn-To: Chris
Chris <ceo@nospan.on.net> wrote:
>maintainable) that is. This is one of pet peeves -- code that looks
>like garbage (and in general, as a consequence, IS garbage).
>
>It's amazing how much garbagy looking code I see even from so called
>"gurus" (in ANY language). Programming novices need to see more of this
>when the helping hand is given. (Not taking away from the better hashed
>based approach which is better in the case of the actual objective.)
Look at the OP post, it may help you.
></2_CENTS>
Thank God you didn't spend more of it.
--
Matija
------------------------------
Date: 6 Mar 2004 22:55:38 -0800
From: megapode@hotmail.com (Bob Dubery)
Subject: Re: Is it possible to impose a timeout on <>?
Message-Id: <e8f67309.0403062255.601d984d@posting.google.com>
pkent <pkent77tea@yahoo.com.tea> wrote in message news:<pkent77tea-0167A5.11584706032004@pth-usenet-02.plus.net>...
> Here is some example code:
>
> my $line;
> eval {
> alarm($alarmtime);
> $line = <SOCKET>;
> };
> alarm 0; # cancel the alarm
> if ($@) {
> # whatever error handling...
> }
>
> There may be better ways that use lower-level reading functions though.
Many thanks. I'll give this a try.
------------------------------
Date: 6 Mar 2004 22:15:58 -0800
From: chpshi@stonix.com (Alex Shi)
Subject: Re: need help for a regex
Message-Id: <4d4584b9.0403062215.2d520990@posting.google.com>
Many thanks to Tad, it really works for my situation :))
However your post didn't come to my ISP's news server. I found it on
google's news group.
Alex
Tad McClellan <tadmc@augustmail.com> wrote in message news:<slrnc4krnf.k12.tadmc@magna.augustmail.com>...
> Alex Shi <chpshi@stonix.com> wrote:
>
> > I want to retrieve full name, city name, state and country from
>
>
> Errr, what if the "country" does not _have_ "states"?
>
> What if the country's states are not represented with
> two upper case letters?
>
>
> > following string:
> > "(Firstname Lastname - Traverse City, MI United States)"
> >
> > I think maybe a regex can be a solution.
>
>
> ------------------------------------
> #!/usr/bin/perl
> use strict;
> use warnings;
>
> $_ = '(Firstname Lastname - Traverse City, MI United States)';
>
> if ( /\(([^-]*)\s*-\s*([^,]*),\s*([A-Z]{2})\s*([^)]*)/ ) {
> print "name: $1\n";
> print "city: $2\n";
> print "state: $3\n";
> print "country: $4\n";
> }
> ------------------------------------
------------------------------
Date: Sun, 7 Mar 2004 14:51:10 +1100
From: "Paul B" <abcsydney@ans.com.au>
Subject: Re: Need help with Undeliverable Emails
Message-Id: <404a9c2f@daisy.ans.com.au>
Thats to all those who helped.
I have found the answer.
$mailprog = /usr/sbin/sendmail;
open $mailprog -t -t $recipient;
"great places to stay." <nospam@myemail.com> wrote in message
news:404691e4@daisy.ans.com.au...
> Hi,
>
> I do hope there is a person out there that can help.
>
> My problem is when my perl script sends out an email using perls /sendmail
> to one of my users, that have added their email address to one of my forms
> the email is bounced back if it is undeliverable.
>
> The problem I have is my ISP can't work out how to get those bounced
emails
> to be sent back to my email address so I am aware that an email sent by
> /sendmail in perl has not been delivered.
>
> Any help would be greatly appreciated.
>
> Cheers
> Paul
>
>
------------------------------
Date: Sun, 7 Mar 2004 02:04:29 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: Need info:
Message-Id: <c2dvtb$4fe$1@news.simnet.is>
"Sean Holt" <mordist1@cox.net> wrote in message
news:f9a2536.0403061623.61f5f117@posting.google.com...
> Hello,
> What I need to do is to have a Perl script on one server, which
> access another script on a different server through an HTTP request.
> Now, this is the simple part. What I need to do is make the request
> from the persons IP/Host, not the servers. So basically it would look
> like this :
>
> User connects to my server.
> my server connects to 3rd party host/script.
> 3rd party host/script needs to see that users IP/hostnane, not my
> servers.
a) this is not a perl question, as the answer would be the same if
you did this in another language.
b) the www newsgroups would be a more likely place to get a
knowledgeable answer
c) you cannot do this as you describe it.
gnari
------------------------------
Date: Sun, 7 Mar 2004 02:25:46 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: Perl program and database locked but alive
Message-Id: <c2e155$4iv$1@news.simnet.is>
"TF" <theforce@forcet.net> wrote in message news:404a8b09$1@nntp0.pdx.net...
>
>
> I've been basically doing this for two weeks, but it takes a whole day to
> get to this point and the data from the last request and last stored plce
> isn't helping much.
> Once I kill the process, the dbm is screwed so I can't really see
anything.
> All it says is, can't find the end (closing quoute) of data entry or
> something like this, MLDBM error.
> However, I think that is the result of killing the process while it had
the
> db open.
> I can add more logging, but the logfile is liable to fill the disk before
> the error occurs.
you might want to try rotating logs, each one containing one request
cycle. similarly, you could make a copy of your database after each
successfull request.
(this would probably mean a close/backup/reopen sequence that
will probably kill your performance, but I suggest this just as a
debugging tool. or you could do this after every 10 requests)
gnari
------------------------------
Date: Sun, 07 Mar 2004 03:12:26 GMT
From: Bob Walton <invalid-email@rochester.rr.com>
Subject: Re: Perl program and database locked but alive
Message-Id: <404A8C56.5090003@rochester.rr.com>
TF wrote:
...
> I've been basically doing this for two weeks, but it takes a whole day to
> get to this point and the data from the last request and last stored plce
> isn't helping much.
> Once I kill the process, the dbm is screwed so I can't really see anything.
> All it says is, can't find the end (closing quoute) of data entry or
> something like this, MLDBM error.
> However, I think that is the result of killing the process while it had the
> db open.
> I can add more logging, but the logfile is liable to fill the disk before
> the error occurs.
It sounds to me like you just need some basic debugging techniques. If
you are (as previous notes in the thread stated) using LWP to grab info
from a whole bunch of web pages, make a simple log file that writes out
the URL of every page accessed. Set the log file filehandle to
autoflush ($|=1;) so you don't miss the last bufferful when you
terminate the process.
Then, when you know the URL that's generating the problem, retrieve just
that page and use the Perl debugger to see what's up with your code on
that data.
You might note that LWP by default should timeout after 180 seconds, so
if there is a web page that's not responding, the job should still
proceed, albeit slowly. You could change the timeout if it is just an
insufficient patience problem.
Also, you might check to see if the DBM-type implementation you are
using is compatible with your data. Some of the implementations (like
SDMB, for example) have limitations on key and value lengths which MLDBM
could very easily exceed. Consider using DB_File instead (if you aren't
already). You'll probably have to refer to the docs for the specific
DBM-type implementation you are using on your specific platform and OS.
Finally, note that you could close the MLDBM connection in a $SIG{INT}
handler. That way you won't corrupt your database when you kill your
program via the console, assuming you follow proper file locking
protocols in your program and in the signal handler.
HTH.
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
------------------------------
Date: Sat, 6 Mar 2004 19:59:00 -0800
From: "TF" <theforce@forcet.net>
Subject: Re: Perl program and database locked but alive
Message-Id: <404aa5eb@nntp0.pdx.net>
> you might want to try rotating logs, each one containing one request
> cycle. similarly, you could make a copy of your database after each
> successfull request.
> (this would probably mean a close/backup/reopen sequence that
> will probably kill your performance, but I suggest this just as a
> debugging tool. or you could do this after every 10 requests)
>
> gnari
>
The script is still locked and running, though it is using all cpu cycles.
This tells me it's probably in an endless loop.
I discovered that as long as I don't kill this process, I can access and
populate the database O.K. from another script.
I'm not sure I understand this part.
Anyway, I'll turn some logging on around the fault and let it run Monday
again.
It can only run weekdays, at least live runs. Data is different on weekends.
I still also suspect a job running on the network at noon every day as
possibly causing a problem.
What happens if the reply is dropped completely from an LPW web request?
Does it time out?
Can I add a timeout?
Many thanks for your time!
TF
------------------------------
Date: Sun, 07 Mar 2004 12:51:34 +0000
From: pkent <pkent77tea@yahoo.com.tea>
Subject: Re: Protecting CGI Scripts
Message-Id: <pkent77tea-ADBCB9.12513407032004@pth-usenet-02.plus.net>
In article <67256ee6.0403050231.61c71623@posting.google.com>,
usadreams@yahoo.com (Neil) wrote:
> I have a consultant who is about to access files on our UNIX server
> via FTP.
> Is there a simple way to protect the CGI scripts from being
> copied/stolen while, at the same time, keeping the CGI script actively
> available for public use?
If I were doing it, my solution might be to only give the consultant a
user or FTP account that is able to access files that you want them to
access. The webserver user can of course access those files _and_
others. Ensure that user account only has FTP acccess, and maybe use
your FTP daemon's access controls to restrict access further than the
plain filesystem permissions allow.
Depending on your directory structure you might find that you can use
the basic unix file permissions to restrict what the consultant can
read. Maybe you can use the restrictions in the FTP daemon to add
further limits. Maybe you can use symlinks, a chroot, a jail, a copying
process, or a "mount --bind". Maybe, in the worst case, you need to
avoid giving them an FTP account at all, and manually send them the
files (and then recieve the files from them and manually put them back
on the filesystem).
If you're that worried about third party access maybe it's better that
you do not grant them an account on the server, and opt for something
like the last option. You might also want to consult your legal team
about your intellectual property rights, the consultant's contract, your
territory's copyright laws, etc etc. Anyway, is this consultant really
likely to try to steal any of your code or are you being (rightly, in
this day and age) paranoid about security :-) ?
P
--
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply
------------------------------
Date: Sun, 07 Mar 2004 10:40:35 +0100
From: Torsten Mohr <tmohr@s.netic.de>
Subject: replacing modules?
Message-Id: <c2eqmj$4la$1@schleim.qwe.de>
Hi,
if i load a module by something like:
use module;
then i could also just load all the functions in module.pm
into my own script and everything is fine.
This works for some modules.
But how for example do i replace:
use vars qw/$some $list $of $variables/;
What else do i need to look for if i want to replace some
modules?
Best regards,
Torsten.
------------------------------
Date: 7 Mar 2004 12:41:53 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: replacing modules?
Message-Id: <c2f5ah$mbv$1@mamenchi.zrz.TU-Berlin.DE>
Torsten Mohr <tmohr@s.netic.de> wrote in comp.lang.perl.misc:
> Hi,
>
> if i load a module by something like:
>
> use module;
>
> then i could also just load all the functions in module.pm
> into my own script and everything is fine.
> This works for some modules.
It works better if you put the text of the foreign module into a BEGIN
block where the "use" statement used to be. Immediately following,
add another block
BEGIN { Module->import( ...) if Module->can( 'import') }
The dots represent the arguments to the former "use" statement.
> But how for example do i replace:
>
> use vars qw/$some $list $of $variables/;
There is no general recipe. This statements is needed to make the
module work if it is *not* part of your file. To replace it, you
must understand why it is there and replace it with something that
does the same thing in the new situation. It may need no replacement
at all.
> What else do i need to look for if i want to replace some
> modules?
Start with the pair of BEGIN blocks sketched above. Then debug it:
run it and repair what's broken.
Anno
------------------------------
Date: Sun, 07 Mar 2004 02:36:53 GMT
From: Bob Walton <invalid-email@rochester.rr.com>
Subject: Re: Set::CrossProduct -> random
Message-Id: <404A8407.4060504@rochester.rr.com>
David wrote:
> The documentation for this module says that the random() method
> returns a random tuple from the cross product ... I'm stuck, using v.
> 1.4 calling random always returns the same tuple :
>
> my $i = Set::CrossProduct->new(\@listoflists);
> while (1) {
> my @list = $i->random();
> do something with @list
> }
>
> The relevant code from the module is :
>
> sub random
> {
> my $self = shift;
>
> my @array = map {${ $self->{arrays}[$_] }[
> rand($self->{counters}[$_]] }
> 0 .. $#{ $self->{arrays} };
>
> if( wantarray ) { return @array }
> else { return \@array }
> }
>
> and initiating rand with something like :
>
> srand (time ^ $$ ^ unpack "%L*", `ps axww | gzip`);
>
> in my code has no effect. Any help gratefully received - a search of
> clpm yielded nothing on this module. Thanks in advance.
> David
>
Looks like there are a couple of bugs in the Set::CrossProduct module.
Try replacing sub random in that module with:
sub random
{
my $self = shift;
my @array = map { ${ $self->{arrays}[$_] }
[ rand($self->{lengths}[$_]+1) ] }
0 .. $#{ $self->{arrays} };
if( wantarray ) { return @array }
else { return \@array }
}
Warning: This revision is not very thoroughly tested.
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
------------------------------
Date: Sun, 07 Mar 2004 02:25:34 GMT
From: $_@_.%_
Subject: Re: Slow Sorting
Message-Id: <yKv2c.21018$YN5.17292@nwrdny03.gnilink.net>
>
>$_@_.%_ <$_@_.%_> wrote:
>>>$_@_.%_ wrote:
>>>
>>>[aside: Who said the rest? Are you cutting the attributions out yourself,
>>>or are you simply using an incompetent news client?]
>
>
>[aside: Who said the rest yet again?
> Please provide an attribution when you quote someone.
>]
>
>
>>>: ><$_@_.%_> wrote in message
>>>: >news:YFN1c.27102$6c5.15055@nwrdny01.gnilink.net...
>>>: >
>>>: >> Changing this:
>>>: >> #foreach my $k (sort {$file{$b}[$col] cmp $file{$a}[$col]}
>>>: >> # keys %file)
>>>: >> #{
>>>: >>
>>>: >> To this:
>>>: >> my @y = sort {$file{$b}[$col] cmp $file{$a}[$col]} keys %file;
>>>: >> foreach my $k (@y) {
>>>: >>
>>>: >> Has really improved the speed of thw whole process.
>>>: >> I suppose the extra time the sort was adding each time through
> ^^^^^^^^^
>>>: >> the 'foreach' loop.. was enough to trigger $mw->update to frequently.
>
>
>>>: due to the fact that the sort time is eliminated each time through the loop.
>>>
>>>That's a bizarre conclusion. The sort has to complete before the foreach
>>>can have a list to iterate across. There is no resorting between
>>>iterations.
>> shrug... stfu..
> ^^
> ^^
>
>Does that mean what I think it means?
>
>
>> your words are totally useless.
>
>
>Just because you do not understand them does not make them useless.
>
>If you don't understand them, say so and maybe you will learn something.
>
>
>You made a supposition. Some (unnamed) person pointed out that
>your supposition was incorrect.
>
>It was not useless, because now you know that you have not yet
>correctly identified where the purported speed-up came from...
>
>
>--
> Tad McClellan SGML consulting
> tadmc@augustmail.com Perl programming
> Fort Worth, Texas
Thats not why said stfu.. i said that cause he diss'd my newsreader.
If it's obsolete its just because of the restrictions the programming
language has imposed on me.
chill out.
------------------------------
Date: Sun, 7 Mar 2004 02:50:21 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: Slow Sorting
Message-Id: <c2e2j9$4n0$1@news.simnet.is>
<$_@_.%_> wrote in message
news:yKv2c.21018$YN5.17292@nwrdny03.gnilink.net...
[ another missing attribution]
[snip confusion]
> Thats not why said stfu.. i said that cause he diss'd my newsreader.
> If it's obsolete its just because of the restrictions the programming
> language has imposed on me.
OK.
your newsreader was dissed because your followups seem to
be systematically flawed, and you never seem to address that.
if you had just said in a early post something like 'Sorry my reader
mangles the attribution' , most would have let it lie at that.
the main problems with your followups are:
a) broken/missing attribution. is the bit above the quote that says:
xxx wrote in message <message-id> :
attributions are helpful to see who said what
b) there is no References: headewr line
c) you seem to be following up on your own original post, but
quote something from a follow-up (without attributions)
(this probably is same problem as b)
d) you do not make replies directly after the qupte you are replying to,
but seem to use a reverse TOFU style where you put your reply after
the whole of the article you reply to. this makes it more difficult to
decode. a good example is the one refered to above:
the guy disses your newsreader
much more blabla
he makes a comment
and you reply to the diss, but just after his comment, and
it looks like you are saying stfu to a perfectly OK comment
end of rant
gnari
------------------------------
Date: Sun, 07 Mar 2004 03:37:38 GMT
From: $_@_.%_
Subject: Re: Slow Sorting
Message-Id: <6Ow2c.48491$TF2.15327@nwrdny02.gnilink.net>
"gnari" <gnari@simnet.is> wrote:
>
><$_@_.%_> wrote in message
>news:yKv2c.21018$YN5.17292@nwrdny03.gnilink.net...
>[ another missing attribution]
>
>[snip confusion]
>
>> Thats not why said stfu.. i said that cause he diss'd my newsreader.
>> If it's obsolete its just because of the restrictions the programming
>> language has imposed on me.
>
>OK.
>
>your newsreader was dissed because your followups seem to
>be systematically flawed, and you never seem to address that.
>if you had just said in a early post something like 'Sorry my reader
>mangles the attribution' , most would have let it lie at that.
>
>the main problems with your followups are:
>
>a) broken/missing attribution. is the bit above the quote that says:
> xxx wrote in message <message-id> :
> attributions are helpful to see who said what
>b) there is no References: headewr line
>c) you seem to be following up on your own original post, but
> quote something from a follow-up (without attributions)
> (this probably is same problem as b)
>d) you do not make replies directly after the qupte you are replying to,
> but seem to use a reverse TOFU style where you put your reply after
> the whole of the article you reply to. this makes it more difficult to
> decode. a good example is the one refered to above:
> the guy disses your newsreader
> much more blabla
> he makes a comment
> and you reply to the diss, but just after his comment, and
> it looks like you are saying stfu to a perfectly OK comment
>
>end of rant
>
>gnari
yea I reread, his comments I see what hes saying.
thanks for spotting that bug, my bad.
=head1 History
v1_0 - Initial release.
v1_1 - Improved Ctrl-A function.
Added Shift-End and Shift-Home functions to the message display.
v1_2 - Will no longer attempt to authenticate unless user/pass fields
have been completed.
Cosmetic improvements to Post & Read functions.
Added preformance improving option (limits message age).
v1_3 - Added option to open files after download.
Message reply and post functions are faster now.
Improved error display.
v1_4 - Made improvements to memory management.
Added search function to groups screen.
Added right-click menus to main window.
Fixed a bug in the scanning multipart function.
v1_5 - Minor GUI fixes/enhancements.
Fixed a bug with opening file when the Dl Dir is not configured.
Added a button to browse or ls the download directory.
v1_6 - Some window decoration improvements.
'Optimized' for Tk 804.25 beta 15.
Added chooseDirectory function to the options page.
Fixed a bug in grab&open when opening files with 4 char ext's.
Improved delete function and overall responsiveness.
Speed up sorting function slightly.
v1_7 - Added 'wrote:' line (thanks).
------------------------------
Date: Sun, 07 Mar 2004 03:54:15 GMT
From: $_@_.%_
Subject: Re: Slow Sorting
Message-Id: <H1x2c.21881$YN5.824@nwrdny03.gnilink.net>
$_@_.%_ wrote:
>
>
>"gnari" <gnari@simnet.is> wrote:
>>
>><$_@_.%_> wrote in message
>>news:yKv2c.21018$YN5.17292@nwrdny03.gnilink.net...
>>
>>OK.
>>
As for the all caps 'ok', see ToDo item #2 & 3
moreso item #2 since item #3 prolly isn't happening at all.
And yea it would help alot if these things were possible..
but they arent.. yet anyway.
And thanks for the help with the sorting algo.
=head1 ToDo
Add support for posting attachments larger than 1Mb.
Implement threads...
Manual garbage collection...
------------------------------
Date: Sat, 6 Mar 2004 21:55:42 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Slow Sorting
Message-Id: <slrnc4l79u.k72.tadmc@magna.augustmail.com>
$_@_.%_ <$_@_.%_> wrote:
>>$_@_.%_ <$_@_.%_> wrote:
>>>>$_@_.%_ wrote:
>>>>
>>>>[aside: Who said the rest? Are you cutting the attributions out yourself,
>>>>or are you simply using an incompetent news client?]
>>
>>
>>[aside: Who said the rest yet again?
>> Please provide an attribution when you quote someone.
>>]
[ yet another aside: sheesh! }
>>> shrug... stfu..
>> ^^
>> ^^
>>
>>Does that mean what I think it means?
> Thats not why said stfu.. i said that cause he diss'd my newsreader.
So long then.
*plonk*
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 06 Mar 2004 21:36:31 -0700
From: Bill <wherrera@lynxview.com>
Subject: SOAP::Lite in a Safe ?
Message-Id: <E6-dnRn0ecROO9fdRVn-tA@adelphia.com>
Anyone know how to call SOAP::Lite methods inside a Safe object?
The attempt below fails for some reason:
#=====
use strict;
use warnings;
use Safe;
use SOAP::Lite;
my $compartment = new Safe;
my $retval;
my $resource = '212';
my $sl = new SOAP::Lite;
my $code = <<SCODE;
\$retval = \$sl
-> uri('http://www.soaplite.com/Temperatures')
-> proxy('http://services.soaplite.com/temper.cgi')
-> f2c(\$resource)
-> result;
print "Result is \$retval\n";
SCODE
print "Now outside the box...";
eval $code;
$retval = undef;
$compartment->share(qw($retval $resource $sl));
$compartment->permit(qw(print));
print "\n\nNow in the box...\n";
$compartment->reval($code);
#========
Ideas?
------------------------------
Date: Sun, 07 Mar 2004 14:18:36 +0100
From: Hannes <remove_Hannes.Krueger@uibk.ac.at>
Subject: Re: socket communication / callback
Message-Id: <404b215d@sia.uibk.ac.at>
Ben Morrow wrote:
>
> Hannes <hanRnes.EkrueMger@OuibkV.ac.Eat> wrote:
>> I'm wondering if it's possible to use sockets for the folloing purpose:
>> A running process acts as a kind of server, sometimes it receives some
>> data. The receiving should trigger some functions (some display update
>> based on the new values received). While waiting, the process should be
>> responsive to local user-interactions.
>>
>> I'm new to networking/socket programming and don't know how to implement
>> this in a way that the receiving of data triggers some sort of callback
>> and waiting for the receiving of the data without beeing "locked"
>
> The best way is to put the sockets into non-blocking mode and use an
> event loop. If you are doing the display using Tk or Gtk then these
> toolkits provide an event loop already; if not then there are systems on
> CPAN such as POE and stem that provide pre-packaged event loops which
> you may find helpful.
>
> Ben
>
Hi,
thanks.
Because I'm new to sockets I didn't really know about the non-blocking
mode...
Yes, I'm using perl/Tk. How would you use an event loop? Idle-Callback
polling? Or is there a way to get a callback on incoming data (asynchronous
notification - like in C via SIGIO...?)
Hannes
------------------------------
Date: Sun, 07 Mar 2004 02:18:31 GMT
From: Ala Qumsieh <xxala_qumsiehxx@xxyahooxx.com>
Subject: Re: triggering callback from "outside"
Message-Id: <XDv2c.6935$OW7.2334@newssvr27.news.prodigy.com>
Hannes wrote:
> The only method I know of, are (unix) signals, which won't work for me
> (since signal handling is delayed in Perl/Tk MainLoop, and won't work on
> win32 platforms).
As I suggested in comp.lang.perl.tk, why don't you use sockets? Did you
try that approach?
I would make the Tk process the server, and listen (in a non-blocking
manner) at a certain port and wait for data to be read. Then any other
app can connect to that port and trigger the callback by sending the
correct data.
--Ala
------------------------------
Date: Sun, 07 Mar 2004 14:27:11 +0100
From: Hannes <remove_Hannes.Krueger@uibk.ac.at>
Subject: Re: triggering callback from "outside"
Message-Id: <404b2360@sia.uibk.ac.at>
> I would make the Tk process the server, and listen (in a non-blocking
> manner) at a certain port and wait for data to be read. Then any other
> app can connect to that port and trigger the callback by sending the
> correct data.
Is there a way in Perl to get a callback triggered by incoming data?
Keeping the process busy by polling the non-blocking socket in an
idle-callback wouldn't be very good...
Hannes
------------------------------
Date: 7 Mar 2004 05:19:08 -0800
From: rctantx@netscape.net (RT)
Subject: Re: Unpack binary file with C Struct to text?
Message-Id: <cae896e4.0403070519.434d9ec5@posting.google.com>
"Peter A. Krupa" <pkrupa@redwood.rsc.raytheon.com> wrote in message news:<WN72c.7$QB4.4@dfw-service2.ext.ray.com>...
> Your main problem here isn't Perl: you can't unpack the string (i.e.,
> ".info") because what you have is a reference to the string class
> instance, not the string itself.
>
That's what I thought. So, is that mean I cannot translate the string
in the binary file to ASCII or readable format?
I can display the others in the struct with no problem.
Just that string.
Thanks!
-ryan-
> You can, however unpack ".where" as an unsigned int:
>
> perl -e "$x=\"\x00\x27\xc0\x8c\";$l=unpack('I',$x);print $l"
> 2361403136
>
> Or, conversely, as a signed int:
>
> perl -e "$x=\"\x00\x27\xc0\x8c\";$l=unpack('i',$x);print $l"
> -1933564160
>
> If you ~did~ have an ASCII string in binary data, here's how you'd print
> it out:
>
> perl -e "$x=\"\x4a\x75\x73\x74\x20\x61\x6e\x6f\x74\x68\x65\x72\x20\x50\x65\x
> 72\x6c\x20\x68\x61\x63\x6b\x65\x72\x2e\";print(unpack('a*',$x))"
> Just another Perl hacker.
------------------------------
Date: 7 Mar 2004 00:28:00 -0800
From: altalingua@hotmail.com (David Morel)
Subject: Using IO::Socket::INET for grabbing web pages
Message-Id: <60c4a7b1.0403070028.5a6aa32a@posting.google.com>
Hi,
I need to grab web pages from the internet using IO::Socket::INET.
What is the code for doing so?
I know that there are easier ways to grab pages,
such as by using LWP::Simple --
my $html = get($url);
However, I really need to use IO::Socket:INET.
Any hints?
Thanks,
David Morel
------------------------------
Date: Sun, 7 Mar 2004 00:39:26 -0800
From: "TF" <theforce@forcet.net>
Subject: Re: Using IO::Socket::INET for grabbing web pages
Message-Id: <404ae7a2$1@nntp0.pdx.net>
"David Morel" <altalingua@hotmail.com> wrote in message
news:60c4a7b1.0403070028.5a6aa32a@posting.google.com...
> Hi,
>
> I need to grab web pages from the internet using IO::Socket::INET.
> What is the code for doing so?
>
> I know that there are easier ways to grab pages,
> such as by using LWP::Simple --
> my $html = get($url);
>
> However, I really need to use IO::Socket:INET.
>
> Any hints?
>
> Thanks,
> David Morel
You are liable to get bad requests that happen intermittantly if you do. Use
LPW
------------------------------
Date: Sun, 07 Mar 2004 08:50:40 +0100
From: Udo Marx <marx@netzteil.com>
Subject: Video/DVD
Message-Id: <b0ll40h9doohg8pnu1foion4aclq7ulq43@4ax.com>
Greetings to clpm!
I have the honour to participate in a video art project.
My job is it to regulate the Video/DVD's and light installations by
movement alarm units or proximity sensors.
My questions:
Does it make sense to do this with perl, for example by serial
controls? Does someone know about controlling software for this
purpose?
--
Freundliche Gruesse,
Netzteil - Udo Marx
http://www.netzteil.com/
mailto:marx@netzteil.com
------------------------------
Date: Sun, 07 Mar 2004 13:11:50 +0000
From: pkent <pkent77tea@yahoo.com.tea>
Subject: Re: Video/DVD
Message-Id: <pkent77tea-2A79F1.13115007032004@pth-usenet-02.plus.net>
In article <b0ll40h9doohg8pnu1foion4aclq7ulq43@4ax.com>,
Udo Marx <marx@netzteil.com> wrote:
> I have the honour to participate in a video art project.
> My job is it to regulate the Video/DVD's and light installations by
> movement alarm units or proximity sensors.
>
> My questions:
> Does it make sense to do this with perl, for example by serial
> controls? Does someone know about controlling software for this
> purpose?
Do you already have the software to control these external units, or are
you free to choose whatever control interfaces you need? My guess is
that you have a computer, some DVDs and some lighting rigs, and you want
to get the computer to talk to the other things somehow.
If that's the case, what external control interfaces does the gear have?
Some lighting rigs will accept controls via MIDI, some use controls via
DMX (I think?), maybe some have RS232 links already. You could control
DVD players via an infra-red remote control. In those cases you can hook
up interfaces to the serial port and perl can easily talk to the serial
port. Possibly you can play the video straight out from the computer
somehow. I would guess that you can take inputs from the sensors into
some kind of serial or parallel interface that perl could also read from.
Don't forget: safety first! All this stuff is running with mains
electricity and could be lethal. Even incorrect signal voltages could
damage the equipment. Some things might be hot, or heavy, or pose other
risks! Make sure everything is safe - maybe you have to ask a
professional and/or lawyer for advice (which might cost money).
P
--
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply
------------------------------
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 6229
***************************************