[15887] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3300 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 9 06:05:22 2000

Date: Fri, 9 Jun 2000 03:05:09 -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: <960545109-v9-i3300@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 9 Jun 2000     Volume: 9 Number: 3300

Today's topics:
         Win32:ODBC leaking memory into inetinfo.exe  <Roland@psychenet.co.uk>
        Accessing CC using Sendmail <raphaelp@nr1webresource.com>
    Re: Accessing CC using Sendmail <kenneth.lee@alfacomtech.com>
        adsa <kana_krishna@netcel360.com>
    Re: couple of beginner questions <Peter.Dintelmann@dresdner-bank.com>
    Re: Dumb question.. How to prompt the user and get the  <mattking@techie.com>
    Re: Dumb question.. How to prompt the user and get the  <mattking@techie.com>
    Re: Dumb question.. How to prompt the user and get the  <phill@modulus.com.au>
    Re: Dumb question.. How to prompt the user and get the  <abe@ztreet.demon.nl>
    Re: Encrypting / decrypting. <godzilla@stomp.stomp.tokyo>
    Re: Extract filename from path? <tjabo.kloppenburg@unix-ag.org>
    Re: How to make a stand-alone exe ?? jgore@home.com
    Re: Larry Rosler interview on perl.com! <htp@mac.com>
        Net::DNS - What the heck does this mean ???? jgore@home.com
        New perl <chahn@eleganceintime.com>
        obfuscating script for security of distributed code (Eric Smith)
    Re: Problem with perl DBI & access <hellbunnie@irelands-web.ie>
        shadow password file <kenneth.lee@alfacomtech.com>
    Re: shadow password file <blah@nospam.com>
    Re: Shopping Cart Code Critique <you.will.always.find.him.in.the.kitchen@parties>
    Re: Solution needed for 'simple' task. (Craig Berry)
    Re: Spaces <you.will.always.find.him.in.the.kitchen@parties>
    Re: Using multiple objects many times <michael.schlueter@philips.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 8 Jun 2000 15:01:36 +0100
From: "Roland Corbet" <Roland@psychenet.co.uk>
Subject:  Win32:ODBC leaking memory into inetinfo.exe 
Message-Id: <393fa835.0@news.myratech.net>

I have posted a similar request to this post before, however, this time I
have included an example which could be used to re-create the problem.

Servers:    Two IBM Netfinity servers with NT4/SP6a (Problem occurs on
both).
Server App: Micorosoft IIS, version 4 as our web server.
Mappings:   .plx pointing to the ISAPI dll - PerlIS.dll
PerlIS.dll is used for executing scripts on websites that we host.
Perl:      ActivePerl Build 613.
Database:  MS Access 2000
The latest MDAC (2.5) have been installed to make sure that the ODBC drivers
are up to date.

Problem:  Over time, the memory used by the process inetinfo.exe grows.
Ultimately, this results in the failure of the servers due to no more memory
being available.

I am aware that ISAPI dlls run in the same memory space as the web server,
i.e. inside inetinfo.exe.  Thus, any memory leaked, will be attributed
to this process.

We experience this problem because a lot of our sites use the Win32:ODBC
module
to connect to MS Access databases.

To test to see if the leak was from using ISAP perl, or the ODBC Module,
I wrote a quick hello world script, that utilises some common ODBC code that
we use.

The scipt is included below.

#Start Script

#Database DSN
$DSN="TEST";  #Replace this with your DSN.

#Modules
use Win32::ODBC;

#Print header from a sub.
sub HEADDER {
   print "Content-type: text/html\n\n";
   print "<html>\n";
   print "<head>\n";
   print "$META";
   print "<title>$TITLE</title>\n";
   print "</head>\n";
   print "<body bgcolor=\"white\">\n";

}

#Sub to open up connection to specified DSN
sub OPENDB {
   if (!($db=new Win32::ODBC($DSN))) {
      print "Error connecting to $DSN\n";
      print "Error: " . Win32::ODBC::Error() . "\n";
   }
}

#Sub to send SQL query to open connection.
sub SQL {
   if ($SQL ne "") {
      if ($db->Sql($SQL)) {
         print "<p>SQL failed.\n<p>";
         print "Error: " . $db->Error() . "\n<p>";
         print "<p>The SQL Command that failed was: $SQL\n";
         $db->Close();
      }
   }
}

#Sub to display output from SQL query in a table.
sub DISTAB {
   @ColumnNames = $db->FieldNames();
   #print("columnames=@ColumnNames\n");
   print "<TABLE BORDER>\n<TR>\n";
   foreach $name (@ColumnNames){
      print "<TH>$name</TH>";
   }
   print "</TR>\n";
   while ($db->FetchRow()) {
      @values = $db->Data;
      print("<TR>");
      foreach $var (@values) {
         print("<TD>$var</TD>");
      }
      print("</TR>");
   }
   print("</TABLE>");
}


&HEADDER;
print "HELLO World!";
#&OPENDB;
#$SQL="Select * from Tablename";  #Replace tablename with the table from
your Database
#&SQL;
#&DISTAB;
#$db->Close();

print "</BODY>\n</HTML>\n";

#end of script

To test if the leak was with ODBC, or just ISAPI Perl, I ran the script with
the above lines commented out.  Thus, the script was only printing "Hello
World"
into a HTML document.  No memory leak was present.  Memory usage of
inetinfo.exe
only increased a little during execution, and then returned to normal
afterwards.

If the above lines are commented back in, to enable the ODBC query and
results display
it was quite evident that the leak was present.

On every connection memory usage greatly increased during execution, but
then returned
to more that the initial level.  Over time, this memory was still not
returned to the
system - thus it must have leaked into inetinfo.exe.

The memory leak only being present with the inclusion of the ODBC code,
leads
me to believe that the memory is leaked by Win32:ODBC or other related ODBC
componenets.

I have asked this question on many newsgroups and looked at the roth
consulting
website for answers to this question but with no answer that solves the
problem.

Any help to resolve this matter would be greatly appreciated.

Many thanks in anticipation of your time and help.

Regards

Roland Corbet
Systems Admin & Development
Psyche Solutions LTD




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

Date: Fri, 9 Jun 2000 10:06:21 +0200
From: "Raphael Pirker" <raphaelp@nr1webresource.com>
Subject: Accessing CC using Sendmail
Message-Id: <8hq8mm$18d$1@news.online.de>

Hi Guys,

I want to have the option to send CC E-mails to myself through perl.
Basically the code I have is:

open(MAIL,"|$mailprog -t");

print MAIL "To: $recipient\n";
print MAIL "From: $from\n";
print MAIL "Subject: $subject\n";
if ($mail_cc ne "false") {
print MAIL "";  # How do I write a CC address?
};

Hope you get what I mean. Please advise!

Raphael




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

Date: Fri, 09 Jun 2000 16:58:49 +0800
From: Kenneth Lee <kenneth.lee@alfacomtech.com>
To: Raphael Pirker <raphaelp@nr1webresource.com>
Subject: Re: Accessing CC using Sendmail
Message-Id: <3940B1C9.E6687A5B@alfacomtech.com>

Well... I think "Cc: address, address..." is enough.
Actually you can type any headers as you desire.


Raphael Pirker wrote:
> 
> Hi Guys,
> 
> I want to have the option to send CC E-mails to myself through perl.
> Basically the code I have is:
> 
> open(MAIL,"|$mailprog -t");
> 
> print MAIL "To: $recipient\n";
> print MAIL "From: $from\n";
> print MAIL "Subject: $subject\n";
> if ($mail_cc ne "false") {
> print MAIL "";  # How do I write a CC address?
> };
> 
> Hope you get what I mean. Please advise!
> 
> Raphael


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

Date: Fri, 9 Jun 2000 15:07:48 +0800
From: "kana_krishna" <kana_krishna@netcel360.com>
Subject: adsa
Message-Id: <8hq5gb$c95$2@news.sysnet.net.tw>

sdaasdd




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

Date: Fri, 9 Jun 2000 10:17:53 +0200
From: "Dr. Peter Dintelmann" <Peter.Dintelmann@dresdner-bank.com>
Subject: Re: couple of beginner questions
Message-Id: <8hq98d$fct6@intranews.dresdnerbank.de>


    Hi,

ldkramer@my-deja.com schrieb in Nachricht <8gvftp$hf4$1@nnrp1.deja.com>...
>Hello, I have two questions that I haven't been able to find the
>answers to.  Hope someone can help!
>
>1. Is it possible to write a CGI script that doesn't make the browser
>display any new HTML when it's done running?  I keep seeing references
>to CGI scripts that either spit out some HTML (that wipes out what was
>in the browser window) or that redirect the browser to some other
>page.  I can't figure out how to just "do nothing" when the CGI script
>is done.

    doing "nothing" is really difficuilt. The reason for this is that
    stdout from the cgi is redirected to the web server which
    additionaly generates a http header. Thus the browser gets
    some answer anyway but you can try to redirect it to a particular
    target window. I have not done it but I would try to include an
    iframe (or a traditional frame window) of height=0, width=0 in
    your page and redirect the output of your cgi to this invisible frame.

    Good luck and best regards,

        Peter Dintelmann






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

Date: Fri, 9 Jun 2000 09:53:29 +0200
From: "Matt King" <mattking@techie.com>
Subject: Re: Dumb question.. How to prompt the user and get the input.
Message-Id: <8hq7qf$1bd6$1@news2atm.raleigh.ibm.com>

Interesting. Just shows how different the Avtive Perl Dist. and the real
Perl Dist. are. Namley, this EXACT topic IS NOT in the Active Perl FAQ docs.
Perhaps it would be something to look at now. Since now when says something
is in FAQX, and Active is including a set that is different, they will never
see what is being refered to (and everyone will argue the point until
someone actually looks and sees that it's not there). And I did state that
I'm using Active State Perl (for Windows). So although, your right in saying
it's in the FAQ or in the DOC's, you wrong in saying or refering that I
didn't take the time to go through these, since I did and it's not where you
say it is. It might also be something to report to Active (provided anyone
cares) so that the documentation is identical between the different versions
so that you can tell the users that it is in this or that doc, and it is
really there.

Thanks for the help though.

Matt
Lauren Smith <lauren_smith13@hotmail.com> wrote in message
news:8hoii9$e02$1@brokaw.wa.com...
> Sometimes I think I have a question that there is no way anyone would have
> ever asked it before, but then I check the FAQ.  It turns out that I am
> always mistaken.
>
> Behold:
>
> perlfaq8: How do I read just one key without waiting for a return key?
>
> Lauren
>
>
>




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

Date: Fri, 9 Jun 2000 10:07:22 +0200
From: "Matt King" <mattking@techie.com>
Subject: Re: Dumb question.. How to prompt the user and get the input.
Message-Id: <8hq8ki$12no$1@news2atm.raleigh.ibm.com>

As well as that, the information in the Perl FAQ does not work with Active
Perl. I added the commands, and nothing happens. It's just skipped over.
Perhaps that's why it's not in the Active DOC's.

Comments? Do you, perhaps, know how one does it with Active Perl? And please
don't point me to another DOC, unless it's really included with the Active
Perl, and really is in the DOC's, please.

Matt




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

Date: Fri, 09 Jun 2000 18:09:59 +1000
From: Peter Hill <phill@modulus.com.au>
Subject: Re: Dumb question.. How to prompt the user and get the input.
Message-Id: <3940A657.59A0@modulus.com.au>

Matt King wrote:
> 
> Interesting. Just shows how different the Avtive Perl Dist. and the real
> Perl Dist. are. Namley, this EXACT topic IS NOT in the Active Perl FAQ docs.
[snip]

Strange indeed; at:
http://www.activestate.com/Products/ActivePerl/docs/index.html
the topic *is* in the on-line docs for ActivePerl 5.6.0.613, and on my
hard disk for Active Perl 5.005003 the topic *is* in the inline docs, in
the perlfaq which Lauren mentioned.

Do you have a rather obscure version of ActivePerl installed with
defective docs.?

> >
> > Behold:
> >
> > perlfaq8: How do I read just one key without waiting for a return key?
> >
> > Lauren
-- 
Peter Hill,
Modulus Pty. Ltd.,
http://www.modulus.com.au/


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

Date: Fri, 09 Jun 2000 11:22:23 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: Dumb question.. How to prompt the user and get the input.
Message-Id: <6pc1kscelengsjptc78uo80n5k6qg6s14d@4ax.com>

On Fri, 9 Jun 2000 10:07:22 +0200, "Matt King" <mattking@techie.com>
wrote:

> As well as that, the information in the Perl FAQ does not work with Active
> Perl. I added the commands, and nothing happens. It's just skipped over.
> Perhaps that's why it's not in the Active DOC's.

You mean you wrote the test program as is stated in perlfaq8, like:
	use Term::ReadKey;
	ReadMode('cbreak');
	print "Press any key ";
	my $key = ReadKey(0);
	ReadMode('normal');
	print "OK\n";

and it skipped over the 'my $key = ReadKey(0)' line?
then your Term::ReadKey might be broken, try to reinstall it:
	ppm install TermReadKey

And (re)read the docs:
	perldoc Term::ReadKey

> 
> Comments? Do you, perhaps, know how one does it with Active Perl? And please
> don't point me to another DOC, unless it's really included with the Active
> Perl, and really is in the DOC's, please.

FYI: It _is_ in perlfaq8! 
	perldoc -q read
	perldoc perlfaq8

-- 
Good luck,
Abe


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

Date: Fri, 09 Jun 2000 01:02:15 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Encrypting / decrypting.
Message-Id: <3940A487.97D456B7@stomp.stomp.tokyo>

"Randal L. Schwartz" wrote:

> Note that I'm *not* blessing the use of such a 
> trivial pseudo-encryption scheme.  I'm just trying 
> to stamp out going around the back door of the house
> when the front door is unlocked. :)


I distinctly recall warning you about comparing
apples and alligators.



Input: 

IMAGINATION IS MORE IMPORTANT THAN KNOWLEDGE

Encode: 

†Ž††‡†ŽŽŽŠŽ›ŽŒ†”ŽŽŽŒ†›Ž†‡—ŽŽ‡—ŽŒ†›‡—Ž—Ž›Ž•ŽœŽŽŽ†ŽŽ—Ž›ŽœŽŽ†0ŽŽŽŽŒŽ›Ž‡—†›ŽŒŽ††›ŽœŽ



Input:

GODZILLA ROCKS MY SOCKS OFF

Encode:

††††Ž›ŽŽ†0†”†ŠŽ›†0ŽŽŽ“ŽœŽŽ†0†”†ŠŽ›Ž—ŽŽ†›ŽŽŽŽ”†‡Ž›†



Input:

God's Little Girl Kicks Ass!

Encode:

œ‡Œ‡Œ†›ŽŽ‡ŒŠ“ŠŒŠ††”ŽŽŠ”‡œŠ††ŽŽŠ‹Š”‡›‡›Š†ŽŽŽ‡Œœ‡Š›Š—†



Input:

Chahta Okla! Chahta Yakni! Chahta Okpulot Taha!

Encode:

œŠŠŽŠ‡—ŽŽ‡›Š—Š”‡‹‡0Š“Ž›ŽŽŠ‡›ŠŽŠŠŽ†ŠŽŽœŠ†Š–Š“ŠŽ“ŽŽŠ‡›ŠŽŠŠŽ†ŠŽŽœŠŠ”Š“Ž›ŽŽŠ‡›ŠŽŠŠŽ†Š 




This is encoded with exactly four very simple
lines of Perl 4 code, each line performing 
only one simple function. I'll give you a very 
generous twenty-four hours to crack this code
with no more than four lines of Perl 4 code,
each line performing one simple function. You
are the big boy of Perl. Wouldn't be proper 
for a little girl of Perl to leave alligator
teeth marks in your ego, right?

Each encode should be one long line, watch the
word wrap in your news reader. No leading
space and no trailing space. I play fair.
You are also a good sport and play fair,
correct? I mean you big boys of Perl would
never ever think of cheating.


Might be a good idea for you to nail your
doors and windows shut when I am around.
A hard lesson a regular learned here not
too long back earned me a nickname of,

Goddess Of Hackers


* laughs *

Godzilla!

Chahta Okla! Chahta Yakni! Chahta Okpulot Taha!


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

Date: Wed, 7 Jun 2000 11:07:19 +0200
From: Tjabo Kloppenburg <tjabo.kloppenburg@unix-ag.org>
Subject: Re: Extract filename from path?
Message-Id: <393e10c7@si-nic.hrz.uni-siegen.de>

hi Henrik Jφnsson,

you wrote:
> I am trying to create a function that extract the filename from a
> path.  (unix/win95)

try this:

#!/usr/bin/perl -w

$dpfad = $#ARGV > -1 ? $ARGV[$#ARGV] : 'c:\tmp\test/unix/fname.ext';

print "Testpath: " . $dpfad . "\n";
print "Filename: " . ExtractFileName($dpfad) . "\n";

exit 0;

sub ExtractFileName{
    my ($pfad) = @_;
    $pfad =~ s;\;/;g;;  # change all \ to /
    return substr($pfad,rindex($pfad,'/')+1);
}

# tk.



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

Date: Fri, 09 Jun 2000 09:27:25 GMT
From: jgore@home.com
Subject: Re: How to make a stand-alone exe ??
Message-Id: <3948a08e.38223031@24.14.77.5>

On Sun, 04 Jun 2000 09:43:39 -0400, prasanth <pmudundi@sunny.zp> wrote:

>check out www.perl2exe.com. its a command line utility
>Also Activestate.com
>

Yes, Perl2EXE is very good!
I have used it on two versions of active state perl code and it works
great.  You should register so you can use the Small and Tiny options.
It  works fine unregistered, but I like the smaller code with shared dll.
    



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

Date: Fri, 09 Jun 2000 17:37:30 +0930
From: Henry <htp@mac.com>
Subject: Re: Larry Rosler interview on perl.com!
Message-Id: <htp-CB46AD.17373009062000@news.metropolis.net.au>

In article <slrn8k114q.4pe.tjla@thislove.dyndns.org>, 
tjla@guvfybir.qlaqaf.bet (Gwyn Judd) wrote:

>> I am wondering how standardized things like Visual Basic are. (Maybe
>> it is -- although I sincerely doubt it! Any independent implemenations
>> of Visual Basic yet?) Yet many companies seem willing to trust it 
> 
> www.realbasic.com (I think)

Nope.  Remarkable similarities in buzzwords, and RealBASIC was designed 
with skill transference in mind to attract the VB programmers, but it is 
NOT a derivative work.

Henry.


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

Date: Fri, 09 Jun 2000 09:38:34 GMT
From: jgore@home.com
Subject: Net::DNS - What the heck does this mean ????
Message-Id: <3948a1e5.38565464@24.14.77.5>


OK, I'm sitting here on the group W bench trying to figure out
what this error means!  If you can help please do......


Program:  Mresolv2.p - mentioned on Net::DNS  pages. Supposed to be fast DNS lookup.
Problem Module: NET::DNS - I got it from Active State site using PPM
Perl Version: Active State Perl  5.6 for Win32


Error I get:
defined(@array) is deprecated at C:/Perl/site/lib/Net/DNS.pm line 137.
        (Maybe you should just omit the defined()?)
couldn't create socket: Unknown error at mresolv2.p line 59.


Seems to happen about here:
my $res = Net::DNS::Resolver->new;
my $ns = $res->nameservers ? ($res->nameservers)[0] : $default_nameserver;
my $sock = IO::Socket::INET->new(PeerAddr => $ns,
                                 PeerPort => "dns(53)",
			               Proto    => "udp");
die "couldn't create socket: $!" unless $sock;


Looked on the net but didn't find much. Any help apreciated.......


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

Date: Fri, 09 Jun 2000 02:06:11 -0700
From: Christopher Hahn <chahn@eleganceintime.com>
Subject: New perl
Message-Id: <3940B383.75CD3185@eleganceintime.com>

Hello,

I decided to build the newest version of perl
(I wanted to build in threading anyway)

Well, the previous version was in /usr, including
libraries.  The new version installed into /usr/local
by default (which is where I wanted it in the first
place). (5.00503 vs. 5.6)

I had built into my previous install a ton of extra
modules.

What I want to know is whether I will need to reinstall
the modules into the new /usr perl install?

It certainly looks that way.....

Thanks,

Christopher





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

Date: 9 Jun 2000 08:32:43 GMT
From: eric@fruitcom.com (Eric Smith)
Subject: obfuscating script for security of distributed code
Message-Id: <slrn8k1at1.4i7.eric@plum.fruitcom.com>


(second attempt)

I have been unable to locate a code obfuscating script tat I know is out
there.  For removing white space, changing variable names, whatever.

The purpose is to discourage tampering or backward engineering of
distributed code.  We have given up comiling our code which previously
served this purpose.

thanx for any response.
-- 
Eric Smith
eric@fruitcom.com


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

Date: Fri, 09 Jun 2000 09:44:40 GMT
From: Kathryn Cassidy <hellbunnie@irelands-web.ie>
Subject: Re: Problem with perl DBI & access
Message-Id: <3940BC44.98D35FF2@irelands-web.ie>

Okeydokey, that works.  I was actually using the same query on a mysql
database originally using %'s, but (due to evil circumstances beyond my
control) I've been forced to get my data from an access db and not from
the mysql one.  According to the access help files the wildcard
character is *, so I replaced the %'s and it didn't work.  I suppose I
should really have tried out the %'s first.

Thanks,
Kathryn.

> I just did a query similar to that at work
> (Clinical drug trials under Food & Drug Administration oversight; you wouldn't
> believe the regulations), but we were using MySQL. In the SQL for MySQL the
> wildcard (%) had to go on the front or back or both depending on whether you
> were searching for the string to be contained in the back, front, or middle of
> the field. It worked fine for me.
> 
> We were running Perl 5.00504 (?) on a 486/133 using FreeBSD and MySQL db. We've
> since switched to an HP-UX running Postgress SQL db. Still no problems, but now
> we're using Pg instead of DBI. The only change was that I had to change the
> double-quotes which MySQL demanded, to single-quotes which Postgress demands.
> Did you check that you're using the correct kinds of quotation marks?
> 
> Other than that, the way I see it is the problem is that you're using a
> Microsoft product, whose products are notoriously buggy. (Windows GPF messages
> anyone?)
> 
> Jay


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

Date: Fri, 09 Jun 2000 17:12:30 +0800
From: Kenneth Lee <kenneth.lee@alfacomtech.com>
Subject: shadow password file
Message-Id: <3940B4FE.FA06F36A@alfacomtech.com>

Is there any tools available for manipulating the shadow 
password file?  I got Crypt::PasswdMD5, but then I've to 
update the file myself and do the lookup one by one.
It's good if there's an interface to the libshadow library.

Kenneth


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

Date: Fri, 09 Jun 2000 11:36:16 +0200
From: Marco Natoni <blah@nospam.com>
Subject: Re: shadow password file
Message-Id: <3940BA90.A9DFC277@nospam.com>

Kenneth,

Kenneth Lee wrote:
> Is there any tools available for manipulating the shadow
> password file?  I got Crypt::PasswdMD5, but then I've to update 
> the file myself and do the lookup one by one. It's good if there's 
> an interface to the libshadow library.

  I had a similar problem.  That's the Jonathan Stowe's ultimate answer:

<cite>
	Q: I wonder if someone can point me to a module (or give 
	Q: me just a tip) in order to verify the UNIX 
	Q: authentication of an user when the shadow password system 
	Q: is used.  I have read the FAQ, but, as a terrifying 
	Q: caveat recites, "If perl was> installed correctly, and 
	Q: your shadow library was written properly, the 
	Q: getpw*() functions described in the perlfunc manpage 
	Q: should in theory provide (read-only) access to entries in 
	Q: the shadow password file.".  That theory is unfortunately 
	Q: not effective for my system (Linux):  In fact, 
	Q: getpwname returns a disconsolate 'x' in the 
	Q: password field. 
	A: In 5.6.0 this has been fixed for OS that have System V 
	A: style shadow password functions (such as Linux or 
	A: SCO ) although it still says the same thing in perlfunc - 
	A: I have submitted a doc patch via perlbug.
</cite>

  Hoping that it could help you...


	Best regards,
		Marco


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

Date: Fri, 9 Jun 2000 21:08:09 +1200
From: "Tintin" <you.will.always.find.him.in.the.kitchen@parties>
Subject: Re: Shopping Cart Code Critique
Message-Id: <960541590.923477@shelley.paradise.net.nz>


"Josiah Bryan" <jdb@wcoil.com> wrote in message
news:8hn6jf$g6b$0@206.230.71.27...
> I once again bow to the superior knowledge of my peers.
>
> I wrote a small core for a shopping cart for my company.
> It happens to be only 532 lines long.
>
> I would be most appreciative if I could get a detailed critique
> of this script from any and all that would care to. Please
> don't spare any flames, I need this script to be able to
> take anything anyone can throw at: dumb users,
> not so dumb users, anything.
>
> NOTE: The only "non-finished" function (sub) in
> the script is "checkout". The sub is executable and
> free from error in its current state, yet I just
> havn't finished that sub yet.
>
> It would also be nice if anyone would be interested in
> an opensourced version of the whole project. Let me know on
> the opensource idea if you are intersted. Back to the matter at
> hand. (Please let me know via email to jdb@wcoil.com)
>
> It is designed to be VERY flexable, VERY adaptable
> to ANY store/navigation scheme/page look/products/fields/etc.
> The attached file is the core driver for the cart. Inorder for
> you to execute it, it needs jLIB, a powerful little direct-database
> file interpreter.
>
> You will see calls to new jLIB::jDATA and its
> objects (of jDATA) throughout the script above. The calls
> do what they look like. The new method loads the file from
> disk. "->select" selects the table name. "->add_table" adds
> the table name if it doesnt exist, or simply returns
> a table handle if it does. "->select" and "->add_table" calls
> are recursive. Exception: calls to ->select("root") always
> return you to the top of the structure tree.
> "->get" and "->set" get and set, respectively,
> valus from the current table. "->kill_table" removes the
> table. "->kill_field" removes the field.
>
> This also uses HTML::Template, available on CPAN.
>
> I would appreciate any and all critique on this script.
> Please (preferably) send to jdb@wcoil.com, or
> this newsgroup as a second option.

You've got a way to go to run it with -w and use strict

$ perl -cw Jcard.pl
Global symbol "$key" requires explicit package name at Jcart.pl line 10.
Global symbol "$value" requires explicit package name at Jcart.pl line 10.
Global symbol "%CGI" requires explicit package name at Jcart.pl line 10.
Global symbol "%forminput" requires explicit package name at Jcart.pl line
10.
Global symbol "$config" requires explicit package name at Jcart.pl line 28.
Global symbol "%session" requires explicit package name at Jcart.pl line 31.
Global symbol "$db" requires explicit package name at Jcart.pl line 34.
Global symbol "$userIp" requires explicit package name at Jcart.pl line 37.
Global symbol "$cart" requires explicit package name at Jcart.pl line 40.
Global symbol "$itemid" requires explicit package name at Jcart.pl line 73.
Global symbol "$numItems" requires explicit package name at Jcart.pl line
189.
Global symbol "$sessionData" requires explicit package name at Jcart.pl line
245
 .
Global symbol "$flag" requires explicit package name at Jcart.pl line 255.
Global symbol "$y" requires explicit package name at Jcart.pl line 263.
Global symbol "$sectionID" requires explicit package name at Jcart.pl line
307.
Global symbol "$ret" requires explicit package name at Jcart.pl line 410.
Global symbol "$q" requires explicit package name at Jcart.pl line 411.
"my" variable $parent masks earlier declaration in same scope at Jcart.pl
line 4
39.
Global symbol "@pageNumbers" requires explicit package name at Jcart.pl line
492


BTW, comp.lang.perl was dead and buried a long time ago.




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

Date: Fri, 09 Jun 2000 07:01:55 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Solution needed for 'simple' task.
Message-Id: <sk15j3alh51177@corp.supernews.com>

ra jones (ra_jones@my-deja.com) wrote:
: I have a list of terms, which in practice can vary in length between 1
: and a lot. Here is 4:
: 
: @list = ("A","B","C","D");
: $N = @list
: 
: I want the script to print 'A, B, C and D'. If there were 1 item, print
: 'A', if 2 then print 'A and B'. If twenty, then 'A, B, C, D ... and T'.

#!/usr/bin/perl -w
# enumerate - demo of English list pretty-printer.
# Craig Berry (20000608)

use strict;

sub enumerate {
  my $str = '';

  while (@_) {
    $str .= shift;
    last unless @_;
    $str .= @_ == 1 ? ' and ' : ', ';
  }

  $str;
}

my @test = qw(A B C D E);

print enumerate(@test),       "\n",
      enumerate(@test[0..1]), "\n",
      enumerate($test[0]),    "\n";

-- 
   |   Craig Berry - http://www.cinenet.net/users/cberry/home.html
 --*--  "You live in Los Angeles, and you are going to Reseda; we are
   |   all in some way or another going to Reseda someday, to die."
               - Soul Coughing


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

Date: Fri, 9 Jun 2000 20:38:39 +1200
From: "Tintin" <you.will.always.find.him.in.the.kitchen@parties>
Subject: Re: Spaces
Message-Id: <960539819.369558@shelley.paradise.net.nz>


"Mike Solomon" <mike.solomon@eps.ltd.uk> wrote in message
news:8hoh2v$5fi$1@news6.svr.pol.co.uk...
> please ignore my earlier reply
>
> it should read :
>
>     $foo =~ s/ file://g;
>
> Outlook was playing formatting games !

It still is.




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

Date: Fri, 9 Jun 2000 21:37:50 +0200
From: "Michael Schlueter" <michael.schlueter@philips.com>
Subject: Re: Using multiple objects many times
Message-Id: <8hq6to$6jp$1@porthos.nl.uu.net>

|Odo|,
You raise an interesting question which I can not answer. However, I would
use, e.g.

    my $auth = EdcomLib::Auth->new();

instead of

    my $auth = new EdcomLib::Auth;

The reason has been explained in one of perltoot or perlobj, if I remember
it correctly. If that has any effect on memory consumption I do not know.
How do you determine memory consumption? Do you use the top command from
Unix?







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

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


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