Re: Sorting a hash by values?

2002-06-08 Thread Janek Schleicher
Octavian Rasnita wrote at Fri, 07 Jun 2002 21:54:02 +0200: > I want to make a script that sorts the values from a hash. my @sorted_values = sort {$a <=> $b} values %hash; > > I want to make a "top with the most downloaded files". > > I know how to sort the hash by keys but I couldn't sort it

Re: website keywords

2002-06-08 Thread Hytham Shehab
hey man, of course i know that, but may i didn't made myself clear. what i want to is how do i get the keywords of web site via perl/cgi, i don't want to get the file first then search of matched meta=keywords and then use the m/blahblah/ heriglophic mystries characters to access such thing. am i

mysql query statement

2002-06-08 Thread Hytham Shehab
hi all of u, i got a simple question, why (1) is valid, however, (2) is not ?!! (1) sorting order is explicity typed in the query statement: $sth = $dbh->prepare("select student_name from students order by first_name asc"); $sth->execute(); (2) sorting order is passed as a bind parameter: $so

file i/o problem

2002-06-08 Thread aman cgiperl
I have a code that looks like the following $pgs = 1000; $lks = "Welcome Message"; for($i=0;$i<$pgs;$i++){ open PGIN, "/$char/$mn/index_tmp".$i.".html"; open PGOUT, ">/$char/$mn/index".$i.".html"; while() { $_ =~ s/##MS

Re: file i/o problem

2002-06-08 Thread drieux
Top Note - you may wish to choose one of the groups to email - vice hitting them all On Saturday, June 8, 2002, at 06:57 , aman cgiperl wrote: > I have a code that looks like the following > > $pgs = 1000; > $lks = "Welcome Message"; > for($i=0;$i<$pgs;$i++){ > open PGIN

Re: i/o problem

2002-06-08 Thread charles
I have code that looks like this: use Fcntl ":flock"; if ($ENV{'REQUEST_METHOD'} eq 'POST') { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([\d

Re: file i/o problem

2002-06-08 Thread aman cgiperl
Refering lines 6-9 of code below: The file is being read and each line printed as it is read. The while loop is getting terminated before the file is competely read. Suggestions? Thnx Aman - Original Message - From: "aman cgiperl" <[EMAIL PROTECTED]> I have a code that looks like the fol

Re: mysql query statement

2002-06-08 Thread fliptop
Hytham Shehab wrote: > (2) sorting order is passed as a bind parameter: > $sort = 'asc'; > $sth = $dbh->prepare("select student_name from students order by first_name > $sort"); > $sth->execute($sort); you're trying to substitute the value twice. try something like this instead: $sort = 'fir

Re: Am I doing something wrong?

2002-06-08 Thread David T-G
Teddy -- ...and then Octavian Rasnita said... % % Hi all, Hello! % % I use: % % =start; % % =cut % % I use this statement to comment out more lines. I've seen a trick like that used to comment out large blocks. What you're actually doing is using pod notation to declare a block docu

Re: mysql query statement

2002-06-08 Thread Hytham Shehab
fliptop said: > you're trying to substitute the value twice. try something like this > instead: > > $sort = 'first_name asc'; > $sth = $dbh->prepare("select foo from bar order by ?") > $sth->execute($sort); i did it already flip, but its not yet valid, also it seems to be mentaly valid, its not

Re: mysql query statement

2002-06-08 Thread fliptop
Hytham Shehab wrote: > i did it already flip, but its not yet valid, also it seems to be mentaly > valid, its not for mysql. perhaps you should ask your question on a more appropriate list. try this one: http://lists.perl.org/showlist.cgi?name=dbi-users -- To unsubscribe, e-mail: [EMAIL P