[19303] in Perl-Users-Digest
Perl-Users Digest, Issue: 1498 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Aug 11 18:10:48 2001
Date: Sat, 11 Aug 2001 15:10:12 -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: <997567812-v10-i1498@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sat, 11 Aug 2001 Volume: 10 Number: 1498
Today's topics:
Re: permuting extremely large string <godzilla@stomp.stomp.tokyo>
Re: permuting extremely large string <godzilla@stomp.stomp.tokyo>
Re: Poor man's HTML hidden field message digest?? (Anno Siegel)
Programmers Needed <contact@cytechdev.com>
Regexp to strip out HTML comments?? <miscellaneousemail@yahoo.com>
Re: Regexp to strip out HTML comments?? <ilya@martynov.org>
Re: Regexp to strip out HTML comments?? <miscellaneousemail@yahoo.com>
Re: Regexp to strip out HTML comments?? <pne-news-20010811@newton.digitalspace.net>
Re: Regexp to strip out HTML comments?? <Tassilo.Parseval@post.rwth-aachen.de>
Regular expression to take HTML comments out?? <miscellaneousemail@yahoo.com>
Re: Tie IxHash performance (Anno Siegel)
Unexplained process killing (Moran Goldstein)
Re: voodoo cookie hash problem (Eric Bohlman)
Re: What happened to the first element of my arrray? <gnarinn@hotmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 11 Aug 2001 13:04:48 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: permuting extremely large string
Message-Id: <3B758FE0.131BA172@stomp.stomp.tokyo>
Andras Malatinszky wrote:
> Anno Siegel wrote:
> > Andras Malatinszky wrote:
> > > Les Ander wrote:
(snipped)
> > > > i need to permute a string which is about 4 Mb!
> > > > also, can some one think of a better algorithm?
> > > What difference can it possibly make?
> > > A million-element set has easily more than 10^(10^6) permutations, so even
> > > if you dramatically improve your algorithm and can generate a single
> > > permutation in the time it takes light to traverse a hydrogen atom instead
> > > of the current forty-five seconds, you are still looking at a computing
> > > time way exceeding the age of the universe.
> > He doesn't want all the permutations, just one (or a few) random ones.
> Oh, yes, I realize that. That's why I'd like to see where this permuting is
> going. Maybe there is a less computing-intensive way of achieving the few
> specific shufflings that the OP requires.
If you weren't so wrapped up in your egotistical arrogance
and if you weren't such a piss poor Perl programmer drowning
in your deep denial and Perl 5 Cargo Cult worshipping....
Here are four methods which took me fifteen to twenty minutes
to develop and test, blank page start to finish. None use
references nor rand nor any other of your monsterous snail
slow methods. Some are stand alone methods, some build on
previous methods. All employ lightening fast methodologies
and represent a potential for thousands of code variations,
quite handsomely and, customary for my code, highly logical
and efficient. My code can be very easily modified to only
print four permutations, one for each code method, or any
variation of sampling numbers.
Before you pitch one of your CLPM Troll anal retentive
fits, a preemptive blow up your brains strike. My use
of an array is a simple courtesy to display total number
of possible permutations; it is unrelated to my methods.
My coding avoids your Perl 5 Cargo Cultist cumbersome,
slow and obfuscated methods. My code is written in a
style which is verbose Plain English so even you can
understand, as dubious as that is.
For your benefit, if you plan to use your original
four-megabyte string with my code samples, well,
while a print is in process, perhaps you could
entertain yourself by twiddling your thumbs.
Godzilla! Queen Of Thumbelina.
--
#!perl
print "Content-type: text/plain\n\n";
$string = "Godzilla Rocks And Rolls! Oh Yes! She Rocks My Socks Off!";
$element_count = $string =~ tr/ //;
@Array = (1 .. $element_count);
$permutate = 1;
$elements = 1;
while (@Array)
{
$permutate = $Array[0] * $permutate;
$elements++;
shift (@Array);
if ($elements == $element_count + 1)
{ print "There are $permutate possible permutations.\n\n"; }
}
print "Old String: $string\n\n";
$new_string = $string;
$string2 = "$string ";
for ($iterate = 1; $iterate <= $element_count; $iterate++)
{
$snatch = substr ($string2, 0, index ($string2, " ") +1, "");
$new_string =~ s/$snatch//;
$new_string = "$new_string $snatch";
$new_string =~ s/\s+/ /g;
print "New String: $new_string\n";
}
print "\n\n";
$string2 = $string;
$var1 = substr ($string2, 0, index ($string2, " ") + 1, "");
$var2 = substr ($string2, 0, index ($string2, " ") + 1, "");
$string2 = "$var2$var1$string2";
$new_string = $string2;
$string2 = "$string2 ";
for ($iterate = 1; $iterate <= $element_count; $iterate++)
{
$snatch = substr ($string2, 0, index ($string2, " ") +1, "");
$new_string =~ s/$snatch//;
$new_string = "$new_string $snatch";
$new_string =~ s/\s+/ /g;
print "New String: $new_string\n";
}
print "\n\n";
$string2 = $string;
$start = index ($string2, $var2) + length ($var2);
$stop = index ($string2, " ", $start);
$var3 = substr ($string2, $start, $stop - $start + 1, "");
$start = index ($string2, $var2) + length ($var2);
$stop = index ($string2, " ", $start);
$var4 = substr ($string2, $start, $stop - $start + 1, "");
$string2 = "$var3$var4$string2";
$new_string = $string2;
$string2 = "$string2 ";
for ($iterate = 1; $iterate <= $element_count; $iterate++)
{
$snatch = substr ($string2, 0, index ($string2, " ") +1, "");
$new_string =~ s/$snatch//;
$new_string = "$new_string $snatch";
$new_string =~ s/\s+/ /g;
print "New String: $new_string\n";
}
print "\n\n";
$string2 = $string;
$length = length ($string);
if (substr ($length, -1, 1) =~ /1|3|5|7|9/)
{ $length++; }
$start = $length / 4;
$start = index ($string, " ", $start);
$start++;
$stop = index ($string, " ", $start);
$variable = substr ($string2, $start, $stop - $start + 1, "");
$string2 = "$variable$string2";
$new_string = $string2;
$string2 = "$string2 ";
for ($iterate = 1; $iterate <= $element_count; $iterate++)
{
$snatch = substr ($string2, 0, index ($string2, " ") +1, "");
$new_string =~ s/$snatch//;
$new_string = "$new_string $snatch";
$new_string =~ s/\s+/ /g;
print "New String: $new_string\n";
}
PRINTED RESULTS:
________________
There are 3628800 possible permutations.
Old String: Godzilla Rocks And Rolls! Oh Yes! She Rocks My Socks Off!
New String: Rocks And Rolls! Oh Yes! She Rocks My Socks Off! Godzilla
New String: And Rolls! Oh Yes! She Rocks My Socks Off! Godzilla Rocks
New String: Rolls! Oh Yes! She Rocks My Socks Off! Godzilla Rocks And
New String: Oh Yes! She Rocks My Socks Off! Godzilla Rocks And Rolls!
New String: Yes! She Rocks My Socks Off! Godzilla Rocks And Rolls! Oh
New String: She Rocks My Socks Off! Godzilla Rocks And Rolls! Oh Yes!
New String: Rocks My Socks Off! Godzilla Rocks And Rolls! Oh Yes! She
New String: My Socks Off! Godzilla Rocks And Rolls! Oh Yes! She Rocks
New String: Socks Off! Godzilla Rocks And Rolls! Oh Yes! She Rocks My
New String: Off! Godzilla Rocks And Rolls! Oh Yes! She Rocks My Socks
New String: Godzilla And Rolls! Oh Yes! She Rocks My Socks Off! Rocks
New String: And Rolls! Oh Yes! She Rocks My Socks Off! Rocks Godzilla
New String: Rolls! Oh Yes! She Rocks My Socks Off! Rocks Godzilla And
New String: Oh Yes! She Rocks My Socks Off! Rocks Godzilla And Rolls!
New String: Yes! She Rocks My Socks Off! Rocks Godzilla And Rolls! Oh
New String: She Rocks My Socks Off! Rocks Godzilla And Rolls! Oh Yes!
New String: Rocks My Socks Off! Rocks Godzilla And Rolls! Oh Yes! She
New String: My Socks Off! Rocks Godzilla And Rolls! Oh Yes! She Rocks
New String: Socks Off! Rocks Godzilla And Rolls! Oh Yes! She Rocks My
New String: Off! Rocks Godzilla And Rolls! Oh Yes! She Rocks My Socks
New String: Rolls! Godzilla Rocks Oh Yes! She Rocks My Socks Off! And
New String: Godzilla Rocks Oh Yes! She Rocks My Socks Off! And Rolls!
New String: Rocks Oh Yes! She Rocks My Socks Off! And Rolls! Godzilla
New String: Oh Yes! She Rocks My Socks Off! And Rolls! Godzilla Rocks
New String: Yes! She Rocks My Socks Off! And Rolls! Godzilla Rocks Oh
New String: She Rocks My Socks Off! And Rolls! Godzilla Rocks Oh Yes!
New String: Rocks My Socks Off! And Rolls! Godzilla Rocks Oh Yes! She
New String: My Socks Off! And Rolls! Godzilla Rocks Oh Yes! She Rocks
New String: Socks Off! And Rolls! Godzilla Rocks Oh Yes! She Rocks My
New String: Off! And Rolls! Godzilla Rocks Oh Yes! She Rocks My Socks
New String: Godzilla Rocks Rolls! Oh Yes! She Rocks My Socks Off! And
New String: Rocks Rolls! Oh Yes! She Rocks My Socks Off! And Godzilla
New String: Rolls! Oh Yes! She Rocks My Socks Off! And Godzilla Rocks
New String: Oh Yes! She Rocks My Socks Off! And Godzilla Rocks Rolls!
New String: Yes! She Rocks My Socks Off! And Godzilla Rocks Rolls! Oh
New String: She Rocks My Socks Off! And Godzilla Rocks Rolls! Oh Yes!
New String: Rocks My Socks Off! And Godzilla Rocks Rolls! Oh Yes! She
New String: My Socks Off! And Godzilla Rocks Rolls! Oh Yes! She Rocks
New String: Socks Off! And Godzilla Rocks Rolls! Oh Yes! She Rocks My
New String: Off! And Godzilla Rocks Rolls! Oh Yes! She Rocks My Socks
------------------------------
Date: Sat, 11 Aug 2001 13:21:42 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: permuting extremely large string
Message-Id: <3B7593D6.33EBBD80@stomp.stomp.tokyo>
Godzilla! wrote:
(might be snipped)
> Here are four methods which took me fifteen to twenty minutes
> to develop and test, blank page start to finish.
WAIT!!!!
I recall a person claiming a Perl programmer can
only write ten lines of code per day. He even put
up a pretty good impotent fight, citing inane author
references and similar such mule manure.
* blows smoke off her finger tips *
Amazing, ain't I?
Godzilla! Queen Of Tenshooters.
------------------------------
Date: 11 Aug 2001 21:07:28 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Poor man's HTML hidden field message digest??
Message-Id: <9l46qg$jbe$1@mamenchi.zrz.TU-Berlin.DE>
According to Carlos C. Gonzalez <miscellaneousemail@yahoo.com>:
[...]
> I had actually hoped to get more input on my poor man's message digest
> idea. I threw in the rounding error question as an afterthought.
Without going into detail, it seems you base your digest on ASCII
values using a rational expression that is thrown together more
or less at random. At least you didn't say why you use that expression
and not something similar.
Master Knuth tells the story[1] how he learned that "random numbers
should not be generated with a method chosen at random". He went
to construct Knuth's SUPER-RANDOM generator by choosing a dozen or so
steps that each transform a number into another in some erratic way.
(The well-known middle-square and linear-congruential methods were
among them.) These went, sequentially, in the body of a loop which
he went around a random number of times (based on the previous random
number). Each time around the loop he chose a random place in the
sequence to goto (based on the so-far transformed number). The
rest of the transformations were then performed and the result of
so-many such rounds returned.
The result wasn't good. One sequence went into a cycle of length
3178. Another had a cycle length of 1, that is he found a number
that reproduces itself under that process!
The lesson is so impressive that even learning it second-hand has
brought me to distrust any program that contains code chosen at random.
Anno
[1] TAoCP, Vol. 2, 3.1
------------------------------
Date: Sat, 11 Aug 2001 21:25:42 GMT
From: "CytechDev" <contact@cytechdev.com>
Subject: Programmers Needed
Message-Id: <qphd7.386378$lq1.81464546@typhoon.austin.rr.com>
CytechDev.com is currently looking for some solid software to add to it's
product line. If your not currently generating any income from your software
or even if you are, please visit http://cytechdev.com/oppurtunity.htm and
read about our current oppurtunity!
CytechDev Software Solutions
www.CtechDev.com
------------------------------
Date: Sat, 11 Aug 2001 19:55:38 GMT
From: Carlos C. Gonzalez <miscellaneousemail@yahoo.com>
Subject: Regexp to strip out HTML comments??
Message-Id: <MPG.15df3b7e10b9b4f898972e@news.edmonton.telusplanet.net>
Hi everyone,
Since I am relatively new at using regular expressions and Perl in
general I was wondering if someone could give me some feedback on the
following regexp. It strips the $string of the HTML comment statement
and any text in between them.
Is there a faster and / or clearer, better way to do this?
The code:
#!/usr/bin/perl -w
use CGI::Carp qw(carpout fatalsToBrowser);
use diagnostics;
use strict;
my $string = "Hello<!-- BEGIN -->there!<!-- END --> How are you?";
$string =~s/<!-- BEGIN -->.+<!-- END -->//;
print $string;
Thanks.
--
Carlos
www.internetsuccess.ca
--
Carlos
www.internetsuccess.ca
------------------------------
Date: 12 Aug 2001 00:02:22 +0400
From: Ilya Martynov <ilya@martynov.org>
Subject: Re: Regexp to strip out HTML comments??
Message-Id: <87n156gyb5.fsf@abra.ru>
CCG> Hi everyone,
CCG> Since I am relatively new at using regular expressions and Perl in
CCG> general I was wondering if someone could give me some feedback on the
CCG> following regexp. It strips the $string of the HTML comment statement
CCG> and any text in between them.
CCG> Is there a faster and / or clearer, better way to do this?
Maybe you should just take HTML::Clean from CPAN?
CCG> The code:
CCG> [..skip..]
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/) |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80 E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/) |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
------------------------------
Date: Sat, 11 Aug 2001 20:08:01 GMT
From: Carlos C. Gonzalez <miscellaneousemail@yahoo.com>
Subject: Re: Regexp to strip out HTML comments??
Message-Id: <MPG.15df3ec7c873031998972f@news.edmonton.telusplanet.net>
In article <87n156gyb5.fsf@abra.ru>, Ilya Martynov at ilya@martynov.org
says...
> Maybe you should just take HTML::Clean from CPAN?
Thanks for your suggestion Ilya. I want to stay away from using modules
for one time and rare operations though. Especially when I can use a one
line regexp.
I did find one problem with my regexp on further testing. It wasn't
replacing a string with newlines in between the HTML comments.
The new improved version is:
$string =~s/<!-- BEGIN -->.+<!-- END -->//s;
I added an "s" to the end of the regular expression to make it evaluate
as one long string so that the "." will match newlines along with any
other character.
Does anyone know of an improved regexp for the above line? There may not
be but since I am learning I thought I would solicit input from anyone
willing to give some pointers to a newbie.
Thanks.
--
Carlos
www.internetsuccess.ca
------------------------------
Date: Sat, 11 Aug 2001 22:24:25 +0200
From: Philip Newton <pne-news-20010811@newton.digitalspace.net>
Subject: Re: Regexp to strip out HTML comments??
Message-Id: <l05bnt0cfvd5pv24crh8ar7uqke055jvf8@4ax.com>
On Sat, 11 Aug 2001 20:08:01 GMT, Carlos C. Gonzalez
<miscellaneousemail@yahoo.com> wrote:
> Does anyone know of an improved regexp for the above line?
Changing ".+" to ".+?" is probably a good step if the number of
characters between the comments is small relative to the total number of
characters in the string (and also a good idea if you ever have multiple
commented-out sections).
Also, if there can't be any HTML tags between your begin and end
comments, you could change ".+" to "[^<]+".
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Sat, 11 Aug 2001 22:20:25 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: Regexp to strip out HTML comments??
Message-Id: <3B759389.3040207@post.rwth-aachen.de>
Carlos C. Gonzalez wrote:
> In article <87n156gyb5.fsf@abra.ru>, Ilya Martynov at ilya@martynov.org
> says...
>
>
>>Maybe you should just take HTML::Clean from CPAN?
>>
>
> Thanks for your suggestion Ilya. I want to stay away from using modules
> for one time and rare operations though. Especially when I can use a one
> line regexp.
If you can it's ok. There are certainly situations in which a regex will
do fine, eg. when fetching a certain URL each day and you know the exact
format of this page.
> I did find one problem with my regexp on further testing. It wasn't
> replacing a string with newlines in between the HTML comments.
And now you see: parsing HTML by using a regex will mainly work in those
cases when the HTML conforms to a certain scheme. Whenever the HTML-code
is slightly changed you get into troubles with a regex.
> The new improved version is:
>
> $string =~s/<!-- BEGIN -->.+<!-- END -->//s;
>
> I added an "s" to the end of the regular expression to make it evaluate
> as one long string so that the "." will match newlines along with any
> other character.
>
> Does anyone know of an improved regexp for the above line? There may not
> be but since I am learning I thought I would solicit input from anyone
> willing to give some pointers to a newbie.
I'd still go for Ilyas's suggestion. Use on of the HTML-parsers (my
recommendation: HTML::TokeParser which is more user-friendly than
HTML::Parser). Make yourself comfortable with the parser of your choice
and you can be sure that from then on you can handle any HTML with ease.
After all it'll save you time since you don't have to come up with a new
regex each time a new HTML-document is lying before you.
Tassilo
--
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
ord(chr($h->{$_}))))};
------------------------------
Date: Sat, 11 Aug 2001 19:34:27 GMT
From: Carlos C. Gonzalez <miscellaneousemail@yahoo.com>
Subject: Regular expression to take HTML comments out??
Message-Id: <MPG.15df365da069198a98972d@news.edmonton.telusplanet.net>
Hi everyone,
Since I am relatively new at using regular expressions and Perl in
general I was wondering if someone could give me some feedback on the
following regexp. It strips the $string of the HTML comment statement
and any text in between them.
Is there a faster and / or clearer, better way to do this?
The code:
#!/usr/bin/perl -w
use CGI::Carp qw(carpout fatalsToBrowser);
use diagnostics;
use strict;
my $string = "Hello<!-- BEGIN -->there!<!-- END --> How are you?";
$string =~s/<!-- BEGIN -->.+<!-- END -->//;
print $string;
Thanks.
--
Carlos
www.internetsuccess.ca
------------------------------
Date: 11 Aug 2001 20:12:06 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Tie IxHash performance
Message-Id: <9l43im$hdg$1@mamenchi.zrz.TU-Berlin.DE>
According to jose <quesadaj@psych.colorado.edu>:
>
> Hi there,
>
> Have you ever used IxHash intensively? have you had problems with the
> speed of, for example, deletes or searches?
> Does anybody know of any reference where the performance of arrays,
> hashes, IxHash ties, and DB_file ties is
> compared? That sounds to me like a very interesting comparison, but so
> far I couldn't find any information.
Interesting perhaps, but DB performance depends on a lot of parameters.
Just accounting for low/medium/high values for DB size, mean length of
keys, mean length of data, and relation of read/write accesses would
give you 81 benchmarks per product. Oh yes, and you mentioned deletions.
Volunteers?
Anno
------------------------------
Date: 11 Aug 2001 13:37:01 -0700
From: moran-gy@actcom.co.il (Moran Goldstein)
Subject: Unexplained process killing
Message-Id: <223f9ce4.0108111237.4ddde3a6@posting.google.com>
Hi,
I'm working on a script that loops through large arrays and modifies
numeric values. Specifically, hashes of 3D-arrays (ie -
$hash{key}[Z][Y][X]). The problem is that, depending on the size of
the array, it's likely to get killed(running on FreeBSD). The arrays
can get up to 200,000 values, usually of floating-point numbers.
I'm guessing that the script is being killed because of memory usage,
but I can't be sure. What I am sure about is that the higher the
amount of values, the higher the possibility of it being killed.
Anything below ~40,000 values usually passes through, but if values
exceed 200,000, there's almost a %50 chance of the process being
killed.
When it gets killed, it just says "killed", with no details. Is there
any way I can get more information from the script about why it's
being killed? Any error-checking methods? Also, isn't 200,000 values
actually a small amount, relative to the huge amounts of database
strings Perl so easily deals with?
By the way -- in case it's of any relevance to the problem, large
arrays take up to 15 seconds to process (when the script isn't killed,
that is).
Thanks in advance,
-Moran Goldstein
------------------------------
Date: 11 Aug 2001 18:58:34 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: voodoo cookie hash problem
Message-Id: <9l3v8q$r4v$1@bob.news.rcn.net>
Mongo <mongo@firewallx.com> wrote:
> I think it's got somthing to do with sendmail being on a different
> server so it doesn't see the cookie.
That can't possibly be the case, because sendmail has no idea what a
cookie is.
------------------------------
Date: Sat, 11 Aug 2001 19:45:28 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: What happened to the first element of my arrray?
Message-Id: <997559128.99941075919196.gnarinn@hotmail.com>
In article <9l3i2m$aoj$1@neptunium.btinternet.com>,
Peter Mann <Pcmann1@btinternet.com> wrote:
> I am new to Perl and this problem has me puzzled. When I call 'output
>users' from 'getUsers' the first element of the array is missing and not
>displayed in the combo box!
> Before i split it up into 2 subs, all the elements were displayed in
>the combo box, so I suspect the problem has something to do with passing the
>array? But what is it?
>
>
>
>
>sub getUsers
>{
> $dbh = DBI->connect('dbi:ODBC:developers');
> $sqlstatement = "SELECT * FROM developers";
i will assume that developers contains only one field
you should use named fields instead of the '*', otherwise you will
get bitten later
>
> $sth = $dbh->prepare($sqlstatement);
> $sth->execute ||
> die "Could not execute SQL statement, maybe invalid?";
>
> @users=$sth->fetchrow_array;
ok you have fetched first user into @user
> outputUsers (@users);
>
> $sth->finish();
> $dbh->disconnect();
>}
>
>
>sub outputUsers
>{
at this point @_ contains one user
> my @temp = shift;
(strange syntax) here you put the user into @temp,
and as this is not used any more, you have effectively thrown it away
maybe you wanted to insert it into the combo?
>
> #Output database results
> while ($temp=$sth->fetchrow_array)
> {
> $combo1->insert("end", $temp);
> }
>}
>
probably what you want is:
remove the fetchrow_array from getUsers()
change the call outputUsers(@users) to outputUsers();
remove the shift line in outputUsers()
while you are at it , i would:
not use globals for $sth and $combo1 and $dbh
change the while line to: while (my ($temp)=$sth->fetchrow_array)
(all this untested, so look out for typos and such)
good luck
gnari
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.
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 V10 Issue 1498
***************************************