[17475] in Perl-Users-Digest
Perl-Users Digest, Issue: 4895 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 15 18:06:11 2000
Date: Wed, 15 Nov 2000 15:05:16 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <974329516-v9-i4895@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 15 Nov 2000 Volume: 9 Number: 4895
Today's topics:
Re: About to slit my own throat <philip@tae.tellis.home>
Re: Apache denies to start a Perl CGI <mischief@velma.motion.net>
Re: Can "-e $myfile || -r $myfile" be more concise? <ren.maddox@tivoli.com>
Can I pass a logical data type using the pack function bcwache@my-deja.com
Re: Can Perl do this?: <kperrier@blkbox.com>
Checking Writable Sockets on Solaris 2.6 <someone@compugenx.com>
Re: compiling/securing Perl code <someone@compugenx.com>
Re: compiling/securing Perl code <philip@tae.tellis.home>
Re: Cookieless operation <fchanny@lbl.gov>
Re: cpan.org Changed (Matt Daemon)
Re: CR LF to <br> in REGEX <uri@sysarch.com>
Re: Duplicate Records <sumus@aut.dk>
Exporting variables from modules <a@b.c>
Finer points of lists, etc. <jeffross@bendcable.com>
Re: Free Online Sample Certification Questions <jeff@yoak.com>
Re: grep and reg exp question <vrdoljak@uclink.berkeley.edu>
Re: grep and reg exp question <sumus@aut.dk>
Re: gui based debuggers for perl on windows <adamf@box43.gnet.pl>
Re: Hanging when reading from socket <owen.sullivan@worldzap.com>
Re: Hash assignments in loops? <ren.maddox@tivoli.com>
Re: IP geography [ot] <elijah@workspot.net>
Re: IP geography [ot] <flavell@mail.cern.ch>
Re: Line Editing vignolap@my-deja.com
Re: Looking for idiom for getting value from @ARGV, or <ren.maddox@tivoli.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 16 Nov 2000 01:06:45 +0530
From: Philip S Tellis <philip@tae.tellis.home>
Subject: Re: About to slit my own throat
Message-Id: <Pine.LNX.4.30.0011160103310.662-100000@tae.tellis.home>
Sometime on Nov 6, Anthony assembled some asciibets to say:
> Thank you for your suggestions. Seems like I screwed up this script
> pretty bad. Going back to the drawing board...
I think you should run through the man pages before you start anything.
perlfaq9 has a few tips on mail and cgi and what modules you'll require.
perldoc CGI will give you information on the CGI module and how to use it
to read and write CGI.
Also, unless your code is one line long, always use the -w switch.
Philip
--
Bernard Shaw is an excellent man; he has not an enemy in the world, and
none of his friends like him either.
-- Oscar Wilde
Visit my webpage at http://www.ncst.ernet.in/~philip/
Read my writings at http://www.ncst.ernet.in/~philip/writings/
------------------------------
Date: Wed, 15 Nov 2000 21:51:12 -0000
From: <mischief@velma.motion.net>
Subject: Re: Apache denies to start a Perl CGI
Message-Id: <t161ag361n4pee@corp.supernews.com>
Stephan Burkhardt <sburkhardt@debis.de> wrote:
> Hi all,
Hullo.
> in an Apache installation I've got a weird problem:
> It does not start a Perl CGI and I get the error
> message
> The requested method POST is not allowed for the URL <The .pl's URL>
Try the Apache docs. You have to configure Apache to run a file
ending with a certain extension instead of displaying it as a page.
Since a static page can't accept POST requests, this would give you
an error. If you used GET as a test, you'd most likely see that
instead of running the program, you'd get the source file in your
browser. POST however is not GET, so you only end up with the
error message.
This is besides making sure that Apache allows CGI in the directory.
This doesn't have to be done per directory, but it can be. Again,
this is an Apache issue.
> Is it necessary to register all allowed CGI subdirectories
> to Apache ('cause the URL where my Perl script lies is not
> under the /cgi-bin regularly used, but in another subtree;
> the path is explicitly given)
> thanks for a helpful hint
Hope this is a helpful hint. I'd give you more, but this isn't a Perl
question.
> greetings from Stephan, Fellbach, Germany
> --
>
> '''
> (0 0)
> +------oOO----(_)--------------+
> | Stephan Burkhardt |
> | sburkhardt@debis.de |
> | TEL: +49-711-17-49457 |
> | FAX: +49-711-17-790-49457 |
> +-------------------oOO--------+
> |__|__|
> || ||
> ooO Ooo
Signatures much larger than 4 lines are, by some, considered
rude or inappropriate. This is of course relative to the enjoyment
or useful information bestowed upon the viewer of the signature.
--
Chris Stith Motion Internet mischief@motion.net
Carpe Noctum.
--
------------------------------
Date: 15 Nov 2000 15:09:33 -0600
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Can "-e $myfile || -r $myfile" be more concise?
Message-Id: <m3g0ktdjsi.fsf@dhcp11-177.support.tivoli.com>
Ren Maddox <ren.maddox@tivoli.com> writes:
> gorilla@elaine.furryape.com (Alan Barclay) writes:
> >
> > If the file doesn't exist, it can't be readable. Conversely, if it's
> > readable, it must be exist. Therefore there is no case where your second
> > test can be true when the first test is false, and your second test
> > is redundant.
>
> Well, not quite. It could exist and not be readable. However, you
and of course, what I really meant to say is that if both existence
and readability need to be checked:
> could simply use:
>
> -r $myfile
>
> for the reasons you've given.
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Wed, 15 Nov 2000 22:05:01 GMT
From: bcwache@my-deja.com
Subject: Can I pass a logical data type using the pack function in Perl?
Message-Id: <8uv1a8$ugt$1@nnrp1.deja.com>
I'm trying to pass a parameter to a subroutine in a dll using
Perl/CGI. The subroutine is expecting a 'logical*2' data type (in
FORTRAN) which represents .TRUE. or .FALSE.. However, there is no
logical type for the pack function in the Perl documentation. I've
tried passing the value as a string, as 0/1, and several other ways
with no success. Has anyone ever successfully aaccomplished this?
Thanks!
Brian W.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 15 Nov 2000 15:57:59 -0600
From: Kent Perrier <kperrier@blkbox.com>
Subject: Re: Can Perl do this?:
Message-Id: <83A890D4DAE0D6DF.94460F79F86F0AF6.EF050562999A75D9@lp.airnews.net>
"D.B" <dvbryan@_nospamplsHotmail.com> writes:
> Check if a file called datafile.txt exists in a particular directory
> If the datafile.txt does not exist, create it
> Process form data passed from html and then append processed output to this
> file
> At 7am each day check if the above datafile.txt has something in it
> If the datafile.txt has content, email as an attachment to xxx@domain.co.uk
> Once attachment has been sent, reset the file to have no content (?touch
> datafile.txt).OR rename datafile.txt to datafileold.txt.
>
> Can the above be done in one script easily?!
It could be done with one script, but two would be better. Can it be
done easily? It all depends on one's definition of easy.
Kent
--
"I've won at every level, except college and pro."
--Shaquille O'Neal
------------------------------
Date: Wed, 15 Nov 2000 14:07:24 -0500
From: "Jimmy" <someone@compugenx.com>
Subject: Checking Writable Sockets on Solaris 2.6
Message-Id: <8uumu2$ovu$1@bob.news.rcn.net>
Hello,
using IO::Socket on Solaris 2.6 everytime I attempt a socket call with a
die like:
$client->send($data) || die "It didint work!\n";
if the above code is executed after $client has disconnected, my die will
never be called, instead an error of "Broken Pipe" is sent to STDERR and the
progrma is terminated.
I want to handle these, and I have tried eval() IO::Select->can_write as
well as trying to verify peeraddr, all to no avail. It seems that all
socket calls that fail under Solaris 2.6 are disreagrding whatever mechanism
I have set up to trap and handle these failures.
Any help would be greatly appreciated.
-jimmy
------------------------------
Date: Wed, 15 Nov 2000 14:34:37 -0500
From: "Jimmy" <someone@compugenx.com>
Subject: Re: compiling/securing Perl code
Message-Id: <8uuoh3$42r$1@bob.news.rcn.net>
Use perl2exe
-jimmy
Jim <jimNOSPAM@gosquad.com> wrote in message
news:nPAQ5.63450$n9.1545773@news2.rdc1.on.home.com...
>
> Hi all,
>
> To state my problem directly, I need to distribute a large perl-based
web
> application in a secure way. I'm sure this topic has been discussed
> before,
> and from the text and discussions I've read on compiling the source, the
> answer is always 'Why would you want to do that?' or 'Try perlcc, but if
it
> doesn't work, don't complain' ;) Is anyone using a practical method of
> securing their perl code? I basically have two requirements:
>
> 1) Must still be relatively fast (memory resident - FCGI, mod_perl?)
> 2) Must be a stable solution (perlcc seems to be out here)
> 3) Code must not be easily viewable (encrypted, compiled w/ another
> method?)
>
> Ok, that's three. Anyway, the ideal goal is to transport the code via
> physical media or over the Internet with no worries. Are there any perl
> licensing issues that I should be aware of?
>
>
>
------------------------------
Date: Thu, 16 Nov 2000 01:31:33 +0530
From: Philip S Tellis <philip@tae.tellis.home>
Subject: Re: compiling/securing Perl code
Message-Id: <Pine.LNX.4.30.0011160127500.662-100000@tae.tellis.home>
Sometime on Nov 15, Jim assembled some asciibets to say:
> To state my problem directly, I need to distribute a large perl-based web
> application in a secure way. I'm sure this topic has been discussed
>
> 3) Code must not be easily viewable (encrypted, compiled w/ another
Compiled code can be reverse engineered, so there's no security there.
Encrypting your code doesn't help either, because at some point it needs
to be decrypted in order to execute it. If it _can_ be decrypted, then
there's nothing to stop anyone from decrypting it.
I suppose your licence could prevent reverse engineering, but that would
only stop people who weren't _really_ interested in the code.
The only advantage you gain by compiling, is that you distribute
everything in one package, but then, why not distribute perl with your app
anyway?
Philip
--
Magnocartic, adj.:
Any automobile that, when left unattended, attracts shopping carts.
-- Sniglets, "Rich Hall & Friends"
Visit my webpage at http://www.ncst.ernet.in/~philip/
Read my writings at http://www.ncst.ernet.in/~philip/writings/
------------------------------
Date: Wed, 15 Nov 2000 11:26:47 -0800
From: Frank Hanny <fchanny@lbl.gov>
Subject: Re: Cookieless operation
Message-Id: <3A12E377.AE89D6CF@lbl.gov>
Sounds promising. Does CGI::Persistent work in a Windows NT server
environment, as for example with MS IIS or is it strictly a Unix
critter? (Note, this is not a request for advice and comments as to the
superiority of Apache/Unix.)
Thanks,
Frank Hanny
Vipul Ved Prakash wrote:
>
> In article <m3u2ag9t6i.fsf@solo.david-steuber.com>, David Steuber wrote:
> >Bart Lateur <bart.lateur@skynet.be> writes:
> >
> >' * Move around in your site using an extra form variable, or by
> >' appending "?session=blahblablah" to the URL.
>
> CGI::Persistent extends CGI to do this transparently. From manpage:
>
> "...introduces persistent CGI sessions that store their state data on the
> server side. When a new session starts, CGI::Persistent automatically
> generates a unique state identification string and associates it with a
> persistent object on the server. The identification string is used in URLs
> or forms to refer to the particular session. Request attributes are
> transparently committed to the associated object and the object data is
> bound to the query.
>
> CGI::Persistent is derived from CGI.pm. CGI.pm methods have been overridden
> as appropriate."
>
> best,
> vipul.
>
> --
>
> Vipul Ved Prakash, http://www.vipul.net/
> PGP Fingerprint d5f78d9fc694a45a00ae086062498922
------------------------------
Date: Wed, 15 Nov 2000 15:00:02 -0600 (CST)
From: matt_daemon@webtv.net (Matt Daemon)
Subject: Re: cpan.org Changed
Message-Id: <4145-3A130762-10@storefull-245.iap.bryant.webtv.net>
Hmmm.... I noticed that too.
------------------------------
Date: Wed, 15 Nov 2000 19:06:43 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: CR LF to <br> in REGEX
Message-Id: <x7ofzhf41r.fsf@home.sysarch.com>
>>>>> "JP" == John Plaxton <19wlr@globalnet.co.uk> writes:
JP> Think I've found the answer for myself, but correct me if I'm wrong, ie to
JP> remove carriage returns and insert <br> instead.
JP> $string =~ s/\n/<br>/g;
that is a newline or linefeed, not a carriage return.
JP> @lines=split /\n/,$string
JP> for $line (@lines) {
JP> $newstr = ($newstr.$line."<br>");
JP> }
blecch!
if you insist on the loop, then learn the .= operator:
$newstr .= "$line<br>" ;
better to learn join:
$newstr = join '<br>', split /\n/, $string ;
and if you need to, append another <br> onto that or pass in a empty
string to join:
$newstr = join '<br>', split( /\n/, $string ), '' ;
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: 15 Nov 2000 20:43:13 +0100
From: Jakob Schmidt <sumus@aut.dk>
Subject: Re: Duplicate Records
Message-Id: <lmulkomm.fsf@macforce.sumus.dk>
Perry <ts012@my-deja.com> writes:
> list. The problem is that there can be multiple copies of the same
> string and I only want to output it once. The following is the code
[...]
> foreach $line (<INPUT>) {
> if (index($line, "Message rejected,") >= 0) {
> $reject = (substr($line, 84));
> @rejectedservice = $reject;
> print OUTPUT ("@rejectedservice\n");
> }
> }
The obvious way (which must be in the FAQs also) is to use a hash:
(note! untested snippet!)
my %done = ();
foreach $line ( <INPUT> ) {
if ( not exists $done{ $line } and
index( $line, "Message rejected," ) >= 0 ) {
$done{ $line } = 1;
$reject = ( substr( $line, 84 ) );
# @rejectedservice = $reject; # dont know why you did that
print OUTPUT ( "$reject\n" );
}
}
checking for existence in the hash in stead of trueness of the values
to avoid spending too much memory (in case its a huge file)....
HTH
--
Jakob Schmidt
http://aut.dk/orqwood
etc.
------------------------------
Date: Wed, 15 Nov 2000 19:56:31 -0000
From: "Kingsley Tart" <a@b.c>
Subject: Exporting variables from modules
Message-Id: <DTBQ5.1109$X03.20924@news2-win.server.ntlworld.com>
I want to have a module that not only contains some common subroutines to a
suite of scripts that I'm writing, but also declares (and assigns values to)
a number of variables.
To get round compile errors, I've had to list all of the vars I'm exporting
in the @EXPORT array and tell the main program to import each and every one.
Surely there must be a better way? I don't have to seem to do this with the
standard modules but can't see how they are different in the way that they
are declared.
On top of that, though I'm setting the values, they are not coming across
from the module to the program, despite having an "InitialiseVariables"
subroutine to the module and a call to it from the main program.
Cheers,
Kingsley.
--8<--
package SkyMail;
require Exporter;
@ISA=qw(Exporter);
@EXPORT=qw($workingdir $incomingdir $outgoingdir $KickDir $ProcMonDir
$KickMonitorInterval $OutgoingKickMonitorCycles
$ListenserverRecoveryPeriod
$KickserverRecoveryPeriod $forwardingfile $optionsfile $ServerLog
$ServerSessionLog $ClientSessionLog $StdErrLog $servername
$hostname
$MailerDaemonAddress $MailerDaemonName $defaultport $crlf $cr
$nameofunknownhost $maxrecipientspermessage $InactivityTimeout
$ClientTimeout $MaxMessageSize $Megabyte
$LinesToIncludeInBounceMessages
@timezones
InitialiseVariables DomainDirectory DirectoryIsOutgoing
ProcessExists logmsg);
@EXPORT_OK=@EXPORT;
--8<--
--8<--
#!/usr/bin/perl
require 5.002;
use strict;
use Socket;
use Carp;
use FileHandle;
use Net::DNS;
use SkyMail qw($workingdir $incomingdir $outgoingdir $KickDir $ProcMonDir
$KickMonitorInterval $OutgoingKickMonitorCycles
$ListenserverRecoveryPeriod
$KickserverRecoveryPeriod $forwardingfile $optionsfile
$ServerLog
$ServerSessionLog $ClientSessionLog $StdErrLog $servername
$hostname
$MailerDaemonAddress $MailerDaemonName $defaultport $crlf $cr
$nameofunknownhost $maxrecipientspermessage
$InactivityTimeout
$ClientTimeout $MaxMessageSize $Megabyte
$LinesToIncludeInBounceMessages
@timezones
InitialiseVariables DomainDirectory DirectoryIsOutgoing
ProcessExists logmsg);
--8<--
--
Cheers,
Kingsley
k ingsl ey at sk 4 y mark 3 et dot 34 co dot 4 uk (remove the digits)
------------------------------
Date: Wed, 15 Nov 2000 14:20:44 -0800
From: Jeff Ross <jeffross@bendcable.com>
Subject: Finer points of lists, etc.
Message-Id: <63E1572557153C26.389422993BBF3B6D.8AA3E7D00355A0D7@lp.airnews.net>
Sort of a newbie stuck on list and string nuances.
@MyList = (30188, $A01, 3644, $A02, 4080, $B03, 2976, $B09, 2912)
I want to take this list (above) and make the $# equal to the value on
its left side. I then want to print the results to a text file. My
results should look like this:
$A01 = 30188
$A02 = 3644
$B03 = 2976
$B09 = 2912
My actual list is much longer, up to 99 potential variables.
Thanks in advance for the help.
------------------------------
Date: Wed, 15 Nov 2000 12:17:50 +0800
From: "Jeff Yoak" <jeff@yoak.com>
Subject: Re: Free Online Sample Certification Questions
Message-Id: <8uur44012sc@news1.newsguy.com>
[postedf and mailed]
In article <8uo399$7fa$1@nnrp1.deja.com>, cd_root@my-deja.com wrote:
> Perl questions are located at:
> http://www.networkessentials.com/certified/perl
This seemed pretty lame to me. Probably a third of the questions I got
related to pack templates, which I happen to use infrequently. What
would this imply about my level of certification in Perl? Also, there
are questions where none of the options are correct. You should have
someone really strong with Perl go through it. I'm sorry, I didn't keep
records because I wasn't really that interested in helping, but perhaps
my mentioning it will motivate you not to offer it to people (if this
really is a "sample") without further investigation.
Cheers,
Jeff
------------------------------
Date: Wed, 15 Nov 2000 12:11:59 -0800
From: Gordon Vrdoljak <vrdoljak@uclink.berkeley.edu>
To: helgi@NOSPAMdecode.is
Subject: Re: grep and reg exp question
Message-Id: <3A12EE0F.3F020EA5@uclink.berkeley.edu>
Hello Helgi et al.,
I tried your code and it still does the same thing. If I input blank entries on
the web form, it will still allow that as permissable for their signup. The
program should die if their name is not in the database. It seems with your
code as well, to give a positive result for the match, if they leave $lastname
empty on the webform.
Here again is the format of the file being searched:
"Elizabeth","Bergen","23763","","201 Wellman","","Resh"
"Virginetta","Cannon","36230","","311 LSA","4860788","Keller"
"Mark","Carrier","27742","","311A Koshland Hall","8499221","Sussex"
"Richard","Carthew","6439943","","539 LSA","","Rubin"
"Junghue","Chen","27108","","401 Barker Hall","6498915","Cozzarelli"
"Mavis Date","Chong","6429174","","147 Hilgard","2234959","Schroth"
It is firstname,lastname, phone#, Address, labphone, Supervisor.
thank you for your advice and time.
others recommended using the following code:
open FORMAT, 'format.txt';
my @search_result = grep /^$lastname/, <FORMAT>;
close FORMAT;
I was wondering if this would give the same result as a positive search result
if the user input an empty line on the form. How would I work the grep
/^$lastname/ to search for the second entry - not the first.
Gordon.
Helgi Briem wrote:
>
> On Fri, 10 Nov 2000 04:09:13 GMT, tjla@guvfybir.qlaqaf.bet
> (Gwyn Judd) wrote:
>
> >I was shocked! How could Gordon Vrdoljak <vrdoljak@uclink.berkeley.edu>
> >say such a terrible thing:
> >>Hello,
> >>thanks for your replies...
> >>No, I didn't use taint checks.
> >>
> >>The format of the text file I am pulling in is:
> >>"Elizabeth","Bergen","23763","","201 Wellman","","Resh"
> >>"Virginetta","Cannon","36230","","311 LSA","4860788","Keller"
> >>"Mark","Carrier","27742","","311A Koshland Hall","8499221","Sussex"
> >>etc...
> >>
> >>It is a comma seperated output of our filemaker database of users with first,
> >>lastname, phone, email, address, Lab phone, and supervisor.
> >
> >In that case I would probably use the DBD::CSV module which is designed
> >to split CSV file like this, rather than just using grep(1) which isn't.
> >
> or alternatively:
>
> open IN, $phonebook or die " Cannot open $phonebook :$!\n";
> my $match = 0;
> while (<IN>)
> {
>
> my ($first,$last,$phone,$email,$address,$labphone,$super)
> = split (/,/,$_);
> if ($last =~ /$lastname/gi) { $match = 1; print "Match
> found:$_\n"; }
> }
> close IN or die "Cannot close $phonebook:$!\n";
> if (not $match) { print "No match found\n"; }
>
> Regards,
> Helgi Briem
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Gordon Ante Vrdoljak Electron Microscope Lab
ICQ 23243541 http://nature.berkeley.edu/~gvrdolja 26 Giannini Hall
vrdoljak@uclink.berkeley.edu UC Berkeley
phone (510) 642-2085 Berkeley CA 94720-3330
fax (510) 643-6207 cell (510) 290-6793
------------------------------
Date: 15 Nov 2000 21:21:13 +0100
From: Jakob Schmidt <sumus@aut.dk>
Subject: Re: grep and reg exp question
Message-Id: <k8a5kmva.fsf@macforce.sumus.dk>
Gordon Vrdoljak <vrdoljak@uclink.berkeley.edu> writes:
> It seems with your
> code as well, to give a positive result for the match, if they leave $lastname
> empty on the webform.
Oh this is quite confusing - please put comments and replies after whatever
they comment or reply to.
Here\s the bug:
> > my ($first,$last,$phone,$email,$address,$labphone,$super)
> > = split (/,/,$_);
> > if ($last =~ /$lastname/gi) { $match = 1; print "Match
> > found:$_\n"; }
> > } [...]
make that $last =~ /^$lastname$/i and it oughtta work.
> others recommended using the following code:
> open FORMAT, 'format.txt';
> my @search_result = grep /^$lastname/, <FORMAT>;
[...]
> close FORMAT;
>
> I was wondering if this would give the same result as a positive search result
> How would I work the grep
> /^$lastname/ to search for the second entry - not the first.
you could go /^[^,]*,$lastname,/ provided that the quotes in your description
of the format are not really there. Maybe you can figure out what to do
if they are yourself?
HTH
--
Jakob Schmidt
http://aut.dk/orqwood
etc.
------------------------------
Date: Wed, 15 Nov 2000 20:26:46 +0100
From: Adam <adamf@box43.gnet.pl>
Subject: Re: gui based debuggers for perl on windows
Message-Id: <3A12E376.46C2@box43.gnet.pl>
Rajkumar wrote:
>
> hey all
>
> Are there any freeware gui based debuggers for perl on windows ? If so could
> could
> you tell where i can download them
here it is:
http://www.cpan.org/authors/id/A/AE/AEPAGE/Devel-ptkdb-1.1071.tar.gz
use the tools:
http://search.cpan.org
--
Adam.
------------------------------
Date: Wed, 15 Nov 2000 19:49:59 GMT
From: "Owen Sullivan" <owen.sullivan@worldzap.com>
Subject: Re: Hanging when reading from socket
Message-Id: <HNBQ5.3633$Nw6.11595@news.iol.ie>
Thanks for the reply. I believe the problem I was having was that I (a HTTP
client) was attempting to do multiple writes to and reads from a socket,
whereas the HTTP server was closing the socket after each response. I have
modified the script to open a new socket for each request. It is now
working using the code fragment you suggest below.
"Ben Kennedy" <bkennedy@hmsonline.com> wrote in message
news:hV1Q5.111322$td5.17063111@news1.rdc2.pa.home.com...
>
> "Owen Sullivan" <owen.sullivan@worldzap.com> wrote in message
> news:FiUP5.3208$Nw6.9791@news.iol.ie...
>
> > So instead I have used the code below to read the responses. The
> responses
> > are successfully read. However, the program appears to hang after
reading
> > the responses received. Does anyone know what the fix for this is?
> Thanks.
> >
> > for (;;) {
> > for ($curpos = tell($remote); $_ = <$remote>;
> > $curpos = tell($remote)) {
> > print LOGFILE "Read: $_";
> > }
> > $remote->clearerr;
> > }
>
> Why are you using tell() and a for() loop? Look at the perl documentation
> (perldoc perlipc) for some basic examples
>
> while(<$sock>) {
> print;
> }
> print "Socket is closed\n";
>
> Hope this helps
>
> --Ben Kennedy
>
>
------------------------------
Date: 15 Nov 2000 13:08:39 -0600
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Hash assignments in loops?
Message-Id: <m3snotdpe0.fsf@dhcp11-177.support.tivoli.com>
"Guido" <guido@ldv.uni-trier.de> writes:
> And here a funny joke of cpan-perl ..
I don't get the joke...
> If I tried this following code:
>
>
> > my %fruit_preference;
> > for (@file_contents)
> > {
> > my ($fruit,$person) split/,/,$_;
> > $fruit_preference{$person} = $fruit;
> > }
>
> Perl makes really bullshit, but If change $person and $fruit
> ($fruit_preference{$fruit}=$person), it will work fine.
Could you perhaps clarify in what way this is not working?
> PS: Active-State Perl under Windows worked in both ways ...
So where doesn't it work?
Really not much to go on here. The code given doesn't actually output
anything, so it is very difficult to measure success. You need to
provide code that produces output, the expected output, and the bad
output (along with any input).
PS: The code should use warnings and strict.
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: 15 Nov 2000 19:39:11 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: IP geography [ot]
Message-Id: <eli$0011151431@qz.little-neck.ny.us>
In comp.lang.perl.misc, Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
> [A complimentary Cc of this posting was NOT sent to Martien Verbruggen
Is that needed?
> <mgjv@tradingpost.com.au>],
> who wrote in article <slrn913lma.gs3.mgjv@martien.heliotrope.home>:
> > > knowing 30% of your demographic is better than known none
> > As long as everyone fully understands that you only know that few, and
> > as long as it is possible to reliably identify the reliable 30% :)
> And as long as these 30% are representative (which they are not ;-).
They don't need to be representative.
We have N page views a month.
We know locations of 30% of those, and that includes:
X% in urban US areas
Y% in New York
So we can say that (should the trends continue) we
will have, minimum:
M urban visitors next month
P New York visitors next month
But this is getting off-topic.
Elijah
------
besides one could compare what the known locations are doing verus the unknown
------------------------------
Date: Wed, 15 Nov 2000 20:56:25 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: IP geography [ot]
Message-Id: <Pine.GHP.4.21.0011152050390.4421-100000@hpplus03.cern.ch>
On 15 Nov 2000, Eli the Bearded wrote:
> besides one could compare what the known locations are doing verus
> the unknown
In undergraduate statistics lectures, we were shown the comparison
between admissions to lunatic asylums and the issue of radio licences
There was a very high statistical correlation.
(I forget the period covered, but it couldn't have been later than the
1950's).
To do anything useful with statistics, you've got to ask a meaningful
question, and subject it to appropriate analysis.
But I'm sure you know that. Unfortunately I suspect that > 99%
of the "I've got a counter that tells me about the people who visit my
web pages" folks don't know it.
------------------------------
Date: Wed, 15 Nov 2000 19:44:20 GMT
From: vignolap@my-deja.com
Subject: Re: Line Editing
Message-Id: <8uup2i$n1t$1@nnrp1.deja.com>
Let me try again and be more articulate/specific:
Start with a line like this:
Mailbox,name,/o=organization/ou=unit/cn=Recipients/cn=Employees/cn=NAME,
,CHIMSG1
Find the name (NAME) and destination server yyyMSGz
Build new line:
NAME: NAME@yyyMSG2.xxx.COM
In article <u97l65m79n.fsf@wcl-l.bham.ac.uk>,
nobull@mail.com wrote:
> vignolap@my-deja.com writes:
>
> > This seems simple, but I am being rushed
> >
> > I want to go through a file containing entries like the following:
> >
> >
Mailbox,YYY,/o=company/ou=organization/cn=Recipients/cn=Employees/cn=YYY
> > ,,CHIMSG1
> >
> > and create a new file consisting of entries like this one.
> >
> > YYY: YYY@CHIMSG2.xxx.COM
> >
> > How do I go about it?
>
> I'd probably just use a s///.
>
> First you have to define the problem better. Your definition is
> woefully inadequate.
>
> How about:
>
> s/^Mailbox,(.*?),.*\/cn=(.*?),,(.*)$/$1: $2\@$3.xxx.COM/;
>
> --
> \\ ( )
> . _\\__[oo
> .__/ \\ /\@
> . l___\\
> # ll l\\
> ###LL LL\\
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 15 Nov 2000 13:03:44 -0600
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Looking for idiom for getting value from @ARGV, or a default
Message-Id: <m3y9yldpm7.fsf@dhcp11-177.support.tivoli.com>
Ilmari Karonen <iltzu@sci.invalid> writes:
> In article <m3hf5ah629.fsf@dhcp11-177.support.tivoli.com>, Ren Maddox wrote:
> >
> > $sh->{password} = @args ? shift @args : $ENV{DBI_PASS};
>
> The _real_ reason why Perl needs a ?? operator is to remove the
> temptation to "simplify" code or save keystrokes by using || in
> cases like the one we've been discussing in this thread. IMHO.
I don't remember for sure (and didn't bother to check, shame on me)
but was there discussion about the alternative of having defined be
clever about what it returns? In particular, I would want it to
pass through the tested value, but with a special boolean property of
true if the value is not true. With this, you could simply write:
$sh->{password} = defined shift @args || $ENV{DBI_PASS};
Currently, as long as the value shifted off of @args is not undef (or
there isn't a value to shift off), then this will set the password to
1. I'm suggesting that it should set the password to the value
shifted, even if that value is "", "0" or 0.
I think this would obviate the need for the ?? operator.
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 4895
**************************************