[13853] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1263 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 3 06:05:25 1999

Date: Wed, 3 Nov 1999 03:05:08 -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: <941627108-v9-i1263@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 3 Nov 1999     Volume: 9 Number: 1263

Today's topics:
    Re: <STDIN> to a @ (M.J.T. Guy)
    Re: Another 'or'? was [perl double-split] (Bart Lateur)
        Apache, Perl, Crypt & MD5 -- Which module? <jjyooi@dcs.qmw.ac.uk>
    Re: How can I set reg. expresion to anchor at the end o (Abigail)
    Re: Need to remove url and keep file crackbaby1@my-deja.com
    Re: perl JS interpreter? counting keywords? <mark.bluemelNOmaSPAM@siemens.co.uk.invalid>
        Perl RFC 1725 compliant pop3 demon <david@kasey.umkc.edu>
    Re: Problem With Delimited Field Sort <skilchen@swissonline.ch>
        result of param() function seems to be cached johancoens@my-deja.com
    Re: string number conversion <lr@hpl.hp.com>
    Re: string number conversion (Matthew Bafford)
        Translation required <florencet@wrox.com>
    Re: Why doesn't this work? <deja@jazman.freeserve.co.uk>
        Year 2000 date problem <ofuuzo@ub.uit.no>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 3 Nov 1999 10:03:09 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: <STDIN> to a @
Message-Id: <7vp18t$l1r$1@pegasus.csx.cam.ac.uk>

Craig Berry <cberry@cinenet.net> wrote:
>
>I can't defend any alternative, but this special case does bother me.
>Ordinarily, an empty regex means "match on last regex encountered" (see
>another currently active thread on this issue).  Giving it yet another
>special meaning in the context of split is a little too magical for my
>taste.

The empty regex only has that meaning in the context m// or s//replacement/
  -   not for any other use of a regex.    And the precise phrasing should
be "match on the last regex successfully matched in a m// or s//.../".

(Not justifying  -  just trying to clarify.)


Mike Guy


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

Date: Wed, 03 Nov 1999 08:53:49 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Another 'or'? was [perl double-split]
Message-Id: <3822f7fb.4004636@news.skynet.be>

Abigail wrote:

>Eh, no. You would get "0" back.

Maybe I mistyped something, or the message was lost in all the rethoric.
Here's a working example:

	$^W = 1;
	$caption = "0";
	undef $text;
	print $caption || $text;
-->
	Use of uninitialized value at ...

-- 
	Bart.


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

Date: Wed, 03 Nov 1999 08:30:01 +0000
From: Johnny 'Loopy' Ooi <jjyooi@dcs.qmw.ac.uk>
Subject: Apache, Perl, Crypt & MD5 -- Which module?
Message-Id: <381FF289.14B41C48@dcs.qmw.ac.uk>

I want to access a password file encrypted using the MD5 method
implemented by Apache 1.3.6. Which module do I use? I've searched CPAN
and it came up with several options. I don't know which one? Can anyone
help? I'm using Win95.

Johnny


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

Date: 2 Nov 1999 23:24:32 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: How can I set reg. expresion to anchor at the end of a string?
Message-Id: <slrn81vhjg.tjn.abigail@alexandra.delanet.com>

Vincent Murphy (vincent.murphy@cybertrust.gte.com) wrote on MMCCLV
September MCMXCIII in <URL:news:xjgu2n4fceg.fsf@gamora.ndhm.gtegsc.com>:
,, 
,, 
,, Simply do:
,, 
,, perl -e '$string="123424";$tmp=reverse $string; @stnemele=$tmp=~/(?:(\d{4}|\d+))/g; \
,,  @elements= map { $n=reverse($_); $n } @stnemele;  print join(", ", @elements), "\n";'
,, 


A short, but quadratic solution:

   split /(?=(?:....)*$)/;


Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Wed, 03 Nov 1999 05:13:13 GMT
From: crackbaby1@my-deja.com
Subject: Re: Need to remove url and keep file
Message-Id: <7vog97$68a$1@nnrp1.deja.com>

This worked, I got the code from another post.

if  ($image_file =~ /.*\//)
        {
        $imagefile = "$'\n";
        }

Thanks for the code...

In article <7vob6e$2o2$1@nnrp1.deja.com>,
  crackbaby1@my-deja.com wrote:
> I have a program that will let users upload a file by letting them
> browse through their hard drive and hitting upload. All I need to do
is
> when the form is submitted I need to remove, ie. (C:\WINNT\.....\)
> but keep the file name, ie.(go.gif)
>
> Any ideas?
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 03 Nov 1999 01:43:42 -0800
From: Mark Bluemel <mark.bluemelNOmaSPAM@siemens.co.uk.invalid>
Subject: Re: perl JS interpreter? counting keywords?
Message-Id: <0a0133f8.fc4a5b0c@usw-ex0102-014.remarq.com>

In article <GFNT3.23308$23.1201979@typ11.nn.bcandid.com>,
kragen@dnaco.net (Kragen Sitaker) wrote:
> In article <381E5943.E6203019@klab.caltech.edu>,
> Laurent Itti  <itti@klab.caltech.edu> wrote:
> >does anybody know of an interpreter for JavaScript in perl?
> No.
> >I am trying to write an exhaustive web bot in perl, which would go
> >through
> >most of the classical hoops used to keep bots away.
> Maybe if people don't want your web bot crawling their site, you
> shouldn't make your web bot crawl their site.  After all, it *is*
> their
> web server, not yours, isn't it?

Amen to that brother...


* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Wed, 03 Nov 1999 05:41:02 +0000
From: "David L. Nicol" <david@kasey.umkc.edu>
Subject: Perl RFC 1725 compliant pop3 demon
Message-Id: <381FCAEE.9B678545@kasey.umkc.edu>


Announcing, drumroll please, a fully rfc-1725 compliant
pop3 daemon that reads maildir-style directories and attaches
the first line of a split header if the header broke all the
way off (which can mess up at least one MUA.)

Http://www.tipjar.com/kcpm/toys.html

Included is a script to cause sendmail to deliver to a directory.

Configuration is via editing of clearly marked sections in the
programs.
 
______________________________________________________________
                      David Nicol 816.235.1187 nicold@umkc.edu
                                                    "ereiamjh"


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

Date: Wed, 03 Nov 1999 09:53:24 GMT
From: "Samuel Kilchenmann" <skilchen@swissonline.ch>
Subject: Re: Problem With Delimited Field Sort
Message-Id: <oCTT3.28507$m4.102177359@news.magma.ca>

Kragen Sitaker <kragen@dnaco.net> wrote in message
news:20OT3.23363$23.1206512@typ11.nn.bcandid.com...
> In article <KbMT3.28481$m4.101918295@news.magma.ca>,
> Samuel Kilchenmann <skilchen@swissonline.ch> wrote:
> >But i have a followup question:
> >Joseph N. Hall writes:
> >  my $sortfunc  = eval "sub { " . join (" or ", @sortcode) . " } ";
> >  my $splitfunc = eval 'sub { (split /$sep/o, $_)[@col] } ';
> >
> >while i would write that as:
> >  my $sortfunc  = sub { eval join (" or ", @sortcode) };
> >  my $splitfunc = sub { eval '(split /$sep/o, $_)[@col]' };
> >
> >Are there any semantic differences between these two versions?
>
> There's at least one.  This code:
>

Thanks a lot for the very enlightening clarifications!

> #!/usr/bin/perl -w
> use strict;
> use vars '$variable';
>
> $variable = 8;
> my $sub1;
> my $sub2;
> {
>   my $variable = 112;
>   $sub1 = sub { eval '$variable' };
>   $sub2 = eval 'sub { $variable }';
> }
>
> print "got ", $sub1->(), " and ", $sub2->(), "\n";
>
> . . . produces the following output:
> Use of uninitialized value at tmp.x line 14.
> got  and 112
>
> sub2 is able to capture a reference to the lexical $variable.  I
> don't know what the heck is going on with sub1; I thought it would
> surely return 8, which is the value of the package $variable, but
> instead it returns undef.
>
A complete mistery to me too. sub1 "knows" the value of the lexical
$variable within the block, but it doesn't "close" it.

[another nice example snipped]

>
> There are, of course, efficiency differences; reparsing the body of
> the subroutine every time you want to run it can't be the best way
> to solve any problem.

Yes, for some strange reason i missed the now (thanks to your
explanation) very evident fact, that with my rewrite attempt, i was
delaying the execution of the eval statements until the coderefs are
actually called.

In my rewrite of splitfunc the use of "eval" is especially pointless:
my $splitfunc = sub { eval '(split /$sep/o, $_)[@col]' };
seems to be equivalent to:
my $splitfunc = sub { (split /$sep/o, $_)[@col] };




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

Date: Wed, 03 Nov 1999 09:51:43 GMT
From: johancoens@my-deja.com
Subject: result of param() function seems to be cached
Message-Id: <7vp0je$hi5$1@nnrp1.deja.com>

Perl/Intershop problem

I've got a page with a url like this:

http://somewhere.com/cgi-bin/page?cat=1044&minprice=50&maxprice=100&tst=
123

So, my parameters are
cat (value = 1044)
minprice (value = 50)
maxprice (value = 100)
tst (value = 123)

I use a little perl-script that reads this variables and display them.
The code is:

#BEGIN                          #INTERSHOP
#!/usr/bin/perl -w
use CGI;
$cgi = CGI->new();
@allparams = $cgi->param();
foreach $param (@allparams){
  AddContent($param);            #AddContent is a Intershop function
  AddContent(": ");
  AddContent(param($param));
  AddContent("<BR>");
}
#END

But, the output is:
cat: 1034
minprice: 0
maxprice: 50

Even if I try running this page on different computers, even at home,
the output is this. Notice that the 'tst' parameter is not displayed.

I also made a user defined template with only this script and totaly
different parameters, but surprisingly, the output was the same as
above.

When I change the name of the parameters or the values of the
parameters, the result stays the same. I tried different ways to display
the parameters, tried to assign the values of the parameters to
variables, but it did not make any difference.

It seems like the problem is in the caching of the param() function of
Perl. I have tried to assign a value to a variable and display the
variable, and that worked fine. So, it doesn't seem to be a variable
caching.

The problem is the same in IE 5.0 and Netscape 4.08, and the output is
the same for different sessions.

Any help would be appreciated.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 2 Nov 1999 16:34:54 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: string number conversion
Message-Id: <MPG.1289230d682a0a7b98a197@nntp.hpl.hp.com>

In article <slrn81utaj.tjn.abigail@alexandra.delanet.com> on 2 Nov 1999 
17:36:25 -0600, Abigail <abigail@delanet.com> says...

 ...

> Oh, I did, I did. I just didn't copy all of it. Read the followup I
> did on myself only a few minutes later.

I never saw it.  Here are the timestamps on this subthread (all Nov 2, 
PST):

Your buggy post:   03:42
My jibe:           07:17
Your reply (this): 15:36

I just looked at Deja.com, and the original is there, as well as your 
correction.  No timestamps are apparent.

Others have noted some of your transmissions going away.  But here's one 
that got to Deja.com but not to me.  Hmmm...

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Wed, 03 Nov 1999 10:51:53 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: string number conversion
Message-Id: <slrn8203ce.4me.*@dragons.duesouth.net>

Tue, 2 Nov 1999 16:34:54 -0800, a great smashing of the head occured
against Larry Rosler <lr@hpl.hp.com>'s keyboard, causing
comp.lang.perl.misc to receive this: 
: Your buggy post:   03:42
  Her correction:    03:49
: My jibe:           07:17
: Your reply (this): 15:36

: (Just Another Larry) Rosler

--Matthew


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

Date: 3 Nov 1999 10:53:05 GMT
From: flo <florencet@wrox.com>
Subject: Translation required
Message-Id: <7vp46h$m8j$1@news.x-echo.com>

Hi all,

I am looking for a French translation of "weakly-typed language" and "st
rongly-typed language" regarding to Perl or any other language.

Thanks a lot,

Flo.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Article poste via Voila News - http://www.news.voila.fr
Le : Wed Nov  3 11:53:05 1999 depuis l'IP : 212.250.238.65


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

Date: Wed, 03 Nov 1999 10:12:32 GMT
From: Dave <deja@jazman.freeserve.co.uk>
Subject: Re: Why doesn't this work?
Message-Id: <7vp1qf$ihv$1@nnrp1.deja.com>

Absolutely; I work on a helpdesk and this sort of question is dealt with
thus:

1. Strip out all the bits that work.
2. Explain what you want what's left to do, and what it currently does,
and why that's wrong (if it isn't immediately obvious).

In 95% of cases we never hear back because they've found the error.
>4% of cases the customer actually needs the error they've made
explaining to them.
<1% of cases there's actually a bug.

Dave.


In article <slrn81vflj.tjn.abigail@alexandra.delanet.com>,
  abigail@delanet.com wrote:
> Tony (010101@technologist.com) wrote on MMCCLIV September MCMXCIII in
> <URL:news:381F380A.19372B56@technologist.com>:
> // I have a form that goes:
>
> [ 200+ lines of HTML and Javacrud ]
>
> // and a cgi script that goes:
>
> [ 144 lines of Perl code without -w, -T, use strict; use CGI; or
>   checking the status of system calls ]
>
> // Can anyone explain to me why this is isn't working?
>
> You probably have a bug.
>
> You post gigantic quantities of bad code, yet you fail to indicate
what
> went wrong, and you still expect someone to dive in and debug it for
you?
>
> Get real.
>
> Abigail
> --
> perl -MTime::JulianDay
-lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
>
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>I
V=>0=>0
>
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#
r}for(;
> !$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'
>
>   -----------== Posted via Newsfeeds.Com, Uncensored Usenet News
==----------
>    http://www.newsfeeds.com       The Largest Usenet Servers in the
World!
> ------== Over 73,000 Newsgroups - Including  Dedicated  Binaries
Servers ==-----
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 03 Nov 1999 11:50:42 +0100
From: ofuuzo <ofuuzo@ub.uit.no>
Subject: Year 2000 date problem
Message-Id: <38201382.DC3CC7A6@ub.uit.no>

Hi,

I  have the following perl date/time script:

 ........
@months = ('Jan','Feb','Mar','Apr','May','Jun',
   'Jul','Aug','Sept','Oct','Nov','Dec');
@days = ('Sun','Mon','Tue','Wed','Thur','Fri','Sat');
($sec,$min,$hour,$mday,$mon,$year,$wday) =
(localtime(time))[0,1,2,3,4,5,6];
if ($year > "96") {
 $yd = "19$year";
}
else {
 $yd = "20$year";

}
$date = " $days[$wday] $mday. $months[$mon]  $yd ";
 .........

When I set the year in my computer to 1999,  the exact day, month  and
year will be printed. But when I set the year in my computer to 2000,
the year changes to 19100 instead of 2000.
What is wrong with the above script. I need help.

Thanks in advance.

OO



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

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 1263
**************************************


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