[9672] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3266 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 27 14:07:15 1998

Date: Mon, 27 Jul 98 11:01:54 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 27 Jul 1998     Volume: 8 Number: 3266

Today's topics:
    Re: sending mail from within perl <stepherd@gusun.georgetown.edu>
        SGML::parser & SGML::ultil <mo.benyounes@lexis-nexis.com>
    Re: SGML::parser & SGML::ultil <ks@ic.uva.nl>
        Simplish regular expression Question dwarren1@my-dejanews.com
    Re: Simplish regular expression Question (Aaron B. Dossett)
    Re: Submit only Once (-)
    Re: Submit only Once (Malcolm Hoar)
    Re: Submit only Once (Abigail)
    Re: Sybperl CTLib ct_callback causes coredump mpeppler@mbay.net
        Variable interpolation in a hash key <jstepan@uswest.net>
    Re: Variable interpolation in a hash key <nguyend7@egr.msu.edu>
        Which Sybase products contain Sybperl library files for <aa162@RemoveThis.chebucto.ns.ca>
    Re: Which Sybase products contain Sybperl library files <aa162@RemoveThis.chebucto.ns.ca>
    Re: Win32 install prob--another idiot ChicagoJen@my-dejanews.com
    Re: Y2K problem in PERL with localtime() (John Stanley)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Mon, 27 Jul 1998 13:35:16 -0400
From: Dave Stephens <stepherd@gusun.georgetown.edu>
Subject: Re: sending mail from within perl
Message-Id: <35BCBA54.4DB2336F@gusun.georgetown.edu>

Use Jgaa's wsendmail.  Works like a charm.
http://www.jgaa.com/cgi-bin.htm

--Dave Stephens

> > Hi:
> >
> > I'm running Perl under windows 95.  I want to send mail from a script but do
> > not have a mail server running.  I am connected 24/7 and wonder if I can use
> > my mail host (smtp.gte.net) to send the mail for me?
> >
> > Thanks.
> >
> > Bob
> >
> > --





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

Date: Mon, 27 Jul 1998 12:08:05 -0400
From: Mohamed Benyounes <mo.benyounes@lexis-nexis.com>
Subject: SGML::parser & SGML::ultil
Message-Id: <35BCA5E5.6635@lexis-nexis.com>

SGML::parser and SGML::util
I am in need of these two library files. Would anyone know where and how
I can get hold of them.
I appreciate the help.


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

Date: 27 Jul 1998 19:47:20 +0200
From: Karel Sprenger <ks@ic.uva.nl>
Subject: Re: SGML::parser & SGML::ultil
Message-Id: <u90lfw5hz.fsf@xs4all.nl>

Hi

>>>>> "Mohamed" == Mohamed Benyounes <mo.benyounes@lexis-nexis.com> writes:

Mohamed> SGML::parser and SGML::util I am in need of these two library
Mohamed> files. Would anyone know where and how I can get hold of them.  I
Mohamed> appreciate the help.

They are part of perlSGML. See
http://www.oac.uci.edu/indiv/ehood/perlSGML.html
for further info. The latest distibution is available via
http://www.oac.uci.edu/indiv/ehood/tar/perlSGML.1997Sep18.tar.gz.

Cheers,
Karel

-- 
Karel Sprenger <ks@ic.uva.nl>               | phone: +31-20-525 2302
Informatiseringscentrum                     |        +31-20-525 2741
Universiteit van Amsterdam                  | fax  : +31-20-525 2084
Turfdraagsterpad 9, NL-1012 XT  AMSTERDAM   | home : +31-20-670 0942
*** PGP Public Key available on servers *** | email: <cjas@xs4all.nl>


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

Date: Mon, 27 Jul 1998 17:11:17 GMT
From: dwarren1@my-dejanews.com
Subject: Simplish regular expression Question
Message-Id: <6picbl$u9r$1@nnrp1.dejanews.com>

I think I have a decent grasp of regular expressions but I'm not sure
what the best way to accomplish this would be.  I have a string in the
form of:
"/dir/file" or "/dir/file.c" or "dir/file" or "dir/file.c"
and in each case I would like to change the string to simply be "dir/file"
My current regexp looks like:
#!/usr/bin/perl
$str="\"/dir/file.c\"";
$str=~s/^"[\/]?([\w\/]*)(\.c)?\"$/"$1"/;
print "'$str'\n";
and it works, however I don't like [\w\/]* i'd like to use lookahead and
say (.*) except '.c' together.  However I'm not quite sure how to best
do that.  Anyone have any suggestions?  (Or in the more simplified form
how do you get a regular expression to match aribtrary data EXCEPT for a
fixed string that may or may not be there?

-Doug

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 27 Jul 1998 17:53:16 GMT
From: aarond@alpha.ewl.uky.edu (Aaron B. Dossett)
Subject: Re: Simplish regular expression Question
Message-Id: <6pieqc$73r$1@service3.uky.edu>

dwarren1@my-dejanews.com wrote:
> I think I have a decent grasp of regular expressions but I'm not sure
> what the best way to accomplish this would be.  I have a string in the
> form of:
> "/dir/file" or "/dir/file.c" or "dir/file" or "dir/file.c"
> and in each case I would like to change the string to simply be "dir/file"
> My current regexp looks like:
> #!/usr/bin/perl
> $str="\"/dir/file.c\"";
> $str=~s/^"[\/]?([\w\/]*)(\.c)?\"$/"$1"/;

The following is almost certainly more effecient:

 $str =~ s/^\///;  #More readable as  s#^/##;
 $str =~ s/\.c$//;

Hope that helps,

Aaron
-- 
Aaron B. Dossett   |   Finger aarond@london.cslab.uky.edu for PGP key
dossett@bigfoot.com|      
Comp. Sci. Senior  |         http://www.ewl.uky.edu/~aarond
    University of Kentucky    1996 & 1998 NCAA Basketball Champions


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

Date: Mon, 27 Jul 1998 16:21:53 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: Submit only Once
Message-Id: <35bca561.120600557@news2.cais.com>

malch@malch.com (Malcolm Hoar) Said this:

>In article <6pi44b$sa1$1@client3.news.psi.net>, abigail@fnx.com wrote:
>>Sam Irion (persoft@concentric.net) wrote on MDCCXCI September MCMXCIII in
>><URL: news:6phuj7$qo3@examiner.concentric.net>:
>>++ Can anyone give me any advice or direction on how to prevent the user from
>>++ using the browser's back button to go back to a form and repost it?
>>
>>You can't. And that has nothing to do with Perl.
>
>There are several things you can do. None of which has anything
>to do with Perl really :-)
>
>For example, have the form processing script prevent more
>than "x" submissions from the same IP address in "y" seconds.
>
>Not totally foolproof but it will prevent a good deal of "spew".
>

Or perhaps....  have the form created by another script that generates
a unique ID, and then in the recieving script, if you encounter a
"used" ID, don't allow the process to continue.  If the ID has not
been seen before, good - send the message.

This would require keeping a small file, probably just the unique ID,
or an incremented number, and then reading it as the first step in
determining what to do.




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

Date: Mon, 27 Jul 1998 16:59:28 GMT
From: malch@malch.com (Malcolm Hoar)
Subject: Re: Submit only Once
Message-Id: <6pibl8$mhe$1@nntp1.ba.best.com>

In article <35bca561.120600557@news2.cais.com>, root.noharvest.\@not_even\here.com wrote:
>>For example, have the form processing script prevent more
>>than "x" submissions from the same IP address in "y" seconds.
>
>Or perhaps....  have the form created by another script that generates
>a unique ID, and then in the recieving script, if you encounter a
>"used" ID, don't allow the process to continue.  If the ID has not
>been seen before, good - send the message.

Checking the IP is probably more effective against 'bots' which,
in my experience, cause many more multiple-submissions than
humans. May not work with round-robin proxies but we're getting
further and further off-topic for c.l.p.m ....

-- 
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
| Malcolm Hoar           "The more I practice, the luckier I get". |
| malch@malch.com                                     Gary Player. |
| http://www.malch.com/               Shpx gur PQN.                |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: 27 Jul 1998 17:08:31 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Submit only Once
Message-Id: <6pic6f$gq$1@client3.news.psi.net>

Malcolm Hoar (malch@malch.com) wrote on MDCCXCI September MCMXCIII in
<URL: news:6pi62h$knh$1@nntp1.ba.best.com>:
++ In article <6pi44b$sa1$1@client3.news.psi.net>, abigail@fnx.com wrote:
++ >Sam Irion (persoft@concentric.net) wrote on MDCCXCI September MCMXCIII in
++ ><URL: news:6phuj7$qo3@examiner.concentric.net>:
++ >++ Can anyone give me any advice or direction on how to prevent the user from
++ >++ using the browser's back button to go back to a form and repost it?
++ >
++ >You can't. And that has nothing to do with Perl.
++ 
++ There are several things you can do. None of which has anything
++ to do with Perl really :-)
++ 
++ For example, have the form processing script prevent more
++ than "x" submissions from the same IP address in "y" seconds.

But that's not what he asked.



Abigail
-- 
perl  -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
          for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
          print chr 0x$& and q
          qq}*excess********}'


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

Date: Mon, 27 Jul 1998 17:41:27 GMT
From: mpeppler@mbay.net
To: tegelert@gol.com
Subject: Re: Sybperl CTLib ct_callback causes coredump
Message-Id: <6pie47$pb$1@nnrp1.dejanews.com>

In article <35B95B97.A90E226E@gol.com>,
  Tom Tegeler <tegelert@gol.com> wrote:
> I'm using V5 perl with V2 sybperl on solaris.  I'm registering two
> callbacks for servicing the client messages and server messages.  This
> is being done in the same way as the example code which comes with
> sybperl:
>
> ct_callback(CS_CLIENTMSG_CB, \&msg_cb);
> ct_callback(CS_SERVERMSG_CB, "srv_cb");
>

>
> The callbacks work sometimes, but in one case they always cause my
> program to coredump.  This is a case where I'm inserting a  row which
> has a duplicate primary key

This is a known problem.

Please upgrade to 2.09_05, available from CPAN or from
http://www.mbay.net/~mpeppler

Michael

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Mon, 27 Jul 1998 11:12:34 -0500
From: Jamison Stepan <jstepan@uswest.net>
Subject: Variable interpolation in a hash key
Message-Id: <35BCA6F2.B8F80766@uswest.net>

Hello,

I'm losing my mind trying to figure out how to interpolate a variable
into a hash key. Basicall what I am trying to do is this:

$noofchild = $query->param('noofchild');
for ($x=1; $x <= $noofchild; ++$x) {
	if ($query_hash{"c",$x,"black"}) {$query_hash{"c",$x,"black"} = "1";}
else {$query_hash{"c",$x,"black"} = "0";}
}

Previous to this statement I dumped all my querystring variables into a
hash called $query_hash.

Is this kind of interpolation even possible, or do I need to parse
things out seperatly?

Jamison

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jamison Stepan
Internet Application Developer
Minnesota Department of Children,
     Families and Learning
Jamison.Stepan@state.mn.us
jstepan@uswest.net
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: 27 Jul 1998 16:26:28 GMT
From: Dan Nguyen <nguyend7@egr.msu.edu>
Subject: Re: Variable interpolation in a hash key
Message-Id: <6pi9nk$rf9$1@msunews.cl.msu.edu>

Jamison Stepan <jstepan@uswest.net> wrote:
: I'm losing my mind trying to figure out how to interpolate a variable
: into a hash key. Basicall what I am trying to do is this:

Sorry to hear that.  

: $noofchild = $query->param('noofchild');
: for ($x=1; $x <= $noofchild; ++$x) {
: 	if ($query_hash{"c",$x,"black"}) {$query_hash{"c",$x,"black"} = "1";}
: else {$query_hash{"c",$x,"black"} = "0";}
: }

Your problem is with $query_hash{"c",$x,"black"}.  You probably mean
$query_hash{"c".$x."black"}.  Hashes are only stored by one key.

-dan

-- 
           Dan Nguyen            | There is only one happiness in
        nguyend7@msu.edu         |   life, to love and be loved.
http://www.cse.msu.edu/~nguyend7 |                   -George Sand



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

Date: Mon, 27 Jul 1998 12:12:54 -0400
From: "Philip M. Howard" <aa162@RemoveThis.chebucto.ns.ca>
Subject: Which Sybase products contain Sybperl library files for Solaris?
Message-Id: <6pi925$n5d$1@tor-nn1.netcom.ca>

We want to use Sybperl on Solaris with Sybase Enterprise and SQL Anywhere
servers. It's not clear from either Sybperl documentation or Sybase's web
site exactly which packages contain the required CTLib file(s). A demo copy
of SQL Anywhere downloaded from Sybase does not contain the libraries.

Any pointers would be appreciated.

Thanks,
-Philip




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

Date: Mon, 27 Jul 1998 12:17:13 -0400
From: "Philip M. Howard" <aa162@RemoveThis.chebucto.ns.ca>
Subject: Re: Which Sybase products contain Sybperl library files for Solaris?
Message-Id: <6pi9a7$nhj$1@tor-nn1.netcom.ca>

 ...just received the following response from Michael Peppler
[mpeppler@mbay.net]:

>You need Sybase OpenClient for Solaris 2.x. Contact Sybase for pricing,
etc.
>
>Michael

Thanks!
-Philip


Philip M. Howard wrote in message <6pi925$n5d$1@tor-nn1.netcom.ca>...
>We want to use Sybperl on Solaris with Sybase Enterprise and SQL Anywhere
>servers. It's not clear from either Sybperl documentation or Sybase's web
>site exactly which packages contain the required CTLib file(s). A demo copy
>of SQL Anywhere downloaded from Sybase does not contain the libraries.
>
>Any pointers would be appreciated.
>
>Thanks,
>-Philip
>
>




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

Date: Mon, 27 Jul 1998 16:06:59 GMT
From: ChicagoJen@my-dejanews.com
Subject: Re: Win32 install prob--another idiot
Message-Id: <6pi8j3$p2h$1@nnrp1.dejanews.com>

Have you tried setting up a bat file and having that execute the pl file?  I
just completed a project using Netscape Enterprise Server and used a bat file
to execute the pl.  I was also getting a forbidden error message but that's
because I screwed up on the path in the bat file.

-Jennifer

In article <6pfekk$qsc$1@news-2.news.gte.net>,
  "tdean" <tdeanatgtedotnet> wrote:
> Neal:
> see microsoft kb article Q150629
> this may be obtained by sending an email to mshelp@microsoft.com and placing
> the Q number in the Subject field
>
> --
> ICQ 7305805
> replace at with @ and dot with .
> Neal Miyake wrote in message <01bdb20c$ed402e80$4e0918cf@default>...
> >Help!
> >
> >I'm trying to install Perl for Win32 (from Activeware, version 5.003) onto
> >my NT Server running IIS3.  It loads fine, and seems to work.  I can do the
> >"helloworld.pl" from the command line no prob (there is a path set to the
> >perl.exe file)
> >
> >However, when I try and run a script through my browser (IE4), I get big
> >time problems.  If I put a perl script in the c:\inetpub\perl\bin directory
> >and try and run it, I get an 403.2 error (Forbidden read access).  If I put
> >it somewhere under c:\inetpub\wwwroot tree, the script is displayed on the
> >browser.
> >
> >I thought, when I installed it, it set any .pl file to run perl.exe.  What
> >gives?
> >
> >Also, do I have to choose a particular "bin" directory exclusively to put
> >my scripts in?  How do I set up the directory permissions or settings in
> >NT?
> >
> >Please help me!  I am stressing under an extreme deadline.  Please copy to
> >sponge@iav.com also.  Thanks, in advance.
> >
> >Neal Miyake
>
>

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 27 Jul 1998 17:50:56 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Y2K problem in PERL with localtime()
Message-Id: <6piem0$75v$1@news.NERO.NET>

In article <6pg3no$k93$2@marina.cinenet.net>,
Craig Berry <cberry@cinenet.net> wrote:
>  length($num = sprintf "%2d", 100) == 2 or die 'trying';
>  print $num;
>
>Admittedly a bit verbose, 

Yes, very.

>but I for one would rather have the real value
>printed than silently get digits chopped off, and dieing on a format
>overflow would both break with long C-lineage convention and kill a lot of
>existing code.

I fail to see how using a function that fails on a format overflow (that
does not yet exist) could kill existing code.

>: If I use a format of "%2d", I am asking for two characters to be
>: returned. I am not asking for at least two digits. If I were, then the
>: system would have failed to comply when it returns " 1" for the number
>: 1.
>
>Wrong.  

Which part of my statement is wrong? "%2d" is asking for two characters.
It is NOT asking for two digits. And if "%2d" really were asking for two
digits, then the system has failed when it returns " 1", since " " is
not a digit.

>The '2' is a minimum field width specifier, not a minimum digit
>count specifier.

I'm not the one who said it was a minimum digit count. In fact, I think
I proved that it wasn't.

>: Nothing. I am pointing out a place where the standard library behaves
>: non-intuitively and can cause errors to propogate when it could flag
>: them for the user.
>
>I wonder if -w could provide a warning for format overflows?  This should
>probably wait until finer-grained warning control is available, if ever.

I would think a module to either replace the core of printf or create a
error-handling printf under a new name would be better.



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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 3266
**************************************

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