[29164] in Perl-Users-Digest
Perl-Users Digest, Issue: 408 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 5 14:09:55 2007
Date: Sat, 5 May 2007 11:09:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 5 May 2007 Volume: 11 Number: 408
Today's topics:
Re: 2 array problem <abigail@abigail.be>
Re: appropriate module/hints on how to solve the follow <tadmc@augustmail.com>
Re: appropriate module/hints on how to solve the follow <jurgenex@hotmail.com>
eval problem! <jaford@watford53.freeserve.co.uk>
Re: eval problem! <bik.mido@tiscalinet.it>
Re: eval problem! <jaford@watford53.freeserve.co.uk>
Re: eval problem! <bik.mido@tiscalinet.it>
Re: eval problem! <someone@example.com>
Re: eval problem! <jaford@watford53.freeserve.co.uk>
Re: how does one use tuplespaces with perl? link.. <bik.mido@tiscalinet.it>
Re: Link Matching <bik.mido@tiscalinet.it>
Re: Link Matching <brian.d.foy@gmail.com>
Re: Link Matching <noreply@gunnar.cc>
Re: Link Matching <stoupa@practisoft.cz>
Re: Link Matching <tadmc@augustmail.com>
Re: Link Matching <tadmc@augustmail.com>
Re: Lisp for the C21 <raffaelcavallaro@pas-d'espam-s'il-vous-plait-mac.com>
Re: perl out of memory <bik.mido@tiscalinet.it>
Re: Populating an array from a mysql select <bik.mido@tiscalinet.it>
Re: Populating an array from a mysql select <bik.mido@tiscalinet.it>
Re: Populating an array from a mysql select <bik.mido@tiscalinet.it>
Re: Populating an array from a mysql select <tadmc@augustmail.com>
Re: Populating an array from a mysql select <nikos1337@gmail.com>
Select from drop down menu multipel times in the same f <nikos1337@gmail.com>
Re: Select from drop down menu multipel times in the sa <nikos1337@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 05 May 2007 11:50:19 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: 2 array problem
Message-Id: <slrnf3orr3.hl5.abigail@alexandra.abigail.be>
Michele Dondi (bik.mido@tiscalinet.it) wrote on MMMMCMXCIV September
MCMXCIII in <URL:news:5mnm33h3207b0e0eptvsrtlemj326alaf3@4ax.com>:
<> On 04 May 2007 15:07:18 GMT, Abigail <abigail@abigail.be> wrote:
<>
<> >That '@a' doesn't warn in your example has little to do with @a being
<> >special. It just has to do with the fact that *a exists. Which exists
<>
<> That's surely what Anno meant. As you surely know full well.
Then I don't get it. @a behaves the same as @c.
Abigail
--
my $qr = qr/^.+?(;).+?\1|;Just another Perl Hacker;|;.+$/;
$qr =~ s/$qr//g;
print $qr, "\n";
------------------------------
Date: Sat, 5 May 2007 08:22:34 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: appropriate module/hints on how to solve the following problem?
Message-Id: <slrnf3p18q.bao.tadmc@tadmc30.august.net>
Shark <cpp_shark@yahoo.com> wrote:
> The idea is to read in a config file of the
> following format:
>
> NAME1 alias1 alias2 alias3
> NAME2 blah1 blah2
> NAME3 m1 m2
>
>
> After reading in the above, the following two should be equivalent:
>
> alias1:blah1
> alias2:blah1
> ...
> ...
>
> I can explain in more detail what functionality I want if anyone has
> specific questions.
Why is "alias3" missing?
Why is "m1" missing from the 1st one and "m2" missing for the 2nd one?
What should it do if there is a 4th line like:
NAME4 foo alias1 bar
??
> This seemed like a very simple problem
Then it should be easy to describe it fully enough to be able to
suggest code that solves it...
Please make a short (less than 20-30 lines) and *complete* program
that illustrates the problem you are having. People should be able
to run your program by copy/pasting the code from your article.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 05 May 2007 14:05:17 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: appropriate module/hints on how to solve the following problem?
Message-Id: <xa0%h.1528$rk5.132@trndny06>
Shark wrote:
> Hi, I'm working on a solution to handle aliases of strings (not
> variables) correctly. The idea is to read in a config file of the
> following format:
>
> NAME1 alias1 alias2 alias3
> NAME2 blah1 blah2
> NAME3 m1 m2
>
> After reading in the above, the following two should be equivalent:
> alias1:blah1
> alias2:blah1
> ...
> ...
For the last 5 minutes I've been trying to understand what it is you want.
First of all what do you mean by "the following two should be equivalent":
Should "alias1:blah1" be equivalent to "alias2:blah1" (that's what you
wrote) or do you want the elements in each pair to be equivalent, i.e.
"alias2" is equivalent to "blah1" and "alias2" is equivalent to "blah1"?
Either way, I can't see the logic how you determine the equivalence based on
the sample input data.
In the first option the first two entries from the NAME1 line are each
combined with the first entry in the NAME2 line and then considered
equivalent. What happened to alias3? What happens if I combine the second
entry of the third line ("m3")with the first entry in the first line
("alias1") as "m3:alias1"? Is that equivalent to the "alias1:blah1"?
In the second option what happens to "alias3"? Is that equivalent to
"blah1", too? Like all elements in the first line are equivalent to the
first element in the second line? If so then does this propagate to the
following lines, too, e.g. all elements in a line are equivalent to the
first element in the next line? I believe this would make all elements
members of the same equivalence class.
I think you need to be much more precise in your specification before
anybody can help you with a solution.
jue
------------------------------
Date: Sat, 05 May 2007 14:02:01 GMT
From: Jim Ford <jaford@watford53.freeserve.co.uk>
Subject: eval problem!
Message-Id: <t70%h.5736$%9.3010@newsfe7-gui.ntli.net>
I have a script using a module I've written which is used in a Tk
callback. The module contains the following line:
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
The problem is that the values get determined at compile time, rather
than updated whenever a callback is made.
I understand that the appropriate use of 'eval' should make the call to
localtime(time) occur during run-time, whenever the callback occurs,
but I've not managed to get this to happen with any amount of 'mixing
and matching'!
I would be grateful for any suggestions.
Jim Ford
------------------------------
Date: Sat, 05 May 2007 16:56:00 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: eval problem!
Message-Id: <sg6p33tjhmjlld5trvh32phigrbp9qld3p@4ax.com>
On Sat, 05 May 2007 14:02:01 GMT, Jim Ford
<jaford@watford53.freeserve.co.uk> wrote:
>I have a script using a module I've written which is used in a Tk
>callback. The module contains the following line:
>
>($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
>
>The problem is that the values get determined at compile time, rather
>than updated whenever a callback is made.
>
>I understand that the appropriate use of 'eval' should make the call to
> localtime(time) occur during run-time, whenever the callback occurs,
>but I've not managed to get this to happen with any amount of 'mixing
>and matching'!
Do not mess with (string) eval(). Without seeing actual code, it's
hard to say something more precise. But basically have your
localtime(time) execute in the callback, rather than making it a
closure around those scalars, which is what I think you're doing. (Or
something like that.)
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Sat, 05 May 2007 15:25:47 GMT
From: Jim Ford <jaford@watford53.freeserve.co.uk>
Subject: Re: eval problem!
Message-Id: <%l1%h.4505$2i.2441@newsfe4-gui.ntli.net>
Michele Dondi wrote:
> On Sat, 05 May 2007 14:02:01 GMT, Jim Ford
> <jaford@watford53.freeserve.co.uk> wrote:
>
>> I have a script using a module I've written which is used in a Tk
>> callback. The module contains the following line:
>>
>> ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
>>
>> The problem is that the values get determined at compile time, rather
>> than updated whenever a callback is made.
>>
>> I understand that the appropriate use of 'eval' should make the call to
>> localtime(time) occur during run-time, whenever the callback occurs,
>> but I've not managed to get this to happen with any amount of 'mixing
>> and matching'!
>
> Do not mess with (string) eval(). Without seeing actual code, it's
> hard to say something more precise. But basically have your
> localtime(time) execute in the callback, rather than making it a
> closure around those scalars, which is what I think you're doing. (Or
> something like that.)
Thanks for the reply, Michele.
I have '($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime(time);' in a module that I've written that relates the time of
day to a teaching period. I call the module subroutine day_period() in
the callback which returns the day of the week and the teaching period
eg (Tuesday,5b). So localtime(time) _is_ called in the callback via the
module subroutine day_period().
NB. I'm not really up to speed with closures - I've read the section in
the 'Programming Perl', but need time for it to soak in!
Jim
------------------------------
Date: Sat, 05 May 2007 18:59:35 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: eval problem!
Message-Id: <qcdp33p1n1j6v0i52laihh9lnkjlq08v6t@4ax.com>
On Sat, 05 May 2007 15:25:47 GMT, Jim Ford
<jaford@watford53.freeserve.co.uk> wrote:
>I have '($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
>localtime(time);' in a module that I've written that relates the time of
This doesn't mean anything. Are those variables lexical? I don't think
so. And without seeing *how* that particular statement is used in your
particular module, one can hardly say anything.
>day to a teaching period. I call the module subroutine day_period() in
>the callback which returns the day of the week and the teaching period
>eg (Tuesday,5b). So localtime(time) _is_ called in the callback via the
>module subroutine day_period().
Still not clear. Can't you prepare -as is usually recommended- a
minimal but complete example exhibiting the problem?
>NB. I'm not really up to speed with closures - I've read the section in
>the 'Programming Perl', but need time for it to soak in!
Less trascendental than at first sight it may seem.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Sat, 05 May 2007 17:05:56 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: eval problem!
Message-Id: <UP2%h.15319$KN6.9250@edtnps89>
Jim Ford wrote:
> I have a script using a module I've written which is used in a Tk
> callback. The module contains the following line:
>
> ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
>
> The problem is that the values get determined at compile time, rather
> than updated whenever a callback is made.
>
> I understand that the appropriate use of 'eval' should make the call to
> localtime(time) occur during run-time, whenever the callback occurs,
> but I've not managed to get this to happen with any amount of 'mixing
> and matching'!
If localtime() won't run then eval() won't run either. It sounds like your
"callback" is not really a callback but a call. Show us your actual code.
John
--
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order. -- Larry Wall
------------------------------
Date: Sat, 05 May 2007 17:49:05 GMT
From: Jim Ford <jaford@watford53.freeserve.co.uk>
Subject: Re: eval problem!
Message-Id: <ls3%h.6476$H4.2740@newsfe2-gui.ntli.net>
Michele Dondi wrote:
> On Sat, 05 May 2007 15:25:47 GMT, Jim Ford
> <jaford@watford53.freeserve.co.uk> wrote:
>
>> I have '($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
>> localtime(time);' in a module that I've written that relates the time of
>
> This doesn't mean anything. Are those variables lexical? I don't think
> so. And without seeing *how* that particular statement is used in your
> particular module, one can hardly say anything.
>
>> day to a teaching period. I call the module subroutine day_period() in
>> the callback which returns the day of the week and the teaching period
>> eg (Tuesday,5b). So localtime(time) _is_ called in the callback via the
>> module subroutine day_period().
>
> Still not clear. Can't you prepare -as is usually recommended- a
> minimal but complete example exhibiting the problem?
>
Thanks again for the reply, Michele (& John).
When I get back to work (where I'm running the script) I'll pick up the
scripts and post the relevant parts.
Jim Ford
------------------------------
Date: Sat, 05 May 2007 13:47:26 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: how does one use tuplespaces with perl? link..
Message-Id: <slro331p2puvafe4p1soq8q7qfer86nd4q@4ax.com>
On 4 May 2007 14:27:10 -0700, gavino <gavcomedy@gmail.com> wrote:
>Subject: how does one use tuplespaces with perl? link..
Huh?!?
>http://www.jini.org/wiki/Main_Page
So what?!?
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Sat, 05 May 2007 15:09:02 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Link Matching
Message-Id: <a50p335cl998tgrir97m350flqh3pe8gef@4ax.com>
On Sat, 05 May 2007 05:30:51 GMT, "John W. Krahn"
<someone@example.com> wrote:
>> Regexes are the most painful way possible to parse HTML. I'd rather shave
>> with a cheese grater.
>
>Will you post that on YouTube? :-)
And if you do, then please advertise here. I want to add some balloon
at http://www.bubbleply.com/, although the last time I tried I was so
disappointed to notice that the accurate timings I had put into the
damned thing went severely out of sync in playing mode...
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Sat, 05 May 2007 08:27:45 -0500
From: brian d foy <brian.d.foy@gmail.com>
Subject: Re: Link Matching
Message-Id: <050520070827458428%brian.d.foy@gmail.com>
In article <1178334533.173139.297370@u30g2000hsc.googlegroups.com>,
Taras_96 <taras.di@gmail.com> wrote:
> I need to write a regex that parses some HTML text to output all links
> whose text (the text that appears on the screen) a given expression.
>
> eg: findLinks(html,'(.*)o(.*)') called on the html code
I think you want HTML::LinkExtractor
http://search.cpan.org/dist/HTML-LinkExtractor/
--
Posted via a free Usenet account from http://www.teranews.com
------------------------------
Date: Sat, 05 May 2007 16:53:01 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Link Matching
Message-Id: <5a3k6vF2mltipU1@mid.individual.net>
Taras_96 wrote:
>
> '/<a[^><]*href\s*=\s*[^>]*>'.$regex.'<\/a>/'
>
> (I'm only interested with tags that have a href attribute)
>
> which greedily matches the entire input string.
>
> How do I make the </a> match non greedy? I've read that (.*?)<\/a>
> makes the match non greedy, but this doesn't account for the form of
> the link text.
Really? Even if a regex would be sufficient for the task you are trying
to accomplish, I'm not convinced. Can you demonstrate your claim with
some runnable example code?
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Sat, 5 May 2007 16:46:43 +0200
From: "Petr Vileta" <stoupa@practisoft.cz>
Subject: Re: Link Matching
Message-Id: <f1i5qm$m67$1@ns.felk.cvut.cz>
"Taras_96" <taras.di@gmail.com> píse v diskusním príspevku
news:1178334533.173139.297370@u30g2000hsc.googlegroups.com...
> Hi everyone,
>
> I need to write a regex that parses some HTML text to output all links
> whose text (the text that appears on the screen) a given expression.
>
> eg: findLinks(html,'(.*)o(.*)') called on the html code
>
> <a>one</a>
> <a>three</a>
> <a>two</a>
>
Assume that variable $page contain html code.
while ($page =~ m/<a\s+.*?href=.+?>/si)
{
$page =~ s/^.+?<a\s+.*?href=.+?>(.+?)<\/a>(.+)$/$2/si;
print "$1\n";
}
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
------------------------------
Date: Sat, 5 May 2007 12:11:42 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Link Matching
Message-Id: <slrnf3peme.f09.tadmc@tadmc30.august.net>
Petr Vileta <stoupa@practisoft.cz> wrote:
> $page =~ s/^.+?<a\s+.*?href=.+?>(.+?)<\/a>(.+)$/$2/si;
> print "$1\n";
You should never use the dollar-digit variables unless
you have first ensured that the pattern match _succeeded_.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 5 May 2007 12:13:20 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Link Matching
Message-Id: <slrnf3pepg.f09.tadmc@tadmc30.august.net>
Petr Vileta <stoupa@practisoft.cz> wrote:
> Assume that variable $page contain html code.
OK.
--------------------------
#!/usr/bin/perl
use warnings;
use strict;
my $page = '<html></html>';
while ($page =~ m/<a\s+.*?href=.+?>/sig)
{
$page =~ s/^.+?<a\s+.*?href=.+?>(.+?)<\/a>(.+)$/$2/si;
print "$1\n";
}
--------------------------
That link-finding program does exactly what it is supposed to do.
If you had some other data in mind, then you need to share
that with us, we are not mind readers.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 5 May 2007 11:13:50 -0400
From: Raffael Cavallaro <raffaelcavallaro@pas-d'espam-s'il-vous-plait-mac.com>
Subject: Re: Lisp for the C21
Message-Id: <2007050511135016807-raffaelcavallaro@pasdespamsilvousplaitmaccom>
On 2007-05-04 11:32:14 -0400, Paul Rubin <http://phr.cx@NOSPAM.invalid> said:
> Anyone who didn't love lisp in the 20th century has no heart.
> Anyone who still loves it in the 21st, has no head.
By the same logic we should all be conservative Republicans. Given this
implication, I'll stick with lisp, thanks.
------------------------------
Date: Sat, 05 May 2007 12:49:14 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: perl out of memory
Message-Id: <s8ko33tdsopeos1prk8dnv7h3n8c4if0i4@4ax.com>
On 4 May 2007 13:33:34 -0700, xlue897@rogers.com wrote:
>> >perl code seems much slower than awk code. For the same file size
>> >around 5M records, the awk takes only 1 min to loop to find the max
>> >value, the perl takes around 20 mins. Does perl slower than awk?
[snip]
>Here is the test code with result. test file generated by (perl -le
>'print rand for 1..5_000_000' > test.txt)
>$time awk -F'.' '{ if($2 > max) {max = $2;} } END{print max;}'
><test.txt
>999969482421875
>
>real 0m18.16s
>user 0m17.38s
>sys 0m0.18s
>
>$time perl -a -F'\.' -n -e '{ if($F[1] >$max) {$max=$F[1];} }
>END{print $max;}' test.txt
>999969482421875
>
>real 0m41.57s
>user 0m41.14s
>sys 0m0.16s
Well, indeed awk appears to be faster, but not in the same measure as
you hinted above. Anyway, this *does* surprise me, but not too much:
afaik awk is a specialized tool and Perl a full fledged language
(although one supposed to excel in the same areas).
>BTW, why the code below doesn't work?
>perl -a -F/\./ -n -e '{print $F[1], "\n";} ' test.txt
That should be -F'/\./' otherwise the dot gets quoted by the shell,
but perl will see the /./ pattern which is *not* what you want.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Sat, 05 May 2007 13:32:54 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Populating an array from a mysql select
Message-Id: <qaqo339hl4lqp0eo6uo91t0itsnkjgpfbd@4ax.com>
On 4 May 2007 13:47:01 -0700, Nikos <nikos1337@gmail.com> wrote:
> @titlelist = <FILE>;
You don't chomp() it. May that be your problem?
>i try to print popup_menu( -name=>'title' -values=>\@titlelist ) but
>it return nothing.
return?!?
However there's a syntax error in the above. May that be your problem?
>if i try to print @titlelist is filled though...
How do you check that?
The following seems to work, although it is an insane example:
#!/usr/bin/perl
use strict;
use warnings;
use CGI qw/:all/;
print popup_menu -name=>'title',
-values => do {
open my $f, '<', $0 or die "D'Oh! $!\n";
chomp(my @l=<$f>);
\@l;
};
__END__
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Sat, 05 May 2007 13:44:16 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Populating an array from a mysql select
Message-Id: <c0ro331fsnuut95l7mbg43h4sai5d9jjcq@4ax.com>
On 5 May 2007 00:46:16 -0700, Nikos <nikos1337@gmail.com> wrote:
>I read it that why i use a backslash before the array but stilll the
>array remains the same.
I read it that why... why... WHY?!? What?
Putting a backslash in front of an array will give you a reference to
it, but won't modify it in any way. Did you expect it would? Your
words may be interpreted in this sense. If so, then what gave you that
idea? What does it have to do with what we were discussing, anyway?
However I'm not expert at deciphering Linear A scripts. Who is, after
all?
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Sat, 05 May 2007 15:02:10 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Populating an array from a mysql select
Message-Id: <esvo331jgqm84ju39bas37te9qdqcsmct5@4ax.com>
On Sat, 05 May 2007 13:32:54 +0200, Michele Dondi
<bik.mido@tiscalinet.it> wrote:
>>i try to print popup_menu( -name=>'title' -values=>\@titlelist ) but
>>it return nothing.
>
>return?!?
>
>However there's a syntax error in the above. May that be your problem?
I'm wrong. There's a missing comma, but it doesn't give a syntax error
as I had naively assumed. "Of course" I realized that when reading the
discussion originating from the PM node at
http://perlmonks.org/?node_id=613689
to which the OP copied and pasted the same question asked here, almost
verbatim, but for a minimal formatting intervention. Without saying so
here. Without saying so there.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Sat, 5 May 2007 07:30:05 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Populating an array from a mysql select
Message-Id: <slrnf3ou6d.bao.tadmc@tadmc30.august.net>
Nikos <nikos1337@gmail.com> wrote:
> On May 5, 1:50 am, Tad McClellan <t...@augustmail.com> wrote:
>
>> For those of you playing along at home, Michele is
>> demonstrating "Use Rule 1" from:
>
>
> I read it
But not carefully enough...
> that why i use a backslash before the array
Errr, that is *Make* Rule 1 not "Use Rule 1".
"Make Rule 1" is about making a reference. (with a backslash)
"Use Rule 1" is about dereferencing a reference (with @{} ).
Which one you use depends on if you want to *make* a reference
or if you want to *use* a reference (after already having made one).
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 5 May 2007 07:28:24 -0700
From: Nikos <nikos1337@gmail.com>
Subject: Re: Populating an array from a mysql select
Message-Id: <1178375303.974254.253270@e65g2000hsc.googlegroups.com>
On May 5, 3:30 pm, Tad McClellan <t...@augustmail.com> wrote:
> Nikos <nikos1...@gmail.com> wrote:
> > On May 5, 1:50 am, Tad McClellan <t...@augustmail.com> wrote:
>
> >> For those of you playing along at home, Michele is
> >> demonstrating "Use Rule 1" from:
>
> > I read it
>
> But not carefully enough...
>
> > that why i use a backslash before the array
>
> Errr, that is *Make* Rule 1 not "Use Rule 1".
>
> "Make Rule 1" is about making a reference. (with a backslash)
>
> "Use Rule 1" is about dereferencing a reference (with @{} ).
>
> Which one you use depends on if you want to *make* a reference
> or if you want to *use* a reference (after already having made one).
>
> --
> Tad McClellan SGML consulting
> t...@augustmail.com Perl programming
> Fort Worth, Texas
i tried agian to post here but i failed.
------------------------------
Date: 5 May 2007 08:34:32 -0700
From: Nikos <nikos1337@gmail.com>
Subject: Select from drop down menu multipel times in the same form
Message-Id: <1178379272.638516.189790@w5g2000hsg.googlegroups.com>
#===============================================================================
my @titlelist;
open FILE, "<$ENV{'DOCUMENT_ROOT'}/data/vault/titlelist.txt" or die
$!;
@titlelist = <FILE>;
close FILE;
print br() x 5;
print start_form( action=>'/cgi-bin/admin.pl' );
print table( {class=>'user_form'},
Tr( td( {width=>'55%'}, 'Select items' ),
td( {width=>'35%'}, popup_menu( -name=>'title', -values=>
\@titlelist )),
td( {width=>'10%'}, submit('add'))),
Tr( td( 'Soemthign to remark on order' ),
td( {colspan=>2}, textarea( -name=>'remark', -rows=>6, -
columns=>35 ))),
Tr( td( 'ask for soemthing else if it snot listed on drop don
menu' ),
td( textfield( -name=>'request' )),
td( submit('request'))),
Tr( td( a( {href=>'/cgi-bin/show.pl?name=showbook'},
font( {size=>3, color=>'yellow'}, 'Change Order' ))),
td( {colspan=>2}, submit( 'Order!' )))
);
print hidden(-name=>'date', -value=>$date);
print hidden(-name=>'host', -value=>$host);
print end_form();
print br() x 5;
#===============================================================================
In the above code when user hits the "Add" button or the "request"
button i need it to get the user selection from frop down menu and
store it.
Its about selecting items to place and orer list, i want the user to
select many items form the drop down menu. And also to write its own
if he can t find somethign from the drop down menu and then hit
"Want".
How can i do it so the user hits those submits button so many times as
is the amount of items he wants? Where do i have to submit the form
to? to itself?
ps1. I edited it and wrote all the greek words to english ones. Also
corrected spelling errors.
ps2. Asked in PM as well but didnt got an answer.
------------------------------
Date: 5 May 2007 08:36:03 -0700
From: Nikos <nikos1337@gmail.com>
Subject: Re: Select from drop down menu multipel times in the same form
Message-Id: <1178379363.565558.210670@l77g2000hsb.googlegroups.com>
you can see how it looks if you visit my webpage at http://nikos.no-ip.org
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 V11 Issue 408
**************************************