[10700] in Perl-Users-Digest
Perl-Users Digest, Issue: 4292 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 24 21:07:20 1998
Date: Tue, 24 Nov 98 18:00:21 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 24 Nov 1998 Volume: 8 Number: 4292
Today's topics:
Re: Access Database & Perl cdtoad@hotmail.com
Re: Can't edit web generated files <rootbeer@teleport.com>
Re: Carriage Return Problem <rootbeer@teleport.com>
Re: Closing bad pipe, empty $! <rootbeer@teleport.com>
HELP!! Perl, appending characters at end of lines <emil_rivas@jabil.com>
Re: HELP!! Perl, appending characters at end of lines (brian d foy)
How do I translate binary string to a scalar value? <ccchen@sis.com.tw>
Re: How do I translate binary string to a scalar value? <rootbeer@teleport.com>
Re: How do I translate binary string to a scalar value? (Martien Verbruggen)
how do you put commas in a number? <eric@egdc.net>
Re: How to sort an array of strings case insensitive ? <rootbeer@teleport.com>
Re: How to sort an array of strings case insensitive ? (Andre L.)
Re: Is s/(?)ABC/xyz/; ok? (was Re: Bind won't take vari <rootbeer@teleport.com>
Re: MacPerl and makefiles (Paul J. Schinder)
Re: meassuring time in milli seconds (Martien Verbruggen)
nslookup nguyen.van@imvi.bls.com
Re: nslookup (Martien Verbruggen)
Re: Parse File Upload.. <rootbeer@teleport.com>
Re: Parse File Upload.. <bellears@deakin.edu.au>
Re: Please help me locate Perl Style Guide <dgris@moiraine.dimensional.com>
Re: QUICK QUESTION! <flavell@mail.cern.ch>
Re: QUICK QUESTION! <rootbeer@teleport.com>
Re: QUICK QUESTION! (brian d foy)
Re: QUICK QUESTION! (Andre L.)
Re: shopping cart [not a perl topic] birgitt@my-dejanews.com
Re: SSLeay and RSA <rootbeer@teleport.com>
Re: URGENT...Help Required! <bellears@deakin.edu.au>
Re: URGENT...Help Required! <bellears@deakin.edu.au>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 25 Nov 1998 01:35:00 GMT
From: cdtoad@hotmail.com
Subject: Re: Access Database & Perl
Message-Id: <73fms4$lfe$1@nnrp1.dejanews.com>
Yes quite well too. Seek out HTTP://WWW.ROTH.NET/ODBC/ODBCFAQ.HTM I have a
database of close to 500,000 keyed items plus am working on a database for a
local record store.
_dave
In article <72udch$4vb$2@mawar.singnet.com.sg>,
"Ho Seng Yip" <hsengyip@(nospam)singnet.com.sg> wrote:
> Hi,
>
> I am wondering if Perl can actually read and write data into / from a
> Microsoft Access database.
>
> If you have any useful links to relevant resources, please let me know too.
>
> Thanks.
>
> Regards,
> Seng Yip
>
> - Please remove ' (nospam) ' to e-mail me. -
>
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 25 Nov 1998 01:03:24 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Can't edit web generated files
Message-Id: <Pine.GSO.4.02A.9811241700270.4375-100000@user2.teleport.com>
On Tue, 24 Nov 1998, shienh gurpreet wrote:
> I have a script that generates web pages and saves them on the server.
> My problem is that the new pages generated belong to group "WEB" and I
> do not have permissions to modify those pages, if I need to. The
> permissions are -rw-r--r--. Please suggest a solution.
There are many ways to do this, but they're the same whether you program
in Perl or in some other language. Perhaps the docs, FAQs, and newsgroups
about CGI programming would be able to help you. But consider making your
program run under your user-ID. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 25 Nov 1998 01:12:16 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Carriage Return Problem
Message-Id: <Pine.GSO.4.02A.9811241709520.4375-100000@user2.teleport.com>
On Tue, 24 Nov 1998, amaring wrote:
> illegal character \015 (carriage return) at admin.cgi line 2
> (Maybe you didn't strip carriage returns after a network transfer?)
>
> Can someone please tell me what is causing this and how to fix it?
Maybe you didn't strip carriage returns after a network transfer. But have
you seen what the perldiag manpage has to say about this message? Hope
this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 25 Nov 1998 00:59:34 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Closing bad pipe, empty $!
Message-Id: <Pine.GSO.4.02A.9811241655080.4375-100000@user2.teleport.com>
On 24 Nov 1998, Robert Devereaux wrote:
> errmsg is Error on pipe close ().
> So why doesn't $! have anything in it? Help, anyone? Thanks!
perlfunc says:
If the file handle came from a piped open C<close> will additionally
return FALSE if one of the other system calls involved fails or if the
program exits with non-zero status. (If the only problem was that the
program exited non-zero $! will be set to 0.) Also, closing a pipe
will wait for the process executing on the pipe to complete, in case
you want to look at the output of the pipe afterwards. Closing a pipe
explicitly also puts the exit status value of the command into $?.
So, I'd guess that the only problem was that the program exited non-zero.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 24 Nov 1998 19:12:53 -0600
From: "Emil Rivas" <emil_rivas@jabil.com>
Subject: HELP!! Perl, appending characters at end of lines
Message-Id: <73fli3$r9f$1@news1.cftnet.com>
Hello to Perl wizards,
I am stumped with what I believe should be a fairly straight forward regex
function. Trying to append \\; at the end of each line in a file.
E.g.
Change the following:
unlink "d:/dalefiles/Download/Humidor/drw0003.drw.1
unlink "d:/dalefiles/Download/Humidor/door-pci.prt.1
unlink "d:/dalefiles/Download/Humidor/7524d.asm.227
unlink "d:/dalefiles/Download/Humidor/5154d.prt.719
to
unlink "d:/dalefiles/Download/Humidor/drw0003.drw.1
unlink "d:/dalefiles/Download/Humidor/door-pci.prt.1
unlink "d:/dalefiles/Download/Humidor/7524d.asm.227
unlink "d:/dalefiles/Download/Humidor/5154d.prt.719
the closest I have been to achieving this is with:
$^I = '.old';
while (<>) {
s/\\/\//g;
s/b*$/$\"\;/g;
print;
}
generated output being:
unlink "d:/dalefiles/Download/Humidor/riser_dxf_100998.prt.1";
";unlink "d:/dalefiles/Download/Humidor/errors.lst.4";
";unlink "d:/dalefiles/Download/Humidor/emboss-standoff-2.prt.3";
";unlink "d:/dalefiles/Download/Humidor/drw0003.drw.1";
";unlink "d:/dalefiles/Download/Humidor/door-pci.prt.1";
Obviously I dont fully comprehend the use of regexs fully yet!!! Any
chance someone might be able to point me in the right direction?
Thanks,
------------------------------
Date: Tue, 24 Nov 1998 20:44:56 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: HELP!! Perl, appending characters at end of lines
Message-Id: <comdog-ya02408000R2411982044560001@news.panix.com>
In article <73fli3$r9f$1@news1.cftnet.com>, <emil_rivas@jabil.com> posted:
> function. Trying to append \\; at the end of each line in a file.
here's some pseudocode:
read in one line
remove input record separator
print to new file with output record separator
here's what it might look like in Perl:
$/ = "\n"; #the input record separator
$\ = "%\n"; #the output record separator
while( <FILE> )
{
chomp;
print;
}
absolutely no need for regexen. see the docs for details :)
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
you could even do this right on the command line
------------------------------
Date: Wed, 25 Nov 1998 10:13:57 +0800
From: "Chih-Chin Chen" <ccchen@sis.com.tw>
Subject: How do I translate binary string to a scalar value?
Message-Id: <73fmet$j0a$1@news.seed.net.tw>
Hi,
I am a new user of Perl and I need some help. There are "hex" and "oct"
translation functions to translate heximal and octal string to scalar value,
but none for binary strings. I found a method in the FAQ 4: "How do I
convert bits to ints?", like follow:
$decimal = pack "B8", "01100111";
printf("%d\n", $decimal);
The output is "0". If I use $decimal for numberic operations, like "+", "-",
etc. I would get the warnning message "Argument "g" isn't a numeric in add
.."
Is there any wrong, please help me.... Thank you.
__________________________________
Chih-Chin Chen
SiS MultiMedia Division
(03)5774922-4237
ccchen@sis.com.tw
------------------------------
Date: Wed, 25 Nov 1998 01:34:41 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: How do I translate binary string to a scalar value?
Message-Id: <Pine.GSO.4.02A.9811241732200.4375-100000@user2.teleport.com>
On Wed, 25 Nov 1998, Chih-Chin Chen wrote:
> $decimal = pack "B8", "01100111";
> printf("%d\n", $decimal);
Don't use printf where print will do.
> The output is "0".
Of course it is. If you want to convert a packed string to an integer,
maybe you want to try unpack. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 25 Nov 1998 01:46:22 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: How do I translate binary string to a scalar value?
Message-Id: <OjJ62.108$Zw2.322@nsw.nnrp.telstra.net>
In article <73fmet$j0a$1@news.seed.net.tw>,
"Chih-Chin Chen" <ccchen@sis.com.tw> writes:
> $decimal = pack "B8", "01100111";
$decimal = unpack("C", pack("B8", "01100111"));
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | In the fight between you and the world,
Commercial Dynamics Pty. Ltd. | back the world - Franz Kafka
NSW, Australia |
------------------------------
Date: Tue, 24 Nov 1998 20:43:09 +0000
From: Eric Gessner <eric@egdc.net>
Subject: how do you put commas in a number?
Message-Id: <365B19A0.1D42EF71@egdc.net>
This is a multi-part message in MIME format.
--------------D90DB25B4657BC6503325662
Content-Type: text/plain; charset=us-ascii; x-mac-type="54455854"; x-mac-creator="4D4F5353"
Content-Transfer-Encoding: 7bit
THANKS!!
e.
--------------D90DB25B4657BC6503325662
Content-Type: text/x-vcard; charset=us-ascii;
name="eric.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Eric Gessner
Content-Disposition: attachment;
filename="eric.vcf"
begin:vcard
n:Gessner;Eric
tel;fax:717-522-9202
tel;home:717-523-1705
tel;work:717-522-9200
x-mozilla-html:FALSE
url:http://www.egdc.net/eric/
org:Eric Gessner's Digital Center;http://www.egdc.net/
adr:;;P.O. Box 5;Lewisburg;PA;17837;USA
version:2.1
email;internet:eric@egdc.net
title:Owner
note:ICQ#: 6331962
x-mozilla-cpt:;3
fn:Eric Gessner
end:vcard
--------------D90DB25B4657BC6503325662--
------------------------------
Date: Wed, 25 Nov 1998 01:26:07 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: How to sort an array of strings case insensitive ?
Message-Id: <Pine.GSO.4.02A.9811241725390.4375-100000@user2.teleport.com>
On Wed, 25 Nov 1998 thst@my-dejanews.com wrote:
> Subject: How to sort an array of strings case insensitive ?
Have you seen what the docs for sort have to say about this? Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 24 Nov 1998 21:26:50 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: How to sort an array of strings case insensitive ?
Message-Id: <alecler-2411982126500001@dialup-166.hip.cam.org>
In article <73fjsa$iv2$1@nnrp1.dejanews.com>, thst@my-dejanews.com wrote:
> As the subject says: How to do that in perl ?
> If I sort the normal way then capital letters are coming before lower letters.
Sort on the lowercased elements:
@insensitively_sorted = sort { lc($a) cmp lc($b) } @original;
With a very large list, there might be a speed benefit in using a more
Schwartzian solution, like so:
@sorted = map { $_->[0] }
sort { $a->[1] cmp $b->[1] }
map { [ $_, lc ] } @original;
HTH,
Andre
------------------------------
Date: Wed, 25 Nov 1998 01:14:24 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Is s/(?)ABC/xyz/; ok? (was Re: Bind won't take variables)
Message-Id: <Pine.GSO.4.02A.9811241712380.4375-100000@user2.teleport.com>
On Tue, 24 Nov 1998, Rick Delaney wrote:
> Strangely enough, you can use '(?g)' as well, though this is
> undocumented.
Other appropriate adjectives are "unsupported" and "volatile". :-)
> s/(?)ABC/xyz/;
>
> which doesn't seem quite right. Is (?) simply ignored? Shouldn't perl
> complain about a regex like this?
Yes, IMHO. Let us know when the patch is ready!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 25 Nov 1998 00:57:39 GMT
From: schinder@leprss.gsfc.nasa.gov (Paul J. Schinder)
Subject: Re: MacPerl and makefiles
Message-Id: <73fkm3$268$1@callisto.clark.net>
In <jmp-ya02408000R2311982230430001@nntp.mlink.net> jmp@mlink.net (Jean-Marc Piuze) writes:
>Now look. I'm not an expert in Perl anyway. But I wonder how to save odsr read
>a file outside of the current working directory. In Unix, I use "../" to go up
>for one level whitout knowing the full path. I mean how can I specified relatives
>directory in my Perl script running on my Mac?..
You use "::" to go up one level.
The rest of what you need to know to use Mac paths is in the
"MacPerl.Specifics" file in your MacPerl folder. You can also use the
File::Spec module to construct paths portably.
>Thanks! =-)
>jmarc...
------------------------------
Date: Wed, 25 Nov 1998 01:39:57 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: meassuring time in milli seconds
Message-Id: <NdJ62.104$Zw2.322@nsw.nnrp.telstra.net>
In article <73fjfb$iho$1@nnrp1.dejanews.com>,
thst@my-dejanews.com writes:
> Is there a way to find out the number of milli seconds between two
> independent event (two keypresses, two subroutine calls,...)
# perldoc perlfaq8
=head2 How can I measure time under a second?
In other words: It's in the documentation. In perlfaq part 8.
> Bye
Bye
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au |
Commercial Dynamics Pty. Ltd. | Can't say that it is, 'cause it ain't.
NSW, Australia |
------------------------------
Date: Wed, 25 Nov 1998 01:17:22 GMT
From: nguyen.van@imvi.bls.com
Subject: nslookup
Message-Id: <73flqj$kjg$1@nnrp1.dejanews.com>
Hi everyone,
I tried to write a script like a "nslookup" in unix but face a problem.
Following is my code.
__________________________________________________________________
use Socket;
print "please enter Domain name:\n";
$name = <STDIN>;
@address = inet_ntoa(inet_aton ($name)) or die "couldn't resolve for $name:
$!\ n"; print "The address is a IP address: $address\n";
exit;
_____________________________________________________________________
I ran the script as "./nslookup.pl www.cnn.com" and got the followinf error:
________________________________________________________________________ Bad
arg length for Socket::inet_ntoa, length is 0, should be 4 at ./nslookup.pl
___________________________________________________________________________
Thanks
Van Nguyen
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 25 Nov 1998 01:49:40 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: nslookup
Message-Id: <UmJ62.110$Zw2.322@nsw.nnrp.telstra.net>
In article <73flqj$kjg$1@nnrp1.dejanews.com>,
nguyen.van@imvi.bls.com writes:
> $name = <STDIN>;
>
> @address = inet_ntoa(inet_aton ($name)) or die "couldn't resolve for $name:
> $!\ n"; print "The address is a IP address: $address\n";
[snip]
> I ran the script as "./nslookup.pl www.cnn.com" and got the followinf error:
>
> Bad
> arg length for Socket::inet_ntoa, length is 0, should be 4 at ./nslookup.pl
# perldoc Socket
[snip]
inet_aton HOSTNAME
Takes a string giving the name of a host, and
translates that to the 4-byte string (structure). Takes
arguments of both the 'rtfm.mit.edu' type and
'18.181.0.24'. If the host name cannot be resolved,
returns undef.
[snip]
Hmm, maybe inet_aton is returning undef?
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au |
Commercial Dynamics Pty. Ltd. | Curiouser and curiouser, said Alice.
NSW, Australia |
------------------------------
Date: Wed, 25 Nov 1998 01:06:38 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Parse File Upload..
Message-Id: <Pine.GSO.4.02A.9811241705060.4375-100000@user2.teleport.com>
On Wed, 25 Nov 1998, Mick wrote:
> When uploading files via a web page, how can I ensure that only a
> specifically named file is allowed to be uploaded.
It sounds as if you want the browser to do something. Perhaps the docs,
FAQs, and newsgroups about browsers could help you. Of course, if you want
to make a Perl program which runs on the server and checks the incoming
file name, use the eq operator documented in perlop. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 25 Nov 1998 12:14:21 +1100
From: Mick <bellears@deakin.edu.au>
Subject: Re: Parse File Upload..
Message-Id: <365B59ED.B3F00209@deakin.edu.au>
BenJamin Prater wrote:
> Mick,
>
> Simply look for the name of the file in the appropriate form field
> once it's uploaded and prior to saving it.
>
Thanks for the reply!
So...If I have something like...
<input name=bulkfilename2 size=25 maxlength=100 type=file accept=\"*\">
Do I then parse bulkfilename2 using eq or something like that?
Then if it is incorrect, can I display an error message box, stating no thats
the wrong file press ok to go back and try again?
Thanks again for the help!
Mick
> Ben
>
> On Wed, 25 Nov 1998 08:39:41 +1100, Mick <bellears@deakin.edu.au>
> wrote:
>
> >When uploading files via a web page, how can I ensure that only a
> >specifically named file is allowed to be uploaded. I know this is a
> >fairly broad question, but I'm fairly new to Perl and do not know where
> >to start.
> >So eg. file to be uploaded must be called file.txt and if the user tries
> >to upload anything else they get an appropriate message?
> >
> >Thanks for any replies,
> >Mick
> >
------------------------------
Date: 24 Nov 1998 18:07:13 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Please help me locate Perl Style Guide
Message-Id: <m33e78fum6.fsf@moiraine.dimensional.com>
Eric Bohlman <ebohlman@netcom.com> writes:
<snip ActiveState doesn't ship proper documentation>
> They do ship the documentation, but not in .pod form.
Then they are shipping a broken perl distribution.
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
Supporter of grumpiness where grumpiness is due on clpm.
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: Wed, 25 Nov 1998 01:35:16 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: QUICK QUESTION!
Message-Id: <Pine.HPP.3.95a.981125012806.19925E-100000@hpplus01.cern.ch>
On Tue, 24 Nov 1998, Eric Gessner caused this to appear:
Subject: QUICK QUESTION!
SLOW ANSWER!
and:
Parts/attachments:
1 Shown 17 lines Text
2 OK 16 lines Text, "Card for Eric Gessner"
----------------------------------------
Please don't do that.
> i am importing a key/value array from an HTML form.
Use an appropriate library. CGI.pm is a generally good choice.
> the values are
> numbers, and my question is, how do i add them together to come up with
> a total? they are all in the same string, right? so how do i do this?
Write a program?
I don't see anything specific to the perl language yet. Maybe you
should be taking a CGI tutorial or something.
And for more effective participation in usenet, you owe it to yourself
to consult the advice in news.announce.newusers, and to choose a
meaningful subject line.
> what is the code to make the all the values add each other and give me a
> total?
Oh, you want _us_ to write you a program! Excuse me, but on usenet
we try to help people to help themselves. If you want a consultant,
you better hire one.
------------------------------
Date: Wed, 25 Nov 1998 01:23:25 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: QUICK QUESTION!
Message-Id: <Pine.GSO.4.02A.9811241721350.4375-100000@user2.teleport.com>
On Tue, 24 Nov 1998, Eric Gessner wrote:
> Newsgroups: comp.lang.perl.misc, comp.lang.perl.modules
What does this question have to do with modules?
> Subject: QUICK QUESTION!
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
> the values are numbers, and my question is, how do i add them together
> to come up with a total?
To get the total of a list of numbers, use a loop. This is something you
learn in the first programming class you take. Were you absent that day?
:-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 24 Nov 1998 20:37:59 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: QUICK QUESTION!
Message-Id: <comdog-ya02408000R2411982037590001@news.panix.com>
In article <365B513A.FEDB9B73@axe.humboldt.edu>, Greg Coit <gbc1@axe.humboldt.edu> posted:
> Eric Gessner wrote:
>
> > i am importing a key/value array from an HTML form. the values are
> > numbers, and my question is, how do i add them together to come up with
> > a total?
> Using the code you supplied, I think this will work:
>
> foreach $number(keys(%input)) {
> $total += $input{$numbers};
> }
you could also use the values() function (TMTOWTDI):
%hash = map { $_, $_ + int(rand(5)) } 1 .. 100;
@values = values(%hash);
foreach( @values )
{
$sum += $_;
}
print "$sum\n";
and if you really want to sum a list quickly, see the sum() function
in the builtin.pm module.
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Tue, 24 Nov 1998 21:39:39 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: QUICK QUESTION!
Message-Id: <alecler-2411982139390001@dialup-166.hip.cam.org>
In article <365B04E2.6F89D2A4@egdc.net>, Eric Gessner <eric@egdc.net> wrote:
> This is a multi-part message in MIME format.
Please post in Plain Text(TM). Thank you.
[...]
> this prints out all the values, of course:
>
> foreach $number(keys(%input)) {
> print "$input{$numbers}";
>
> }
>
> what is the code to make the all the values add each other and give me a
> total?
foreach (values %input) {
$total += $_;
}
HTH,
Andre
------------------------------
Date: Wed, 25 Nov 1998 00:32:19 GMT
From: birgitt@my-dejanews.com
Subject: Re: shopping cart [not a perl topic]
Message-Id: <73fj6j$i5f$1@nnrp1.dejanews.com>
[off-topic]
In article <73b9o4$50r$1@shadow.skypoint.net>,
Jamie Hoglund <jhoglund@mirage.skypoint.net> wrote:
> Peter <peter@helpnet.com.au> wrote:
>
> : Given that every major book store has several C and Perl programming
> : books that show how to write a shopping cart and that most have the
> : code on CD, how can ISPs pretend a shopping cart has to be invented
> : from scratch at great expense?
It hasn't. There is free code, open source code well
documented to download from CPAN.
But not all ISPs know enough C and Perl to handle the few good and free
shopping carts, which would allow features beyond the basics.
Endusers often are not aware of what kind of special features they
need until they get deeply into the project. Price calculation from
the ISP/programmer/designers are either per project or hourly.
In both cases chances are high that the ISP ends up spending much more
time than anticipated on the project because objectives are changed during
production time. Whereas the experienced programmer knows what comes
ahead, the customer often doesn't. It's a learning process on both
sides and ends in higher expenses almost certainly.
> It really depends on what you want.
>
> Do you:
>
> 1.) Have a huge database? (maybe it needs SQL, maybe not, maybe thats not
> possible)
>
> 2.) Require other special features?
>
> There are a lot of carts out there. http://www.cgi-resources.com is a good
> starting place, but each cart is kind of "canned" some have features
> you'll never use, others won't have features you need.
That's true and that's why real good shopping carts have all the flexibility
to develop what you need and chances are, you want something the 4canned4
ones don't offer out of the box. For the programmer who develops the
cart, I think 70 percent of the features to develop cost 30 percent of
his time, the last 30 percent to develop cost 70 percent of his time.
Bet you, you want something out of the last 30 percent - and that costs,
because you have to be quite a programmer to develop the last 30 percent.
And these features are the ones which require a steep learning
curve from ISPs who have already read their books, even if they just have
to set up existing cart's code.
So, still a lot of work even without inventing all from scratch.
But somehow I think you had a bad choice of ISPs. :-)
>
> I'm kind of "in-lapse" for what I do, (someone else is taking it over
> while I work on it) but when I was installing carts for people it seemed
> everyone had a requirement that I hadn't thought of when writing the base,
> the only defense seemed to be adding features 90% of the people would
> never use.
That supports my point of view.
birgitt
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 25 Nov 1998 01:09:11 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: SSLeay and RSA
Message-Id: <Pine.GSO.4.02A.9811241708210.4375-100000@user2.teleport.com>
On Tue, 24 Nov 1998 bbrelin@dnai.com wrote:
> I'm trying to find out if it is possible to use SSLeay without using
> the RSA encryption algorithm.
Probably the docs, FAQs, and newsgroups about RSA encryption and related
topics would be of help to you. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 25 Nov 1998 12:36:35 +1100
From: Mick <bellears@deakin.edu.au>
Subject: Re: URGENT...Help Required!
Message-Id: <365B5F23.590AED26@deakin.edu.au>
Thanks for your informative advice, I stated before I am unfamiliar with
Perl, and was looking for any assistance at all. I'm not asking someone to
'do their work for me', just some advice on where the code was actually
writing to the file or something along those lines.
A few comments through the code would be more than helpful!
Mick
Rich wrote:
> On Tue, 24 Nov 1998 12:05:10 +1100, Mick <bellears@deakin.edu.au> wrote:
> ( Deleted )
>
> It's a good thing that I've set up my newsreader to filter out postings
> in discussion groups that are over 300 lines, and also those that
> ask other people to do their work for them. Otherwise, it might
> become annoying.
>
> - Rich
>
> ( Is it *still* September? )
>
> --
> Rich Mulvey
> My return address is my last name,
> followed by my first initial, @mulveyr.roc.servtech.com
> http://mulveyr.roc.servtech.com
> Amateur Radio: aa2ys@wb2wxq.#wny.ny.usa
------------------------------
Date: Wed, 25 Nov 1998 12:33:09 +1100
From: Mick <bellears@deakin.edu.au>
Subject: Re: URGENT...Help Required!
Message-Id: <365B5E54.628AC8E1@deakin.edu.au>
Thanks for your informative advice, I stated before I am unfamiliar with
Perl, and was looking for any assistance at all. I'm not asking someone to
'do their work for me', just some advice on where the code was actually
writing to the file or something along those lines.
A few comments through the code would be more than helpful!
Mick
Rich wrote:
> On Tue, 24 Nov 1998 12:05:10 +1100, Mick <bellears@deakin.edu.au> wrote:
> ( Deleted )
>
> It's a good thing that I've set up my newsreader to filter out postings
> in discussion groups that are over 300 lines, and also those that
> ask other people to do their work for them. Otherwise, it might
> become annoying.
>
> - Rich
>
> ( Is it *still* September? )
>
> --
> Rich Mulvey
> My return address is my last name,
> followed by my first initial, @mulveyr.roc.servtech.com
> http://mulveyr.roc.servtech.com
> Amateur Radio: aa2ys@wb2wxq.#wny.ny.usa
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 4292
**************************************