[15768] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3181 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 27 00:05:35 2000

Date: Fri, 26 May 2000 21:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <959400311-v9-i3181@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 26 May 2000     Volume: 9 Number: 3181

Today's topics:
    Re: @INC Assistance (Mark P.)
    Re: Advantages of Perl over Cold Fusion? <mark@sharewire.com>
    Re: CGI and sytem calls.. (Gwyn Judd)
    Re: count the number of lines <rick.delaney@home.com>
    Re: devel.tar.gz does not exist at www.cpan.org/src <elaine@chaos.wustl.edu>
    Re: Expressions <jihad.battikha@sharewire.com>
    Re: How Sambar 4.2 run CGI ? <adolftw@tcts1.seed.net.tw>
    Re: how to /s '[item]' <bmb@dataserv.libs.uga.edu>
    Re: how to /s '[item]' (Gwyn Judd)
    Re: Html translation <thepoet1@arcormail.de>
    Re: my $x vs. my ($x) <phill@modulus.com.au>
    Re: my $x vs. my ($x) <thepoet1@arcormail.de>
    Re: Newbie - need to rip images from URL <thepoet1@arcormail.de>
    Re: No libgdbm.so under Solaris 2.6 <elaine@chaos.wustl.edu>
    Re: No libgdbm.so under Solaris 2.6 <elaine@chaos.wustl.edu>
    Re: oops Re: seeking method to encode email addresses i <godzilla@stomp.stomp.tokyo>
    Re: oops Re: seeking method to encode email addresses i (brian d foy)
    Re: oops Re: seeking method to encode email addresses i <elaine@chaos.wustl.edu>
    Re: Open Source Credit Card Processing in Perl <jihad.battikha@sharewire.com>
    Re: Perl date formatting <jihad.battikha@sharewire.com>
    Re: Perl Editor for Linux <elaine@chaos.wustl.edu>
    Re: Perl unusable as a programming language <epa98@doc.ic.ac.uk>
    Re: Perl, system and Cron johnqxu@my-deja.com
        Question on Using cgi-lib.pl <mmlai@sfu.ca>
        Regex prime numbers (Was Re: seeking method to encode e (Gwyn Judd)
    Re: Regex prime numbers (Was Re: seeking method to enco <bmb@dataserv.libs.uga.edu>
    Re: seeking method to encode email addresses in web pag <godzilla@stomp.stomp.tokyo>
    Re: seeking method to encode email addresses in web pag (brian d foy)
    Re: seeking method to encode email addresses in web pag <godzilla@stomp.stomp.tokyo>
    Re: time in microseconds? <thepoet1@arcormail.de>
    Re: Timing ? <thepoet1@arcormail.de>
    Re: using param() and CGI.pm to store a persistent valu <thepoet1@arcormail.de>
        win32 netadmin functions from cgi <jfthomps@eos.ncsu.edu>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sat, 27 May 2000 01:25:08 GMT
From: perl@imchat.com (Mark P.)
Subject: Re: @INC Assistance
Message-Id: <392f22e9.289625369@news.ionet.net>

On Fri, 26 May 2000 08:13:56 -0500, "spurcell" <skpurcell@hotmail.com>
wrote:

>Hello,
>My Perl physically lives at c:\perl
>And the lib is at c:\perl\lib
>
>Anyway, I am getting an error when I run a perl script that says it cannot
>find my GDBM_File at:
>Here is the error:
>Can't locate GDBM_File.pm in @INC (@INC contains: C:/usr/bin/Perl/lib
>C:/Perl/site/lib .) at D:\gdbm.pl line 6

	Does your Perl include the gdpm module?
>
>Anyway, my perl used to live there years ago, but it does not physically
>live at c:/Perl.

	Is the forward slash confusing you? Perl gives a damn what
windows does. The \ is an escape character to it.
>
>I went to my control panel, system, environment, and have double checked my
>path variable. It says C:\Perl;C:\Perl\lib
>
>So does anyone know what I am doing wrong? Do I need to change another
>variable elsewhere to get the @INC to understand where my real perl lives?

	No you need to add the module. If its returning an error then
your system knows where perl is, because its Perl thats returning the
error message.I suggest installing Activestate Perl so you can use the
PPM package manager.


MP


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

Date: Fri, 26 May 2000 10:08:09 -0400
From: "Mark Aisenberg" <mark@sharewire.com>
Subject: Re: Advantages of Perl over Cold Fusion?
Message-Id: <8gm0je$ded$1@paxfeed.eni.net>

You're asking a question that is part religious, and only
part technical...

FWIW:
1)  Perl is open, and not controlled by a single company.
What happens is you use a proprietary product, and the
supplier raises its prices, changes its licensing terms,
discontinues support for it, or lards it with unneeded features
and fat?  What happens if you need to move to a different
development platform, one not supported by the supplier?

2) Perl is more flexible.  What happens if you want to do
something that Cold Fusion doesn't support natively?
You'll be forced to write some code in an external language
(perhaps Perl) and integrate it in a back door.  This is
not a shortcoming with Cold Fusion per se, but it does
lessen any "we only need to learn this simple comfy
product" arguments.

3) Cold Fusion is HTML-page-centric.  What if you want to
run programs to do something other than print web pages?
For example:  load balancing among servers, unique web
log analysis, arbitrary database cleanup, process control,
etc.  You may find that you need to master Perl or other
languages anyway to run a good site.  So why learn two
things?
--
Mark Aisenberg <mark@sharewire.com>
http://www.sharewire.com/
Free forms, programs, and content for web sites.
No assembly required.


"Cory Phillips" <cory-p@usa.net> wrote in message
news:392d387f.2190722@news.jsc.nasa.gov...
> I have to write a justification to my employer to allow me to write a
> web database application using Perl.
>
> Can some of you help me come up with reasons why Perl would provide an
> advantage besides the obvious cost?  The company is pretty set on
> standardizing on Cold Fusion.
>
> One advantage I've noticed is writing reusable code.  It's easier to
> write Perl in a modular fashion using sub routines.  Cold Fusion
> supports subroutines, but it's kind of clunky getting return values.
> Also, subroutines can only exist in the same directory as the calling
> routine or global directory designated by Cold Fusion (which is
> controlled by the company's IT group and would be a pain to get them
> to install global routines as needed).
>
> This all on Windows NT.
>
> Cory Phillips
>




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

Date: Sat, 27 May 2000 02:07:04 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: CGI and sytem calls..
Message-Id: <slrn8j0vug.3cn.tjla@thislove.dyndns.org>

I was shocked! How could Matthew Wilson Emmett <memmett@fraser.sfu.ca>
say such a terrible thing:
>
>Hello,
>
>I was wondering how "expensive" doing something like
>
>$contents = `cat $name`;
>
>in CGI script that will be run many many time is?  Should I try and
>avoid system calls like the above in my CGI scripts to keep
>web-hosters happy?
>
>Any thoughts and opinions are greaty appreciated,

The only answer to this sort of question is benchmarking. Note that this
is the first time I have used the (herein excellent) Benchmark module so
I may have done it wrong somehow:

use Benchmark;

$name = 'xyzzy';
$size = -s $name;

timethese(10000, {
  'open' => 'open FILE, $name or die "cannot open $name: $!"; $contents
=
	       join "", (<FILE>);',
	'read' => 'open FILE, $name or die "cannot open $name: $!"; $bytes =
	       read FILE, $contents, $size; die "not enough bytes read: $!"
				 unless ($size == $bytes);',
	'sysread' => 'open FILE, $name or die "cannot open $name: $!"; $bytes
	       = sysread FILE, $contents, $size; die "not enough bytes read:
$!"
				 unless ($size == $bytes);',
	'cat' => '$contents = `cat $name`'
});

Results:

$ perl -w cat.pl
Name "main::size" used only once: possible typo at cat.pl line 4.
Benchmark: timing 10000 iterations of cat, open, read, sysread...
       cat: 107 wallclock secs ( 4.10 usr  9.30 sys + 27.89 cusr 65.91
csys = 107.20 CPU) @ 746.27/s (n=10000)
      open:  3 wallclock secs ( 1.96 usr +  0.83 sys =  2.79 CPU) @
3584.23/s (n=10000)
      read:  0 wallclock secs ( 0.14 usr +  0.21 sys =  0.35 CPU) @
28571.43/s (n=10000)
            (warning: too few iterations for a reliable count)
   sysread:  1 wallclock secs ( 0.15 usr +  0.20 sys =  0.35 CPU) @
28571.43/s (n=10000)
            (warning: too few iterations for a reliable count)

So for a busy site and if you are going to have to do this many many
times I would not use `cat $file` but rather one of the other methods. I
suggest you learn about benchmarking as it is a useful skill.

-- 
Gwyn Judd (tjla@guvfybir.qlaqaf.bet)
My return address is rot13'ed
politics, n.:
	A strife of interests masquerading as a contest of principles.
	The conduct of public affairs for private advantage.
		-- Ambrose Bierce


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

Date: Sat, 27 May 2000 04:01:45 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: count the number of lines
Message-Id: <392F4A03.73EEF705@home.com>


Larry Rosler wrote:
> 
> It took me almost a week to get back to this, but I'm glad I did,
> because I differ with your conclusion.  If you believe these tests, my
> expectation about index() vs regex is correct, by a factor of almost 2.
> 

When we know that there is a match.  I'm surprised; I didn't think the
RE engine would be entered.

> I simplified the code to reduce to benchmarking only the match, rather
> than including the grep.
> 
> #!/usr/local/bin/perl -w
> use strict;
> use Benchmark;
> 
> timethese (1 << (shift || 0) => {
>     Idx => q { my $x = index('pattern', 'pattern') == 0 },
>     RE  => q { my $x = 'pattern' =~ /^pattern/ },
> });
> __END__
> 
> Benchmark: timing 262144 iterations of Idx, RE...
>        Idx:  1 wallclock secs ( 1.11 usr +  0.00 sys =  1.11 CPU) @
> 236378.72/ (n=262144)
>         RE:  1 wallclock secs ( 2.06 usr +  0.00 sys =  2.06 CPU) @
> 127069.32/ (n=262144)


When we're assured of failure, there is no significant difference, as
expected.

timethese (1 << (shift || 0) => {
    Idx => q { my $x = index('slattern', 'pattern') == 0 },
    RE  => q { my $x = 'slattern' =~ /^pattern/ },
});
__END__
Benchmark: 
timing 1048576 iterations of
 Idx, RE
 ...

       Idx:  3 wallclock secs ( 1.92 usr +  0.00 sys =  1.92 CPU) @
546133.33/s (n=1048576)

        RE:  3 wallclock secs ( 1.97 usr +  0.00 sys =  1.97 CPU) @
532272.08/s (n=1048576)

The reason this is expected is because the RE engine is never entered in
this simple case.

Put 

    use re 'debug' 

at the beginning of your program and run one iteration:

Compiling REx `^pattern'
size 5 first at 2
   1: BOL(2)
   2: EXACT <pattern>(5)
   5: END(0)
anchored `pattern' at 0 (checking anchored) anchored(BOL) minlen 7 
Guessing start of match, REx `^pattern' against `slattern'...
String not equal...
Match rejected by optimizer
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Freeing REx: `^pattern'

When there is a match, the RE engine is entered and we get:

Guessing start of match, REx `^pattern' against `pattern'...
Guessed: match at offset 0
Matching REx `^pattern' against `pattern'
  Setting an EVAL scope, savestack=109
   0 <> <pattern>         |  1:  BOL
   0 <> <pattern>         |  2:  EXACT <pattern>
   7 <pattern> <>         |  5:  END
Match successful!
Freeing REx: `^pattern'

I guess it's the anchor that causes this because changing the test so
that it's not anchored ends up with the RE engine unentered and
comparable results.

timethese (1 << (shift || 0) => {
    Idx => q { my $x = index('some pattern', 'pattern') >= 0 },
    RE  => q { my $x = 'some pattern' =~ /pattern/ },
});
__END__
Benchmark: 
timing 1048576 iterations of
 Idx, RE
 ...

       Idx:  3 wallclock secs ( 1.92 usr +  0.00 sys =  1.92 CPU) @
546133.33/s (n=1048576)

        RE:  3 wallclock secs ( 2.20 usr +  0.00 sys =  2.20 CPU) @
476625.45/s (n=1048576)

 ...

anchored `pattern' at 0 (checking anchored isall) minlen 7 
Guessing start of match, REx `pattern' against `some pattern'...
Found anchored substr `pattern' at offset 5...
Guessed: match at offset 5
Freeing REx: `pattern'

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Sat, 27 May 2000 02:07:56 GMT
From: Elaine Ashton <elaine@chaos.wustl.edu>
Subject: Re: devel.tar.gz does not exist at www.cpan.org/src
Message-Id: <B554A63B.4DC3%elaine@chaos.wustl.edu>

in article 8gk8ko$v90$1@nnrp1.deja.com, sergei_kucherov at
sergei_kucherov@3com.com quoth:

> devel.tar.gz does not currently exist at www.cpan.org/src (file not
> found). So how do I get it? I tried several CPAN mirrors, but for an
> unknown reason they don't mirror the devel.tar.gz file.

5.6.0 is not a devel release, rather a stable release....Of course, you may
not have noticed the rather large link to 5.6.0 on the perl.com web page, or
on the perl.org web page or.....

Sometimes I wonder if people think anymore or even try their second guess
before wimping out.

There is no current development release, but if there were, it would be
5.7.x

e.



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

Date: Fri, 26 May 2000 10:54:00 -0400
From: Jihad Battikha <jihad.battikha@sharewire.com>
Subject: Re: Expressions
Message-Id: <392E9008.FCB952A5@sharewire.com>

amerar@my-deja.com wrote:

> I have a regular expression in this case:
> 
> $data =~ /($yearCP\d{6})/i
> 
> However, $year is a variable, which is followed in this case by the
> letters CP.......but I have about 30 of these letter combinations.
> 
> How do I tell it that $year is not $yearCP?    It is not seperating the
> two strings........

$data =~ /(${year}CP\d{6})/i

-- 
Jihad Battikha <jihad.battikha@sharewire.com>
  Sharewire, Inc. --- http://www.sharewire.com/
    - Free forms, programs, and content for web sites.
    - No assembly required.

Disclaimer:
Before sending me commercial e-mail, the sender must first agree
to my LEGAL NOTICE located at: http://www.highsynth.com/sig.html


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

Date: 27 May 2000 02:17:56 GMT
From: "Adolf" <adolftw@tcts1.seed.net.tw>
Subject: Re: How Sambar 4.2 run CGI ?
Message-Id: <8gnb8k$qel$1@news.seed.net.tw>

I have checked the URL/main.cgi
but Sambar return it as a document
and Sambar seem not to support permission setting




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

Date: Fri, 26 May 2000 21:36:28 -0400
From: Brad Baxter <bmb@dataserv.libs.uga.edu>
Subject: Re: how to /s '[item]'
Message-Id: <Pine.GSO.4.21.0005262135130.3759-100000@dataserv.libs.uga.edu>

On Sat, 27 May 2000, Gwyn Judd wrote:
 ...
> *grin* I was pretty diffident in correcting you Larry all things
> considered. I figure I still have lots and lots to learn. What is a Golf
> competition?

In golf you win with the fewest strokes.  Same for Perl Golf.

-- 
Brad



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

Date: Sat, 27 May 2000 03:55:17 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: how to /s '[item]'
Message-Id: <slrn8j169e.3cn.tjla@thislove.dyndns.org>

I was shocked! How could Brad Baxter <bmb@dataserv.libs.uga.edu>
say such a terrible thing:
>On Sat, 27 May 2000, Gwyn Judd wrote:
>...
>> *grin* I was pretty diffident in correcting you Larry all things
>> considered. I figure I still have lots and lots to learn. What is a Golf
>> competition?
>
>In golf you win with the fewest strokes.  Same for Perl Golf.

keystrokes? or number of characters? When is the next competition?

-- 
Gwyn Judd (tjla@guvfybir.qlaqaf.bet)
My return address is rot13'ed
Gravity is a myth, the Earth sucks.


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

Date: Fri, 26 May 2000 21:09:37 +0200
From: Christian Winter <thepoet1@arcormail.de>
Subject: Re: Html translation
Message-Id: <h5img8.32c.ln@usenet-autoren.de>

frank <frank@french-connexion.com> schrob:
> I'm looking for a script to help in tranlating html files :

> it should look for >a string between two brackets in the original
> language<, then print it, read the translation from input and write it
> in the original file.
> Maybe it should also check for end of lines to consider >this kind
> of situation<

> Any idea is welcome

Well, if you can be sure there are only alphanumeric
characters between the angle brackets, then it's a
simple regexp, otherwise it will get complicated or
hardly solvable.

Here's a little quick-hack, only problem it looses
the line-feeds (I simply put them back after every
closed angle bracket):

------------------------------------------------
#!/usr/bin/perl -w

use strict;

my $html;
open(IN, "<myfile.html") or die $!;
while(<IN>) {
  chomp;
  $html .= $_." ";
}
close IN;
$html =~ s/>(\w+\s*)*</">".translate($1)."<"/eg;

$html =~ s/>/>\n/g;

open(OUT, ">myfile.html") or die $!;
print OUT $html;
close OUT;

exit 0;

sub translate {
  my $string = shift;
  print $string;
  return <STDIN>;
}
------------------------------------------------

HTH
Christian


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

Date: Sat, 27 May 2000 11:14:27 +1000
From: Peter Hill <phill@modulus.com.au>
Subject: Re: my $x vs. my ($x)
Message-Id: <392F2173.9EF@modulus.com.au>

Tim wrote:
> 
[snip]
> 
> We have a minor holy war at work.  Most of our code uses my ($x) to
> declare lexicals.  I think this is poor style, because it is not
> equivalent to my $x, and can lead to errors like the one above.  Plus it
> looks dumb (my is not a function, dammit! :) ).  I suspect it is a result of
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Then perldoc is badly broken.
perldoc -f my
or
perldoc perlfunc

However, it is an *unusual* function, certainly, since its unbracketed
behaviour
differs from bracketed behaviour.

I think the real cargo-cult content in my ($x) = @_; lies on the RHS,
not the LHS.
Any of my ($x) = shift; my ($x) = $_[0]; my $x = shift; my $x = $_[0];
better expresses 
what is sought. 

> some cargo cult programming, where one rare case needed my ($x) = @_ in order
> to work, and it became a standard without truly understanding what was going on.
> 
> However, I have seen my ($x) in posted code, some of the books, and other
> semi-respectable sources.  Is there any kind of concensus on which is more
> appropriate?

As can be seen above my vote is with  my $x = @_; since it is a valid
assignment of the number of args., whereas my ($x) = @_; looks to me
more of an error which fortuitously DWIMs to the right thing in the
normal circumstances.

-- 
Peter Hill,
Modulus Pty. Ltd.,
http://www.modulus.com.au/


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

Date: Fri, 26 May 2000 22:52:22 +0200
From: Christian Winter <thepoet1@arcormail.de>
Subject: Re: my $x vs. my ($x)
Message-Id: <66omg8.1od.ln@usenet-autoren.de>

Randal L. Schwartz <merlyn@stonehenge.com> wrote:
> Depends on what you want:

>         my  $x  = @_; # number of elements passed to this subroutine
>         my ($x) = @_; # first element

> So, it's not a matter of which is "right", but which is "right for the
> use".  You gotta know about both.

Well, but is there really a case where
my ($x) = @_;

is more helpful than
my $x = shift;

would be? Does it happen to be important _not_ to shift the first
value off the parameter list? I'm really curious if this has ever
been something to think about, since I didn't have to care about
this yet.

Regards
Christian


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

Date: Fri, 26 May 2000 23:24:41 +0200
From: Christian Winter <thepoet1@arcormail.de>
Subject: Re: Newbie - need to rip images from URL
Message-Id: <p2qmg8.1od.ln@usenet-autoren.de>

Steven Smolinski <sjs@yorku.ca> schrob:
>>How would I capture the response [of an HTTP request for an 
>>image] to a file?

> perl -MLWP::Simple -e 'getprint("http://domain.org/image.gif")' > image.gif

Well, if already using those handy function of LWP::Simple, why
not just type

perl -MLWP::Simple -e 'getstore("http://domain.org/image.gif","image.gif")'

Regards
Christian


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

Date: Sat, 27 May 2000 02:23:04 GMT
From: Elaine Ashton <elaine@chaos.wustl.edu>
Subject: Re: No libgdbm.so under Solaris 2.6
Message-Id: <B554A9C7.4DC5%elaine@chaos.wustl.edu>

in article 8gjm9n$gvi$1@nnrp1.deja.com, ericwinslow@yahoo.com at
ericwinslow@yahoo.com quoth:
 
> Is this some new requirement under Perl 5.6? Anybody else run into this
> and find a solution?

That's odd...did you run the default configure?
use 'ldd /usr/local/bin/perl' to see if the binary is linked to the .so you
mention. 

I'm about to install 5.6.0 on a Solaris 8 box I've got, mail me if you
recompile it and still have problems.

e.



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

Date: Sat, 27 May 2000 03:47:11 GMT
From: Elaine Ashton <elaine@chaos.wustl.edu>
Subject: Re: No libgdbm.so under Solaris 2.6
Message-Id: <B554BD7F.4DD2%elaine@chaos.wustl.edu>

in article B554A9C7.4DC5%elaine@chaos.wustl.edu, Elaine Ashton at
elaine@chaos.wustl.edu quoth:
>> Is this some new requirement under Perl 5.6? Anybody else run into this
>> and find a solution?
> 
> That's odd...did you run the default configure?
> use 'ldd /usr/local/bin/perl' to see if the binary is linked to the .so you
> mention. 
 
default configure, built on Solaris 8 with gcc...

# ldd ./perl
        libsocket.so.1 => /usr/lib/libsocket.so.1
        libnsl.so.1 =>   /usr/lib/libnsl.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        libm.so.1 =>     /usr/lib/libm.so.1
        libc.so.1 =>     /usr/lib/libc.so.1
        libcrypt_i.so.1 =>       /usr/lib/libcrypt_i.so.1
        libsec.so.1 =>   /usr/lib/libsec.so.1
        libmp.so.2 =>    /usr/lib/libmp.so.2
        libgen.so.1 =>   /usr/lib/libgen.so.1
        /usr/platform/SUNW,Ultra-1/lib/libc_psr.so.1

Also, libgdbm.so* is odd as I would expect it to be a .a. I'm curious how
you got that error.

e.



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

Date: Fri, 26 May 2000 18:45:51 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: oops Re: seeking method to encode email addresses in web page forms
Message-Id: <392F28CF.CDD4FE94@stomp.stomp.tokyo>

"David H. Adler" wrote:
> Godzilla! <godzilla@stomp.stomp.tokyo> wrote:

> And where, exactly did he *force* you to do this?  
> He simply pointed out an alternative way of doing it.
> If you prefer to do it another way, I don't see any 
> attempts to stop you.



I'll clue you in on a little secret.

Mr. Dragon and myself have known each
other for years. I taught him a lot of 
tricks and hard lessons over time. He 
appreciates these hard learned lessons
although will never admit to how effective 
I was and am at teaching him a few things,
especially security related matters. I'll 
talk to him anyway I please, as he knows 
I will from years of banter.

You "big boys" of Perl make too many
assumptions about me. You don't have
a clue about my true background related
to our internet and programming. As it
is, I've been around the net and Perl
programming two to three times as long
as * almost * all of you. 

*smiles*


Godzilla!


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

Date: Fri, 26 May 2000 22:39:18 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: oops Re: seeking method to encode email addresses in web page forms
Message-Id: <brian-ya02408000R2605002239180001@news.panix.com>

In article <392F28CF.CDD4FE94@stomp.stomp.tokyo>, "Godzilla!" <godzilla@stomp.stomp.tokyo> posted:

> You "big boys" of Perl make too many
> assumptions about me. You don't have
> a clue about my true background related
> to our internet and programming.

all we know is what you post.  based on that, i consider you
a moron.  if you want to improve on that. stop posting bad code
or demonstrating a complete lack of clue.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>


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

Date: Sat, 27 May 2000 01:54:42 GMT
From: Elaine Ashton <elaine@chaos.wustl.edu>
Subject: Re: oops Re: seeking method to encode email addresses in web page forms
Message-Id: <B554A321.4DBF%elaine@chaos.wustl.edu>

in article 392F28CF.CDD4FE94@stomp.stomp.tokyo, Godzilla! at
godzilla@stomp.stomp.tokyo quoth:
> to our internet and programming. As it
> is, I've been around the net and Perl
> programming two to three times as long
> as * almost * all of you.

Every now and again you remind me of tchrist and I wonder...but then I doubt
that wasting so much time would be his bag.

I'd like to see more Perl that will run with v1 or v2!

e.



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

Date: Fri, 26 May 2000 11:25:02 -0400
From: Jihad Battikha <jihad.battikha@sharewire.com>
Subject: Re: Open Source Credit Card Processing in Perl
Message-Id: <392E974E.C510A163@sharewire.com>

What you are preposing requires using one or more established merchant
"clearing house" services which means the project has to be open-ended
enough to "plug in" to the service of choice.  Usually the clearing house
folks will provide the source for communicating with their servers but I've
never personally seen any that offer SSL-based, RAD type solutions in Perl. 
Usually they'll just provided one or two example scripts and leave it to the
developer.

Without first establishing which clearing house services you want to enable
support for, writing such a library will be difficult.  Most services
maintain proprietary methods for processing a transaction over the
Internet.  Some use SSL.  Some don't.  Some are PIN-based credit services
(like CyberCash), while others do processing of real CC numbers.  Also,
you'll eventually have to deal with the various services' management systems
if you want the library to transparently handle credits, chargebacks, and
general account administration.

Anyway, I think if you're just referring to raw, real-time CC processing
using two or three of the largest and most prominent merchant clearing
houses, with no management hooks (just the real-time processing) then I
think it would be worthwhile to research.  If the library provided a means
for someone to plug in existing account information to the supported
vendors, it would definitely be a practical resource.  However, I think
you'll need a reasonable amount of cooperation from the service providers in
order for the project to be successful.

As far as back-end strategies:

Multiple DB options: TXT (flat), DBI, ODBC
SSL support
Transaction checksums, session tracking
Encryption methods for protecting stored order data
A simple, OO interface

Multi-platform is also important.  There's no reason to tie such a thing to
a *nix-only environment.  I suggest multiple DB options to offer maximum
flexility for the end-user.  I really dislike when implementations for
simple DB-enabled programs explicitly require the use of specific DB
packages like MySQL, Oracle, or whatever.  Assume you have no idea which DB
platform the end-user prefers and program defensively.  That mostly means a
generic DBI front-end with a TXT option as backup.  ODBC can be thrown in
for kicks in case you end up with a large NT/SQL Server crowd.


Ben Humphreys wrote:

> I am attempting to gauge interest in an open-source credit card
> processing system written in Perl.  Presently at CPAN, the only
> creditcard related module is Business-CreditCard-0.21 and it is only
> useful for performing up-front LUN checks on credit card numbers.
> 
> I believe there is adequate demand for a real-time credit-card
> processing system, capable of transmitting authorization, sale,
> credit, and void transactions, via modem, to the credit card
> processing networks.  Such a settlement system would obviate the need
> for high-priced alternatives such as CyberCash, CCVS, or MS
> Transaction Server and provide e-commerce merchants better control,
> reliability, flexability, and performance than what is presently
> offerred.
> 
> I am considering Perl for this project because it provides the best
> mix of rapid development and cross-platform independance.  My
> preference is for a *nix environment but I suspect a sizable
> percentage of prospective users will want to run on Windows and I
> believe Perl is an excellent match to these requirements.
> 
> Please post if you are interested in such a system and let me know
> your thoughts on which features are most important and what back-end
> database should be used (i.e. text files, MySQL, or user-configurable
> DBI/DBD).


-- 
Jihad Battikha <jihad.battikha@sharewire.com>
  Sharewire, Inc. --- http://www.sharewire.com/
    - Free forms, programs, and content for web sites.
    - No assembly required.

Disclaimer:
Before sending me commercial e-mail, the sender must first agree
to my LEGAL NOTICE located at: http://www.highsynth.com/sig.html


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

Date: Fri, 26 May 2000 10:55:44 -0400
From: Jihad Battikha <jihad.battikha@sharewire.com>
Subject: Re: Perl date formatting
Message-Id: <392E9070.5B20F231@sharewire.com>

jwolly2@my-deja.com wrote:

> I am looking for a module to convert various date strings to a common
> format.  I have tried DateParse() from the Date::Manip module.  This
> does exactly what I need, but is too slow.

Try Date::Parse and Date::Format available from CPAN if not already on your
machine.

-- 
Jihad Battikha <jihad.battikha@sharewire.com>
  Sharewire, Inc. --- http://www.sharewire.com/
    - Free forms, programs, and content for web sites.
    - No assembly required.

Disclaimer:
Before sending me commercial e-mail, the sender must first agree
to my LEGAL NOTICE located at: http://www.highsynth.com/sig.html


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

Date: Sat, 27 May 2000 02:14:44 GMT
From: Elaine Ashton <elaine@chaos.wustl.edu>
Subject: Re: Perl Editor for Linux
Message-Id: <B554A7D3.4DC4%elaine@chaos.wustl.edu>

in article 8F3FC9BAEquuxi@193.82.145.131, Csaba Raduly at
csaba_r@my-deja.com quoth:
 
>> Try ed. 
> 
> I think that suggestion just about qualifies as a "cruel and unusual
> punishment" (as per %dth ammendment). Does asking a FAQ justify that ?
> :-)

Don't laugh, I know people who use it as their default editor.

But hey, if they are dumb enough to ask something that is almost legendary
in it's vehemence [ editor wars should really be a movie ] then maybe
they'll try ed and give it the love it deserves. :)

e.



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

Date: 26 May 2000 21:41:09 +0100
From: Edward Avis <epa98@doc.ic.ac.uk>
Subject: Re: Perl unusable as a programming language
Message-Id: <xn97lchm4d6.fsf@pinga.doc.ic.ac.uk>

cberry@cinenet.net (Craig Berry) writes:

>: At last count, Perl had 70,000 lines of core documentation. If that's
>: incomplete, we're in bigger trouble than I thought.
>
>Size != completeness.  If those 70,000 lines fail to cover some topics
>(which they do), they're incomplete.  A lot of Perl's dwimmery remains
>totally undocumented, leading to try-it-and-see as the only development
>path.

I believe that the Python people found that developing a second
implementation (JPython) made it easy to root out those language areas 
which weren't fully defined, and to define them.  Now Perl is a much
bigger language than Python, and there would be more to do, but
there's no reason why a similar exercise wouldn't work.

I imagine that the Topaz developers, when it is nearly finished, will
spend quite some time tracking down cases where their implementation
differs from perl5, and documenting what the correct behaviour is.

-- 
Ed Avis
epa98@doc.ic.ac.uk


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

Date: Sat, 27 May 2000 03:21:22 GMT
From: johnqxu@my-deja.com
Subject: Re: Perl, system and Cron
Message-Id: <8gnev9$8b1$1@nnrp1.deja.com>

When cron job is set,the current directory is in your root directory.
Thus, if you open file under current directory and that file is not
under user root, then this file can not be opened. Try to set a
directory for you temp file and hope it solve your problem.

However, I have a similar problem and haven't have a solution yet.
I have a confiuration file which "include" by "require" in my perl file.
The configuration file is in the same directory with perl program. It
worked fine. When I set up my cron job, the configuration file just can
not be found by perl default path. I know if I put all confiuration
parameters within my perl program, I can solve the problem. But I don't
want to do so because configuration file has some user ID and password
as well as some web site related information that I want to make them
available only to system administrator group. Also, I don't know where
this probgram will be installed by user so directory to this
configuration file should be confiurable. So my problem is, how can I
separate confiuration parameters from perl program and still use cron
job and don't have to put directory infomation in my perl program?

Anybody has idea how to do that?

In article <B5522D83.4B71%elaine@chaos.wustl.edu>,
  Elaine Ashton <elaine@chaos.wustl.edu> wrote:
> in article 8ggldf$316$1@news.tuwien.ac.at, e8825393 at
> e8825393@stud2.tuwien.ac.at quoth:
> > everything works fine (from commandline), since I try to run the
script from
> > Cron, then no changes were made and on trying to debug the script,
I found
> > out, that the Temp-File is not opened.
>
> Have you tried reading the logs? cron generally logs errors and/or
sends
> output to the user via mail. Are you running it as the same user as
your
> cron? What are the permissions on the directory where the tmpfile
should be
> opened? Have you tried running with -w and possibly Carp?
>
> e.
>
>


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


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

Date: 27 May 2000 01:16:51 GMT
From: Murvin Ming-Wai Lai <mmlai@sfu.ca>
Subject: Question on Using cgi-lib.pl
Message-Id: <8gn7m3$3i3$1@morgoth.sfu.ca>


Hi all,
  I'm using the cgi-lib.pl to upload a file to the server. I know that
after I call &ReadParse, the variable name from the form will be stored in
the array %in.  
  For example, in the form, I have:
<INPUT type=file name=myfile>

and I upload the file "abc.txt" from client side,  then $in{'myfile'} will
return the contents of the abc.txt .  e.g.
$key equals: "myfile"
$in{$key} equals: "a b c d e f g ..." (whatever the content is)

However, I would like to know which variable I should look for to give me
the Name fo the file, i.e "abc.txt", using the cgi-lib.pl
Is there exist any variable in cgi-lib.pl that can provide me this piece
of information?  or I have to edit the cgi-lib.pl to do this job?

Thank you for the help.  =)





-- 
 .........................................................................
*>>>>Murvin Lai<<<<     >>>>--Muffin--<<<<     email: murvin_lai@sfu.ca *
*homepage:           http://www.sfu.ca/~mmlai              mmlai@sfu.ca *
`````````````````````````````````````````````````````````````````````````



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

Date: Sat, 27 May 2000 01:24:13 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Regex prime numbers (Was Re: seeking method to encode email addresses in web page forms)
Message-Id: <slrn8j0te7.3cn.tjla@thislove.dyndns.org>

I was shocked! How could Larry Rosler <lr@hpl.hp.com>
say such a terrible thing:

<snip>

>Reading the source of a Perl program, compiling it, and executing the 
>I/O to print a result -- all these will of course dominate one line of 
>computation, no matter how poorly it performs (within limits -- I'm sure 
>things like Abigail's regex prime-number generator would contradict that 
>generalization).

Okay that's got me curious. What is this regex prime number generator?

-- 
Gwyn Judd (tjla@guvfybir.qlaqaf.bet)
My return address is rot13'ed
Got a dictionary?  I want to know the meaning of life.


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

Date: Fri, 26 May 2000 21:44:48 -0400
From: Brad Baxter <bmb@dataserv.libs.uga.edu>
Subject: Re: Regex prime numbers (Was Re: seeking method to encode email addresses in web page forms)
Message-Id: <Pine.GSO.4.21.0005262143230.3759-100000@dataserv.libs.uga.edu>

On Sat, 27 May 2000, Gwyn Judd wrote:
> I was shocked! How could Larry Rosler <lr@hpl.hp.com>
> say such a terrible thing:
> 
> <snip>
> 
> >Reading the source of a Perl program, compiling it, and executing the 
> >I/O to print a result -- all these will of course dominate one line of 
> >computation, no matter how poorly it performs (within limits -- I'm sure 
> >things like Abigail's regex prime-number generator would contradict that 
> >generalization).
> 
> Okay that's got me curious. What is this regex prime number generator?

Do you mean this one?

perl -wle '$_ = 1; (1 x $_) !~ /^(11+)\1+$/ && print while $_ ++'

-- 
Brad



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

Date: Fri, 26 May 2000 18:32:21 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: seeking method to encode email addresses in web page forms
Message-Id: <392F25A5.71033160@stomp.stomp.tokyo>

Larry Rosler wrote:
> 
> In article <392F0303.AC87F5E9@stomp.stomp.tokyo> on Fri, 26 May 2000
> 16:04:35 -0700, Godzilla! <godzilla@stomp.stomp.tokyo> says...

> In this case, I demonstrated a 38-to-1 ratio for the above two
> statements.  More need not be said.

No, you modified my code and tested.
You set this up to yield the results
you personally wanted. This is not 
scientific. Is there a problem you 
don't want to run a realistic test? 

Well?

Knocking it down to 30 seconds for your
biased cheat test, this still only amounts
to a savings in time of 30 seconds per
year for an exceptionally busy site at
274 hits per day. In 30 years, a 15 minute
savings in CPU time, that's over 30 years
mind you, per your cheat test fake results.

Whoopie....

So you see, when it comes to reality, you
"big boys" just can't perform.

Your test results stand as invalid.

I'll stick with blinks of my eyes for
realistic accuracy over benchmark any
old day.

Godzilla!


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

Date: Fri, 26 May 2000 22:38:00 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: seeking method to encode email addresses in web page forms
Message-Id: <brian-ya02408000R2605002238000001@news.panix.com>

In article <392F25A5.71033160@stomp.stomp.tokyo>, "Godzilla!" <godzilla@stomp.stomp.tokyo> posted:

> Larry Rosler wrote:

> > In this case, I demonstrated a 38-to-1 ratio for the above two
> > statements.  More need not be said.

> No, you modified my code and tested.
> You set this up to yield the results
> you personally wanted. This is not 
> scientific.

you'd be surprised how more science-like that is than you
actually think. ;)

please leave your notions of elementary school science at home.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>


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

Date: Fri, 26 May 2000 20:07:14 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: seeking method to encode email addresses in web page forms
Message-Id: <392F3BE2.BF8932CE@stomp.stomp.tokyo>

brian d foy wrote:
> "Godzilla!" <godzilla@stomp.stomp.tokyo> posted:
> > Larry Rosler wrote:

> > > In this case, I demonstrated a 38-to-1 ratio for the above
> > > two statements.  More need not be said.
 
> > No, you modified my code and tested.
> > You set this up to yield the results
> > you personally wanted. This is not
> > scientific.
 
> you'd be surprised how more science-like that is than you
> actually think. ;)
 
> please leave your notions of elementary school science at home.


Reminds me of a head shrinker friend of mine
down at UCLA. He is widely acclaimed within
academic circles for curing a phobia of snakes.
His method, classes which slowly introduces those
with a "phobia" about snakes, to snakes, a gentle
introduction up to a point where a person actually 
handles a snake. No more phobia.

He asks for a critique. I tell him his tests are
invalid. He is miffed. I tell him true phobics 
would not come within a mile of his lab and 
classes. He leaves in a huff, after asking me
to never mention this again. Ok. So much for
being realistic.

You are out of your league little boy of Perl.


Godzilla!


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

Date: Fri, 26 May 2000 20:49:26 +0200
From: Christian Winter <thepoet1@arcormail.de>
Subject: Re: time in microseconds?
Message-Id: <mvgmg8.0eb.ln@usenet-autoren.de>

Jennifer Garrett <jgarrett@ans.net> schrob:
> Is it possible to find the time in microseconds in perl?
> I haven't seen anything that lets you do that.

perldoc -q time

=head2 how can I measure time under a second?
 ...

HTH
Christian


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

Date: Fri, 26 May 2000 23:14:58 +0200
From: Christian Winter <thepoet1@arcormail.de>
Subject: Re: Timing ?
Message-Id: <igpmg8.1od.ln@usenet-autoren.de>

Lew <Info@dynasoft.co.nz> schrob:
> I need to activate some code after a time period,
> tried the following without success.
-----------------------------------------------
#!/usr/bin/perl -w

my $c = 0;
print "I'm having fun with\n";
&timer;
sleep 10;
print "some inbuilt ";
&timer;
sleep 10;
print "clock\n";

sub timer {
  $c++;
  $SIG{'ALRM'} = sub { print "Alarm!\n";
                       exit 0 if( $c == 2 );
                     };
  alarm( 5 );
}
------------------------------------------------

HTH
Christian


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

Date: Fri, 26 May 2000 22:29:51 +0200
From: Christian Winter <thepoet1@arcormail.de>
Subject: Re: using param() and CGI.pm to store a persistent value
Message-Id: <vrmmg8.1od.ln@usenet-autoren.de>

Godzilla! <godzilla@stomp.stomp.tokyo> schrob:
> I use modules and know them well. Any module I use,
> I open and actually study. My choice is to not use
> modules. By studying how a module works, I can write
> my own code to do the same, with less lines and less
> use of memory.

Well, then let me cite something from your
"less lines and less use of memory"-snippet:

| ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdist) =
|   localtime(time);
| if ($sec < 10)
|   {$sec = "0$sec"; }
| if ($min < 10)
|   {$min = "0$min"; }
| .......

apart from POSIX, which would let you write
my $date = strftime("%H:%M:%S %m/%d/%Y",localtime(time));
and spare those conversions.

Another aproach would be
$sec = sprintf "%.2i", $sec;
which spares a lot of processor time by not forcing perl to
build a stack as for an if-clause.

One more Idea:
my @a;
push @a,sprintf("%.2i",$_) foreach( locatime(time) );
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdist) = @a;

> I would rather write my own programming
> rather than rely on copy and paste of another's work.

Seems reasonable, regarding your own coding ;-)
Not that I want to appear as a perl.god, I know that I'm
still quite the opposite.

> My thoughts are he needs to backup
> a bit and learn some basics, then move forward.

Well, if it belongs to the basics to do something like

| sub Parse
|   {
|   local (*in) = @_ if @_;

I know it's common practice to use the
  local *bla = ...
construct to safe Variables from outside the sub,
e.g.

my $b="10\n";
print $b;
&dosub;
print $b;
sub dosub
{
  local *b = *x;
  $b = "20\n";
  print $b;
}

Where you get
10
20
10

Yet I can hardly see the sense behind your construct.
I'd be glad if you could elucidate me. (no irony there)

> Anyhow, the point of my article you are commenting
> upon Mr. Kandalgaonkar, is to possibly persuade this
> author to use more simple basic methods until he gets
> a pretty good handle on more complex methods. I honestly
> believe he is biting off more than he can chew.

Well, I don't find your methods simple. To me thay  look a little
"thought around the corner", as I'd say it in german.
I suppose you're quite right with your last sentence, but
I also doubt he will get his mouth empty when he bites into
your snippet ;-)

Cheers
Christian


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

Date: Thu, 25 May 2000 17:01:55 -0400
From: Josh Thompson <jfthomps@eos.ncsu.edu>
Subject: win32 netadmin functions from cgi
Message-Id: <392D94C3.13DFC562@eos.ncsu.edu>

Does anyone know how to use the win32::NetAdmin functions from a cgi
script?  Particularly UserSetAttributes.  I am using IIS.  A command
line version works fine (as long as I am Administrator).  Basically, all
the script does is a UserGetAttributes and then a UserSetAttributes with
a few things changed.

Thanks,
Josh Thompson


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

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


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