[25366] in Perl-Users-Digest
Perl-Users Digest, Issue: 7611 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 6 06:05:45 2005
Date: Thu, 6 Jan 2005 03:05:22 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 6 Jan 2005 Volume: 10 Number: 7611
Today's topics:
Re: CGI.pm and special characters in hidden inputs <noreply@gunnar.cc>
Command or script to delete hidden files on ftp? <accura2k@gmail.com>
Re: Command or script to delete hidden files on ftp? (Anno Siegel)
Construct listbox with CGI <sam.wun@authtec.com>
Re: Construct listbox with CGI <sam.wun@authtec.com>
Re: Construct listbox with CGI <sam.wun@authtec.com>
Re: Construct listbox with CGI <sam.wun@authtec.com>
Deactivate a window in Perl::Tk? <josef.moellers@fujitsu-siemens.com>
Re: Deactivate a window in Perl::Tk? <postmaster@castleamber.com>
Re: Deactivate a window in Perl::Tk? <josef.moellers@fujitsu-siemens.com>
Re: FAQ 1.9: How does Perl compare with other languages <bik.mido@tiscalinet.it>
Re: For your christmas reading pleasure. <bik.mido@tiscalinet.it>
Re: Is there a web interface tool that can manage acco <uri@stemsystems.com>
Re: Is zero even or odd? <invalid@msgid.michael.mendelsohn.de>
Re: Is zero even or odd? <dak@gnu.org>
Re: Is zero even or odd? <dseaman@no.such.host>
Re: Line continuation in Perl <bik.mido@tiscalinet.it>
match regex split <89esprit@gmail.com>
Re: match regex split <noreply@gunnar.cc>
Need help in finding an efficient algorithm robertday5@gmail.com
Re: Need help in finding an efficient algorithm (Anno Siegel)
Re: Need help in finding an efficient algorithm <spamtrap@dot-app.org>
Re: Need help in finding an efficient algorithm (Anno Siegel)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 30 Dec 2004 13:34:33 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: CGI.pm and special characters in hidden inputs
Message-Id: <33ibhoF41uqi1U1@individual.net>
Alan J. Flavell wrote:
> Did/does CGI.pm really emit ' on its own initiative?
No, the escapeHTML() method in CGI.pm replaces ' with ' (but only
when the charset is ISO-8859-1 or WINDOWS-1252, if I understand it
correctly).
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 5 Jan 2005 21:32:11 -0800
From: "Jason Priest" <accura2k@gmail.com>
Subject: Command or script to delete hidden files on ftp?
Message-Id: <1104989531.754871.226920@c13g2000cwb.googlegroups.com>
is there a command or script I can run on my web site to clear out
hidden files in a directory, files that were accidently chmod' to not
appear?
------------------------------
Date: 6 Jan 2005 09:06:32 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Command or script to delete hidden files on ftp?
Message-Id: <criv2o$9pf$1@mamenchi.zrz.TU-Berlin.DE>
Jason Priest <accura2k@gmail.com> wrote in comp.lang.perl.misc:
> is there a command or script I can run on my web site to clear out
> hidden files in a directory, files that were accidently chmod' to not
> appear?
You are confused. "chmod" controls access permissions, it doesn't change
the visibility of files.
You probably want to find files whose name starts with a ".". Start with
looking up opendir, readdir, and unlink in perlfunc.
Anno
------------------------------
Date: Thu, 30 Dec 2004 18:16:51 +0800
From: sam <sam.wun@authtec.com>
Subject: Construct listbox with CGI
Message-Id: <cr0m4d$1a2o$1@news.hgc.com.hk>
Hi,
I need to use CGI to construct a listbox.
I m currently using OO style of CGI.
Does anyone got an example how to use CGI to build a listbox?
I need to submit the values in the listbox to another CGI form, that's
why I need the listbox to be constructed by CGI.
Thanks
Sam
------------------------------
Date: Thu, 30 Dec 2004 18:20:21 +0800
From: sam <sam.wun@authtec.com>
Subject: Re: Construct listbox with CGI
Message-Id: <cr0mav$1a2o$2@news.hgc.com.hk>
sam wrote:
> Hi,
>
> I need to use CGI to construct a listbox.
> I m currently using OO style of CGI.
> Does anyone got an example how to use CGI to build a listbox?
> I need to submit the values in the listbox to another CGI form, that's
> why I need the listbox to be constructed by CGI.
>
> Thanks
> Sam
I found it by looking up the CGI.pm file. It's name is scrolling_list if
I m correct.
Sam.
------------------------------
Date: Thu, 30 Dec 2004 18:51:23 +0800
From: sam <sam.wun@authtec.com>
Subject: Re: Construct listbox with CGI
Message-Id: <cr0o55$1b0c$1@news.hgc.com.hk>
sam wrote:
> Hi,
>
> I need to use CGI to construct a listbox.
> I m currently using OO style of CGI.
> Does anyone got an example how to use CGI to build a listbox?
> I need to submit the values in the listbox to another CGI form, that's
> why I need the listbox to be constructed by CGI.
>
Hi,
I have written the following CGI code, but the listbox does not insert
data to the listbox. These data is retrieved from the MySQL datasbase:
my $values = "";
my $lables = "";
while ($aref = $sth->fetchrow_arrayref){
$values .= $aref->[0].",";
$labels .= $aref->[0]." => " .
$aref->[1].":".$aref->[2].",";
}
print $query->scrolling_list(
-NAME => "Examples",
-VALUES => [ qw($values) ],
-LABELS => {$labels},
-SIZE => 3,
-MULTIPLE => 1, # 1 for true, 0 for false
);
When I execute this code, the listbox is inserted with the string
"$values" in the box instead of the values in the $values variable.
What s wrong with this code?
Thanks
Sam
------------------------------
Date: Thu, 30 Dec 2004 19:46:03 +0800
From: sam <sam.wun@authtec.com>
Subject: Re: Construct listbox with CGI
Message-Id: <cr0rbm$1cm2$1@news.hgc.com.hk>
sam wrote:
> sam wrote:
>
>> Hi,
>>
>> I need to use CGI to construct a listbox.
>> I m currently using OO style of CGI.
>> Does anyone got an example how to use CGI to build a listbox?
>> I need to submit the values in the listbox to another CGI form, that's
>> why I need the listbox to be constructed by CGI.
>>
> Hi,
>
> I have written the following CGI code, but the listbox does not insert
> data to the listbox. These data is retrieved from the MySQL datasbase:
>
> my $values = "";
> my $lables = "";
> while ($aref = $sth->fetchrow_arrayref){
> $values .= $aref->[0].",";
> $labels .= $aref->[0]." => " .
> $aref->[1].":".$aref->[2].",";
> }
>
> print $query->scrolling_list(
> -NAME => "Examples",
> -VALUES => [ qw($values) ],
> -LABELS => {$labels},
>
> -SIZE => 3,
> -MULTIPLE => 1, # 1 for true, 0 for false
> );
>
> When I execute this code, the listbox is inserted with the string
> "$values" in the box instead of the values in the $values variable.
>
> What s wrong with this code?
>
Hi,
I have changed the above code to the following, it nearly working as I
expected:
my @values;
my @lables;
my $i;
for ($i=0; $aref = $sth->fetchrow_arrayref; $i++){
$values[$i] = $aref->[0]; #custcode
$labels[$i] = $aref->[1]; #custname
}
print $query->scrolling_list(
-NAME => "Outlets",
-VALUES => [@values],
-LABELS => \%labels,
-SIZE => 9,
-MULTIPLE => 1,
);
However it inserted custcode to the listbox. I m expecting custnames on
the "label=" side of the listbox, and custcode is on the "value=" side
of the listbox.
How can I fix this error?
> Thanks
> Sam
------------------------------
Date: Thu, 06 Jan 2005 09:11:06 +0100
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Deactivate a window in Perl::Tk?
Message-Id: <crirm2$35d$1@nntp.fujitsu-siemens.com>
Hi,
I'm writing a small application which might require some action to be=20
performed before the main functionality can be used, e.g. the powering=20
on of some device. To alert the user, I create a new Toplevel window=20
with a message and some buttons (e.g. "Done", "Abort"). I'd like to=20
disable the main window until the user pressed any one of these buttons=20
(setting a global variable and destroy-ing the new Toplevel window). I=20
could, obviously, change the state of all buttons in the main window to=20
"disabled", but is there an easier way of disabling an entire window?
--=20
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett
------------------------------
Date: 6 Jan 2005 08:17:32 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: Deactivate a window in Perl::Tk?
Message-Id: <Xns95D617516D56Ecastleamber@130.133.1.4>
Josef Moellers wrote:
> Hi,
>
> I'm writing a small application which might require some action to be
> performed before the main functionality can be used, e.g. the powering
> on of some device. To alert the user, I create a new Toplevel window
> with a message and some buttons (e.g. "Done", "Abort"). I'd like to
> disable the main window until the user pressed any one of these buttons
> (setting a global variable and destroy-ing the new Toplevel window). I
> could, obviously, change the state of all buttons in the main window to
> "disabled", but is there an easier way of disabling an entire window?
http://www.google.com/search?q=perl+Tk+Modal
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: Thu, 06 Jan 2005 09:29:41 +0100
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: Deactivate a window in Perl::Tk?
Message-Id: <crisoo$9o5$1@nntp.fujitsu-siemens.com>
John Bokma wrote:
> Josef Moellers wrote:
>=20
>=20
>>Hi,
>>
>>I'm writing a small application which might require some action to be=20
>>performed before the main functionality can be used, e.g. the powering =
>>on of some device. To alert the user, I create a new Toplevel window=20
>>with a message and some buttons (e.g. "Done", "Abort"). I'd like to=20
>>disable the main window until the user pressed any one of these buttons=
=20
>>(setting a global variable and destroy-ing the new Toplevel window). I =
>>could, obviously, change the state of all buttons in the main window to=
=20
>>"disabled", but is there an easier way of disabling an entire window?
>=20
>=20
> http://www.google.com/search?q=3Dperl+Tk+Modal=20
Thanks, That's what I needed.
--=20
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett
------------------------------
Date: Thu, 30 Dec 2004 15:04:42 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: FAQ 1.9: How does Perl compare with other languages like Java, Python, REXX, Scheme, or Tcl?
Message-Id: <1ts7t0lcj68u5kja0nmg6k9r3bvhfv0lv0@4ax.com>
On Wed, 29 Dec 2004 22:47:06 GMT, Gerald Meazell <gmeazell@swbell.net>
wrote:
>I'm just getting started with Perl but have extensive knowledge of REXX.
> If you'd like me to write a comparison, I'd be happy to do that. Let
>me know.
Only, I recommend being careful and waiting to be well acquinted with
perl at least somewhat beyond the "I'm just getting started with
Perl"-level.
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: Thu, 30 Dec 2004 15:04:39 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: For your christmas reading pleasure.
Message-Id: <g6o7t097d74lahfl33pdchddoi7omr6ttp@4ax.com>
On Tue, 28 Dec 2004 22:53:11 +0100, David Kastrup <dak@gnu.org> wrote:
>Michele Dondi <bik.mido@tiscalinet.it> writes:
>
>> So the question/hint for a discussion is this: could Perl6 -still
>> *hypothetically* speaking- be the base for the implementation of a
>> modern TeX successor?
>
>Shrug. There is no particular advantage making Perl particularly
Well it's well suited for text processing. Perl5 is already able to do
a decent job in this sense: even if basic regular expressions (even
taking into account extended patterns) are not well suited to match
e.g. balanced text, it can be parsed by means of Text::Balanced. And
there are dedicated modules for dealing with xml, for example. And
there's Parse::RecDescent. Of course TeX is a whole another thing.
This is why I thought of Perl6.
>suited to the task: the list data structures are not particularly
Why?!?
>suited to Perl, the stuff Perl offers for parsing and scanning is not
>well-suited for TeX, the main control structures and concepts in TeX
>(optimization and parallel execution, which are mostly hard-coded in
>current TeX) don't map well to Perl and would still require mostly
>hard-coding.
So what? Perl already supports binary extensions. Rumors have it that
creating such extensions will be much easier under Perl6.
Perl6 development is twofold: on the one hand you have the design of a
new language (new syntax, new semantic, new features), different from
the current one but similar enough to allow for automatic translation,
and on the other one you have the runtime environment (Parrot[*], see
<http://www.parrotcode.org>). Other rumors have it that Parrot will be
able to run natively bytecode for other virtual machines, including
Java, for example. Which is good news IMO!
>In short: there is nothing that would particularly recommend Perl.
Certainly it would be better suited than other languages.
>Add to that the fact that Perl is a _huge_ complex system that tends
>to get replaced every few years, I don't see why one would want to
>base a large code base with a _much_ longer shelf life on it.
This is a good point! Not exactly as in your words, but somewhat like
that. I don't know how things will be like for Perl6: of course I
can't know, since not only it doesn't exist yet, but it won't even
exist for quite a lot of time too. However much care is being taken
exactly to make it stable enough from scratch, although 6.0 may
resonably enough lack some of the most exotic features.
>Of _course_ you could make Perl6 the base for the implementation of
>some successor. It is a programming language, after all. But I don't
>see why anyone would want to do that.
Other than I love it? Well, as I said I think that even in its current
version it could be better suited than some other languages. But the
few things I know of Perl6, having the patience of waiting for hell to
freeze, suggest me that it will be *particularly* well suited. That is
just MHO, anyway...
[*] Designed to be the basis, as a virtual machine, not only for Perl6
but for quite a lot of other languages as well. Ponie is a project to
port Perl5 to parrot.
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: Thu, 06 Jan 2005 05:14:53 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Is there a web interface tool that can manage accounts of FreeBSD and Windows 2003 server simultaneously
Message-Id: <x7u0pvi1fb.fsf@mail.sysarch.com>
and your perl question is?
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Thu, 30 Dec 2004 10:18:33 +0100
From: Michael Mendelsohn <invalid@msgid.michael.mendelsohn.de>
Subject: Re: Is zero even or odd?
Message-Id: <41D3C7E9.46C9D111@msgid.michael.mendelsohn.de>
vonroach wrote:
> meaningless.
vonroach spent 20 minutes writing 12 one-liners.
This classifies him as "baby troll".
Kudos on the content snipping,
it takes time but really helps fool some people.
Cheers
Michael
--
Still an attentive ear he lent Her speech hath caused this pain
But could not fathom what she meant Easier I count it to explain
She was not deep, nor eloquent. The jargon of the howling main
-- from Lewis Carroll: The Three Usenet Trolls
------------------------------
Date: Thu, 30 Dec 2004 11:20:56 +0100
From: David Kastrup <dak@gnu.org>
Subject: Re: Is zero even or odd?
Message-Id: <x5ekh884tz.fsf@lola.goethe.zz>
"Mark J. Tilford" <tilford@ugcs.caltech.edu> writes:
> On Wed, 29 Dec 2004 20:31:32 +0100, David Kastrup <dak@gnu.org> wrote:
>> John Woodgate <jmw@jmwa.demon.contraspam.yuk> writes:
>>
>>> David Kastrup <dak@gnu.org> wrote:
>>>>
>>>>It gives us, for example,
>>>>1 = 0/0 = (0+0)/0 = (0/0) + (0/0) = 2
>>>
>>> 0/0 can't be *defined* as 1 because, as has been repeatedly
>>> demonstrated, that definition results in contradictions, such as the
>>> one illustrated above.
>>>
>>> The only definition that does not result in contradictions is that
>>> 0/0 is 'any number'. 1 is just one solution.
>>
>> It does not result in contradictions? Since when?
>>
>> any number = 0/0 = (2*0)/0 = 2*(0/0) = 2*any number = any even number
>>
>
> Any number, not any integer.
any number = 0/0 = (0/0)^(-1) = any number except 0 (since 0 is not
the inverse of any number).
So 0 is not a number?
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
------------------------------
Date: Thu, 30 Dec 2004 14:52:43 +0000 (UTC)
From: Dave Seaman <dseaman@no.such.host>
Subject: Re: Is zero even or odd?
Message-Id: <cr14nr$6th$1@mailhub227.itcs.purdue.edu>
On Wed, 29 Dec 2004 23:31:10 -0800, Alfred Z. Newmane wrote:
> Dave Seaman wrote:
>>
>> I rely on the mathematical arguments I have previously posted with
>> references to recognized authoritative authors (Suppes, Lang, and the
>> sci.math FAQ).
> Just a minor nit pick, not meaning to sound anal, but I find it hard to
> accept a news group's FAQ as a concret authority of Math. It may be an
> authority of the nes group it elf (guidelines, etc), and maybe perhaps,
> since you're refering to a math news group, it can hold some weight in
> FAQ questions, it cannot possibly take presidence over publichsed and
> fully accepted documents.
That might be relevant if the FAQ contradicted the other sources, but it
doesn't. It also contains additional references.
--
Dave Seaman
Judge Yohn's mistakes revealed in Mumia Abu-Jamal ruling.
<http://www.commoncouragepress.com/index.cfm?action=book&bookid=228>
------------------------------
Date: Thu, 30 Dec 2004 15:04:41 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Line continuation in Perl
Message-Id: <vks7t01l56b1dt7ta89300jv4c23ohupq1@4ax.com>
On 29 Dec 2004 20:36:57 GMT, Abigail <abigail@abigail.nl> wrote:
>-: things. OTOH you will be able to modify the grammar the way you like
>-: most, which is not that bad after all. (And I bet you will do, BTW!)
[snip]
>Beside that I don't think it's going to be feasable to change such
>significant parsing rules, I don't think it's a smart thing to do, even
>if it's possible. If every one is going to create his/her language, with
>significant different syntax, it's going to be very hard to cooperate.
>Would you want to maintain programs where every author used his/her
>language? Would you bother producing patches for CPAN modules if every
>author used his/her own language?
This is a serious concern many people share with you. But somehow it
surprises me that you're concerned in the first place, as I though you
were rather inclined to apply patches to current perls and I remember
you wrote quite a few articles about portability not being a thing
about which to be just as mad as some people are.
>But then, my retirement will be in less than 25 years. I don't expect
>perl6 to ship before 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: 5 Jan 2005 20:09:21 -0800
From: "MisterX" <89esprit@gmail.com>
Subject: match regex split
Message-Id: <1104982495.909590.55010@c13g2000cwb.googlegroups.com>
OK, I've tried googling, reading many perl books, but some things I
just dont get.
The problem: Parsing a simple backup.log. Below are the lines that I
need to extract. Note the leading space on the 1st line:
Server date/time: 01/03/05 20:05:57 Last access: 01/02/05
20:06:25
Total number of bytes transferred: 27.42 GB
Elapsed processing time: 01:04:07
The script thus far:
while (<LOGFILE>)
{
if ($_=~/Server date/ || /Total number of bytes/ || /Elapsed
processing time/ || /Elapsed processing time/)
{
($_=~ s/^\s+//);
print $_;
}
}
====================
Preferably I'd like it formatted (printf I suppose) nicely.
I know it's not pretty, what can i say I'm a noob. Any help is VERY
appreciated.
------------------------------
Date: Thu, 06 Jan 2005 06:43:02 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: match regex split
Message-Id: <3441tbF3kd2qsU1@individual.net>
MisterX wrote:
> OK, I've tried googling, reading many perl books,
Which books did you read?
> but some things I just dont get.
>
> The problem: Parsing a simple backup.log.
I think there is another problem: Your description of what the problem
is is insufficient. A problem description should (at least) include the
program output and how that differs from the expected and/or desired output.
> Below are the lines that I
> need to extract. Note the leading space on the 1st line:
There is no leading space below (but that may be Google's fault).
> Server date/time: 01/03/05 20:05:57 Last access: 01/02/05 20:06:25
> Total number of bytes transferred: 27.42 GB
> Elapsed processing time: 01:04:07
>
> The script thus far:
>
> while (<LOGFILE>)
> {
> if ($_=~/Server date/ || /Total number of bytes/ || /Elapsed
> processing time/ || /Elapsed processing time/)
> {
> ($_=~ s/^\s+//);
> print $_;
> }
> }
That script seems to do what you reasonably can expect it to do, i.e. it
prints those three lines.
What would you want it to do?
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 6 Jan 2005 01:12:12 -0800
From: robertday5@gmail.com
Subject: Need help in finding an efficient algorithm
Message-Id: <1105002732.219847.315530@f14g2000cwb.googlegroups.com>
Need help in finding an efficient algorithm for the following problem.
There are tasks which have predecessor tasks which needs to be
completed before taking up the new task.
Our aim is to find the required order of the tasks, so that the
pre-requisite tasks are always completed before the task.
For example
TaskA needs taskJ and taskK
TaskB needs none
TaskC needs TaskA, taskK
taskD needs taskB
taskJ needs taskB
taskK needs none
There is no cyclical dependency and all the tasks take same amount of
time
A valid answer can be
taskB
taskK
taskJ
taskD
taskC
taskA
------------------------------
Date: 6 Jan 2005 09:32:19 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Need help in finding an efficient algorithm
Message-Id: <crj0j3$9pf$2@mamenchi.zrz.TU-Berlin.DE>
<robertday5@gmail.com> wrote in comp.lang.perl.misc:
> Need help in finding an efficient algorithm for the following problem.
> There are tasks which have predecessor tasks which needs to be
> completed before taking up the new task.
> Our aim is to find the required order of the tasks, so that the
> pre-requisite tasks are always completed before the task.
> For example
>
> TaskA needs taskJ and taskK
> TaskB needs none
> TaskC needs TaskA, taskK
> taskD needs taskB
> taskJ needs taskB
> taskK needs none
>
> There is no cyclical dependency and all the tasks take same amount of
> time
>
> A valid answer can be
> taskB
> taskK
> taskJ
> taskD
> taskC
> taskA
Google for "topological sort". I think there is a CPAN module for that,
but it must be named differently.
Anno
------------------------------
Date: Thu, 06 Jan 2005 04:40:20 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Need help in finding an efficient algorithm
Message-Id: <afKdnSacheoYmkDcRVn-gw@adelphia.com>
Anno Siegel wrote:
> I think there is a CPAN module for that,
Yep!
Sort::Topological
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: 6 Jan 2005 10:35:48 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Need help in finding an efficient algorithm
Message-Id: <crj4a4$dko$2@mamenchi.zrz.TU-Berlin.DE>
Sherm Pendley <spamtrap@dot-app.org> wrote in comp.lang.perl.misc:
> Anno Siegel wrote:
>
> > I think there is a CPAN module for that,
>
> Yep!
>
> Sort::Topological
That's what I thought I searched for, but didn't find it. Now I do.
Well, "topological" is hard to type :)
Anno
------------------------------
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 V10 Issue 7611
***************************************