[32395] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 3662 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 11 09:09:34 2012

Date: Wed, 11 Apr 2012 06:09:10 -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           Wed, 11 Apr 2012     Volume: 11 Number: 3662

Today's topics:
    Re: f python? <rweikusat@mssgmbh.com>
    Re: f python? <rweikusat@mssgmbh.com>
    Re: f python? (Seymour J.)
    Re: f python? (Seymour J.)
    Re: f python? <bc@freeuk.com>
    Re: f python? <rweikusat@mssgmbh.com>
    Re: f python? <w_a_x_man@yahoo.com>
        Help with pattern matching <artmerar@yahoo.com>
    Re: Help with pattern matching <NoSpamPleaseButThisIsValid3@gmx.net>
    Re: Help with pattern matching <justin.1203@purestblue.com>
    Re: Help with pattern matching <ben@morrow.me.uk>
    Re: Help with pattern matching <NoSpamPleaseButThisIsValid3@gmx.net>
        Help with perl special variable <riccardo.marini@gmail.com>
    Re: Missing utf8_heavy.pl <jimoeDESPAM@sohnen-moe.com>
    Re: Missing utf8_heavy.pl <jimoeDESPAM@sohnen-moe.com>
    Re: Missing utf8_heavy.pl <ben@morrow.me.uk>
    Re: Missing utf8_heavy.pl <ben@morrow.me.uk>
    Re: New module name (Eclipse::PHPMe) <ben@morrow.me.uk>
    Re: pairs to tree <ben@morrow.me.uk>
    Re: pairs to tree <marc.girod@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Mon, 09 Apr 2012 21:20:27 +0100
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: f python?
Message-Id: <87vcl81wtw.fsf@sapphire.mobileactivedefense.com>

Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid> writes:

[...]

>>For one thing, if s is a non-empty null terminated string then,
>>cdr(s) is also a string representing the rest of that string 
>>without the first character,
>
> Are you really too clueless to differentiate between C and LISP?

In LISP, a list is a set of conses (pairs) whose car (first element of
the pair) contains a value and whose cdr (second element of the pair)
links to the next cons that's part of the list. The end of a list is
marked by a cdr whose value is nil. A so-called 'C string' is a
sequentially allocated sequence of memory locations which contain the
characters making up the string and the end of it is marked by a
memory location holding the value 0. This is logically very similar
to the LISP list and it shouldn't be to difficult to understand that
'cdr(s) is also a string representing the rest of the string' means
'given that s points to a non-empty C string, s + 1 points to a
possibly empty C string which is identical with s with the first
character removed'. 

>>Null terminated strings have simplified all kids of text
>>manipulation, lexical scanning, and data storage/communication 
>>code resulting in immeasurable savings over the years.
>
> Yeah, especially code that needs to deal with lengths and nulls. It's
> great for buffer overruns too.

This is, I think, a case where the opinions of people who have used C
strings and the opinions of people who haven't differ greatly. A nice
German proverb applicable to situations like that would be 'Was der
Bauer nicht kennt das frisst er nicht' ...


------------------------------

Date: Mon, 09 Apr 2012 21:44:14 +0100
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: f python?
Message-Id: <87r4vw1vq9.fsf@sapphire.mobileactivedefense.com>

Rainer Weikusat <rweikusat@mssgmbh.com> writes:
> Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid> writes:
>
> [...]
>
>>>For one thing, if s is a non-empty null terminated string then,
>>>cdr(s) is also a string representing the rest of that string 
>>>without the first character,
>>
>> Are you really too clueless to differentiate between C and LISP?
>
> In LISP, a list is a set of conses (pairs) whose car (first element of
> the pair) contains a value and whose cdr (second element of the pair)
> links to the next cons that's part of the list. The end of a list is
> marked by a cdr whose value is nil.

Addition: This can also be implemented very neatly in Perl by using
two element array references as 'cons cells', toy example

-----------
sub car
{
    return $_[0][0];
}

sub cdr
{
    return $_[0][1];
}

sub list
{
    @_ && [shift, &list];
}

$l = list(0 .. 100);
while ($l) {
    print(car($l), ' ');
    $l = cdr($l);
}
print("\n");
-----------

and for algorithms which are well-suited for linked lists, this can
even outperform (when suitably implemented) an equivalent algorithm
using arrays.


------------------------------

Date: Tue, 10 Apr 2012 06:52:47 -0400
From: Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid>
Subject: Re: f python?
Message-Id: <4f8410ff$2$fuzhry+tra$mr2ice@news.patriot.net>

In <20120409111329.694@kylheku.com>, on 04/09/2012
   at 06:55 PM, Kaz Kylheku <kaz@kylheku.com> said:

>Null-terminated C strings do the same thing.

C arrays are not LISP strings; there is no C analog to car and cdr.

>Code that needs to deal with null "characters" is manipulating
>binary data, not text,

That's a C limitation, not a characteristic of text. It is certainly
not true in languages unrelated to C, e.g., Ada, Algol 60, PL/I.

>If we scan for a null terminator which is not there, we have a
>buffer overrun.

You're only thinking of scanning an existing string; think of
constructing a string. The null only indicates the current length, not
the amount allocated.

>If a length field in front of string data is incorrect, we also have
>a buffer overrrun.

The languages that I'm aware of that use a string length field also
use a length field for the allocated storage. More precisely, they
require that attempts to store beyond the allocated length be
detected.

-- 
Shmuel (Seymour J.) Metz, SysProg and JOAT  <http://patriot.net/~shmuel>

Unsolicited bulk E-mail subject to legal action.  I reserve the
right to publicly post or ridicule any abusive E-mail.  Reply to
domain Patriot dot net user shmuel+news to contact me.  Do not
reply to spamtrap@library.lspace.org



------------------------------

Date: Tue, 10 Apr 2012 06:58:47 -0400
From: Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid>
Subject: Re: f python?
Message-Id: <4f841267$3$fuzhry+tra$mr2ice@news.patriot.net>

In <87vcl81wtw.fsf@sapphire.mobileactivedefense.com>, on 04/09/2012
   at 09:20 PM, Rainer Weikusat <rweikusat@mssgmbh.com> said:

>This is logically very similar to the LISP list 

FSVO similar.

>This is, I think, a case where the opinions of people who have used
>C strings and the opinions of people who haven't differ greatly.

You would be wrong. It is a case where the opinions of people who are
oriented to a particular language and the opinions of people who have
lost count of the languages they have used greatly differ.

-- 
Shmuel (Seymour J.) Metz, SysProg and JOAT  <http://patriot.net/~shmuel>

Unsolicited bulk E-mail subject to legal action.  I reserve the
right to publicly post or ridicule any abusive E-mail.  Reply to
domain Patriot dot net user shmuel+news to contact me.  Do not
reply to spamtrap@library.lspace.org



------------------------------

Date: Tue, 10 Apr 2012 20:55:01 +0100
From: "BartC" <bc@freeuk.com>
Subject: Re: f python?
Message-Id: <jm239n$4vs$1@dont-email.me>

"Shmuel (Seymour J.)Metz" <spamtrap@library.lspace.org.invalid> wrote in 
message news:4f8410ff$2$fuzhry+tra$mr2ice@news.patriot.net...
> In <20120409111329.694@kylheku.com>, on 04/09/2012
>   at 06:55 PM, Kaz Kylheku <kaz@kylheku.com> said:

>>If we scan for a null terminator which is not there, we have a
>>buffer overrun.
>
> You're only thinking of scanning an existing string; think of
> constructing a string. The null only indicates the current length, not
> the amount allocated.
>
>>If a length field in front of string data is incorrect, we also have
>>a buffer overrrun.
>
> The languages that I'm aware of that use a string length field also
> use a length field for the allocated storage. More precisely, they
> require that attempts to store beyond the allocated length be
> detected.

I would have thought trying to *read* beyond the current length would be an
error.

Writing beyond the current length, and perhaps beyond the current allocation
might be OK if the string is allowed grow, otherwise that's also an error.

In any case, there is no real need for an allocated length to be passed
around with the string, if you are only going to be reading it, or only
modifying the existing characters. And depending on the memory management
arrangements, such a length need not be stored at all.

-- 
Bartc
 



------------------------------

Date: Tue, 10 Apr 2012 21:10:39 +0100
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: f python?
Message-Id: <87wr5nl54w.fsf@sapphire.mobileactivedefense.com>

Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid> writes:
> In <20120409111329.694@kylheku.com>, on 04/09/2012
>    at 06:55 PM, Kaz Kylheku <kaz@kylheku.com> said:
>
>>Null-terminated C strings do the same thing.
>
> C arrays are not LISP strings; there is no C analog to car and cdr.

'car' and 'cdr' refer to cons cells in Lisp, not to strings. How the
first/rest terminology can be sensibly applied to 'C strings' (which
are similar to linked-lists in the sense that there's a 'special
termination value' instead of an explicit length) was already
explained elsewhere.


------------------------------

Date: 11 Apr 2012 10:55:12 GMT
From: "WJ" <w_a_x_man@yahoo.com>
Subject: Re: f python?
Message-Id: <jm3nug023a@enews1.newsguy.com>

Xah Lee wrote:

> 
> so recently i switched to a Windows version of python. Now, Windows
> version takes path using win backslash, instead of cygwin slash. This
> fucking broke my find/replace scripts that takes a dir level as input.
> Because i was counting slashes.

Slashes can work under windows, up to a point:

C:\>cd info/source

C:\info\source>


Also, most languages I use under windows allow you to use
slashes in paths:

C:\>ruby -e "puts IO.read( 'c:/info/frag' )"
275439
109999
102972
109999
102972
110000
102972
109999

101085
108111


------------------------------

Date: Tue, 10 Apr 2012 19:15:58 -0700 (PDT)
From: ExecMan <artmerar@yahoo.com>
Subject: Help with pattern matching
Message-Id: <aacc7338-e8b9-4f6d-b4e8-c818d6675fae@fw28g2000vbb.googlegroups.com>

Hi,

I have a file containing URL's, and I am trying to scan a log and get
a count of the matching string.  But, I think because the input
contains slashes I am not getting a match.   Any help please??  I'm
pretty new to this:

#!/usr/bin/perl
open (FILE,"monday.csv") or die $!;
while(<FILE>) {
  chomp($_);
  ($tag, $url) = split(',', $_);
  $url_tags{$tag} = $url;
  $url_counts{$tag} = 0;
}
close(FILE);

open (FILE,"<","/home/httpdlogs/apache2/access_log") or die "Can't
open apache log!";
foreach $tag (keys(%url_tags)) {
  $url = $url_tags{$tag};
  $count = grep { /$url/ } <FILE>;
  $url_counts{$tag} = $count;
}
close(FILE);

The $url contains slashes, how can I get around this??



------------------------------

Date: Wed, 11 Apr 2012 11:21:28 +0200
From: Wolf Behrenhoff <NoSpamPleaseButThisIsValid3@gmx.net>
Subject: Re: Help with pattern matching
Message-Id: <4f854d18$0$7609$9b4e6d93@newsspool1.arcor-online.net>

Am 11.04.2012 04:15, schrieb ExecMan:
> Hi,
> 
> I have a file containing URL's, and I am trying to scan a log and get
> a count of the matching string.  But, I think because the input
> contains slashes I am not getting a match.   Any help please??  I'm
> pretty new to this:
> 
> #!/usr/bin/perl
> open (FILE,"monday.csv") or die $!;

Prefer using the open with three arguments (as done for access_log).
Also, the FILE handle is global -> better use a "normal" variable here
(my $FILE).

> while(<FILE>) {
>   chomp($_);
>   ($tag, $url) = split(',', $_);
>   $url_tags{$tag} = $url;
>   $url_counts{$tag} = 0;
> }
> close(FILE);
> 
> open (FILE,"<","/home/httpdlogs/apache2/access_log") or die "Can't
> open apache log!";
> foreach $tag (keys(%url_tags)) {
>   $url = $url_tags{$tag};
>   $count = grep { /$url/ } <FILE>;

Two problems in this line:
a) problem with the regular expression. You probably don't want to match
a regexp here but test if $url is contained in file? Then use /\Q$url/ -
read what \Q does in perldoc perlre.

b) grep reads the whole file. After reading the whole file, any attempt
to read more reads nothing because you are already at the end of the
file. So the foreach loop can only return results the first time the
loop is started. Two solutions:
b1) read the whole file into an array @access_log before the foreach
loop. In the loop, use @access_log instead of <FILE>.
b2) read the file line by line and execute the foreach loop for every
line. Then of course you need to add the $count to %url_count.

- Wolf



------------------------------

Date: Wed, 11 Apr 2012 10:51:51 +0100
From: Justin C <justin.1203@purestblue.com>
Subject: Re: Help with pattern matching
Message-Id: <nq0g59-hs5.ln1@zem.masonsmusic.co.uk>

On 2012-04-11, ExecMan <artmerar@yahoo.com> wrote:

[snip]

>   $count = grep { /$url/ } <FILE>;
>
> The $url contains slashes, how can I get around this??

Don't use / as a regex delimiter. See perlretut and search for
'delimiters'.

   Justin.

-- 
Justin C, by the sea.


------------------------------

Date: Wed, 11 Apr 2012 11:11:50 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Help with pattern matching
Message-Id: <602g59-vc61.ln1@anubis.morrow.me.uk>


Quoth ExecMan <artmerar@yahoo.com>:
> 
> I have a file containing URL's, and I am trying to scan a log and get
> a count of the matching string.  But, I think because the input
> contains slashes I am not getting a match.   Any help please??  I'm
> pretty new to this:
> 
> #!/usr/bin/perl
> open (FILE,"monday.csv") or die $!;
> while(<FILE>) {
>   chomp($_);
>   ($tag, $url) = split(',', $_);
>   $url_tags{$tag} = $url;
>   $url_counts{$tag} = 0;
> }
> close(FILE);
> 
> open (FILE,"<","/home/httpdlogs/apache2/access_log") or die "Can't
> open apache log!";
> foreach $tag (keys(%url_tags)) {
>   $url = $url_tags{$tag};
>   $count = grep { /$url/ } <FILE>;

The slashes are not the problem. Perl isn't like shell, which expands
variable before doing word splitting: perl finds the end of /$url/ at
compile time, before it knows whether $url will contain slashes or not.

You have two problems here. The first and most obvious is that <FILE>,
in list context, reads the file to the end, breaks it into lines, and
*leaves the file pointer at the end of the file*. That means that next
time round the loop, the file pointer is already at the end, and <FILE>
returns the empty list.

There are several ways to fix this. The simplest is to read the file
once into an array, and run the grep over the array instead:

    open (FILE, "<", "/...") or die ...;
    @log = <FILE>;
    close FILE;

    foreach $tag (keys(%url_tags)) {
        $url = $url_tags{$tag};
        $count = grep { /$url/ } @log;
        ...
    }

(I'm deliberately omitting several important correction to that code
I'll mention below, so you can see which changes are relevant here.)

The second problem is that while perl looks for the closing slash before
interpolation $url, it looks for regex metacharacters afterwards. This
means that if one of your URLs contains, say, '+', perl will interpret
it as a 'match at least once' pattern character. To fix this you need
the \Q escape, which says 'quote everything from here until \E':

    $count = grep { /\Q$url/ } @log;

Some more general remarks:

You don't appear to be using 'warnings' or 'strict'. Until you know
enough to know better, start *every* Perl program with

    use warnings;
    use strict;

This will then start yelling at you about 'Global symbol requires
explicit package name': this means you need to go through and declare
all your variables with 'my'. The point of this is that it makes it much
less likely you'll reuse a variable without meaning to by mistake, or
that you'll misspell a variable name and get a completely new variable
with no warning. 

You should also be keeping your filehandles in 'my' variables, for the
same reason. As your program gets longer, it becomes increasingly likely
you will use FILE for something else somewhere else, and you'll get a
mess. 'my' variables aren't visible outside the block they're declared
in, so that can't happen.

If that file 'monday.csv' is actually CSV, generated from some other
program, you can't safely parse it like that. CSV has (rather
ill-defined) quoting rules, to allow entries to contain ',', and a lot
of programs randomly quote CSV when they didn't really need to. Reading
it is a lot harder than it seems, and you should use a module from CPAN,
such as Text::CSV.

Ben



------------------------------

Date: Wed, 11 Apr 2012 15:05:05 +0200
From: Wolf Behrenhoff <NoSpamPleaseButThisIsValid3@gmx.net>
Subject: Re: Help with pattern matching
Message-Id: <4f858182$0$6630$9b4e6d93@newsspool2.arcor-online.net>

Am 11.04.2012 11:51, schrieb Justin C:
> On 2012-04-11, ExecMan <artmerar@yahoo.com> wrote:
> 
> [snip]
> 
>>   $count = grep { /$url/ } <FILE>;
>>
>> The $url contains slashes, how can I get around this??
> 
> Don't use / as a regex delimiter. See perlretut and search for
> 'delimiters'.

What is wrong with / as delimiter?

- Wolf



------------------------------

Date: Wed, 11 Apr 2012 05:30:23 -0700 (PDT)
From: Ricky <riccardo.marini@gmail.com>
Subject: Help with perl special variable
Message-Id: <bc92244a-e300-4a5d-aeb3-f8f416fcb0b4@x17g2000yqj.googlegroups.com>

Hi gurus,
I m reading a regexp and a string from an external file (actually my
program configuration file).
After, I need to do a string matching, using previously loaded regex,
and print the "destination" result, using special variable $2,
hardcoded in my conf.

I have no luck..please give me some hints:

Here is my configuration line:

rule       (^.*blabla-dir/blabla-file/)(.*$)       /somedirectory/
somefile/$2     LABEL

perl code extract:
 ...
        /(^rule)\s+(.[^\s]+)\s+([\/\w\$]+)\s+(\w+)/
       $regex[$i]=$2;
       $destination[$i]=$3;
 ..
 ..
       $_="/blabla-dir/blabla-file/OIAC-ciao";
       if ( /$regex[$i]/ ) {
           print "$destination[$i]\n";
        }
 ..

The print only show:
/somedir/somepath/$2
but I need to "explode" that $2. Note that if i modify the print as
follows:

 print "$2 $destination[$i]\n";

it returns:
OIAC-ciao /somedir/somepath/$2

I'm sure there is a way to do this..but I am a noob programmer

Thanks,
perlnoob




------------------------------

Date: Tue, 10 Apr 2012 11:54:14 -0700
From: James Moe <jimoeDESPAM@sohnen-moe.com>
Subject: Re: Missing utf8_heavy.pl
Message-Id: <nbGdnToM5-tFHBnSnZ2dnUVZ5oqdnZ2d@giganews.com>

On 04/09/2012 11:17 AM, Peter J. Holzer wrote:
> 
> Hard to say from a distance. You could try strace to check what it is
> really doing.
> 
> Preferrably with a simple script like this:
> 
> 
> #!/usr/bin/perl
> use warnings;
> use strict;
> use utf8;
> use 5.010;
> 
> binmode STDOUT, ":encoding(UTF-8)";
> 
> my $s = "Käsefüße";
> 
> say    $s;
> say lc $s;
> say uc $s;
> __END__
> 
  Okay, I tried this on the target system. And it works without a hitch.
  One thing that just occurred to me is that the app in question runs in
a chroot. Could that cause this problem?

-- 
James Moe
jmm-list at sohnen-moe dot com


------------------------------

Date: Tue, 10 Apr 2012 13:10:21 -0700
From: James Moe <jimoeDESPAM@sohnen-moe.com>
Subject: Re: Missing utf8_heavy.pl
Message-Id: <x9GdndhH4dQtDhnSnZ2dnUVZ5rqdnZ2d@giganews.com>

On 04/08/2012 11:49 AM, James Moe wrote:
> Hello,
>   perl v5.14.2
>   assp v1.7.5.7 (yes, it is old)
>   opensuse v12.1
> 
>   ASSP = anti-spam smtp proxy, a bayesian spam filter.
>   I attempted to move ASSP from a server that was running perl v5.8.6 to
> another server. After installing and configuring, all attempts to send
> mail result in this error:
> 
> "Mainloop: Can't locate utf8_heavy.pl in @INC"
> 
>   How do I resolve this problem?
> 
  I have the reason for this odd behavior: The application is running as
a daemon in a chroot jail.
  Is there a recommended way to point to the actual perl installation
from inside chroot?


-- 
James Moe
jmm-list at sohnen-moe dot com


------------------------------

Date: Tue, 10 Apr 2012 23:39:49 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Missing utf8_heavy.pl
Message-Id: <lepe59-03d.ln1@anubis.morrow.me.uk>


Quoth James Moe <jimoeDESPAM@sohnen-moe.com>:
> >
[cannot find utf8_heavy.pl]
> > 
>   Okay, I tried this on the target system. And it works without a hitch.
>   One thing that just occurred to me is that the app in question runs in
> a chroot. Could that cause this problem?

Yes, obviously. If you want to run a program chrooted you need to put
*everything* it needs inside the chroot: for a Perl program, that
basically includes the whole of the core perl installation.

Ben



------------------------------

Date: Tue, 10 Apr 2012 23:43:31 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Missing utf8_heavy.pl
Message-Id: <jlpe59-03d.ln1@anubis.morrow.me.uk>


Quoth James Moe <jimoeDESPAM@sohnen-moe.com>:
> On 04/08/2012 11:49 AM, James Moe wrote:
> > Hello,
> >   perl v5.14.2
> >   assp v1.7.5.7 (yes, it is old)
> >   opensuse v12.1
> > 
> >   ASSP = anti-spam smtp proxy, a bayesian spam filter.
> >   I attempted to move ASSP from a server that was running perl v5.8.6 to
> > another server. After installing and configuring, all attempts to send
> > mail result in this error:
> > 
> > "Mainloop: Can't locate utf8_heavy.pl in @INC"
> > 
> >   How do I resolve this problem?
> > 
>   I have the reason for this odd behavior: The application is running as
> a daemon in a chroot jail.
>   Is there a recommended way to point to the actual perl installation
> from inside chroot?

You can't, by design. That's the whole point of chroot: that you can't
get out. (Actually, you can, sometimes, but only on OSes that have a
buggy chroot implementation.)

You may be able to hack something up with null mounts (IIRC Linux spells
that 'mount --bind'), but nowadays you'd probably be better recommended
to just stick the app on its own virtual server.

Ben



------------------------------

Date: Tue, 10 Apr 2012 21:23:34 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: New module name (Eclipse::PHPMe)
Message-Id: <6fhe59-reb.ln1@anubis.morrow.me.uk>


Quoth kinow <brunodepaulak@yahoo.com.br>:
> 
> App seems to be the right place for this application. However, I think
> App::PHPMe would not be the right name for it. Maybe
> App::Eclipse::PHPMe, or App::EclipsePHPMe? What do you think?

What is the executable that gets installed called? If it's called phpme,
I'd call the distribution App::PHPMe, since you've effectively already
'claimed' that name; if it's called something like eclipse_phpme or is
installed somewhere where it only gets called from Eclipse, I'd call it
App::Eclipse::PHPMe.

> By the way, do I need to talk with someone else about using the App
> namespace prefix?

No. In general names on CPAN are first-come, first-served. There are a
few official restrictions, mostly now quite old (for instance, names
under DBI:: are restricted), and there is an unofficial convention that
putting your module under the namespace of an existing module with many
supplied sub-modules (like, say, Catalyst, or Plack) should only be done
after coordinating with the author(s) of that module, but generic
top-level namespaces like App:: are free-for-all.

If you want advice about module naming from the people who run CPAN and
PAUSE, you can write to the modules@perl.org mailing list.

Ben



------------------------------

Date: Wed, 11 Apr 2012 00:17:05 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: pairs to tree
Message-Id: <hkre59-4hd.ln1@anubis.morrow.me.uk>


Quoth "George Mpouras" <nospam.gravitalsun@hotmail.com.nospam>:
> I am re-thinking an old graph problem . Any idea of how to build e.g. the 
> tree
<snip>
> 
> from the pairs ?

tsort(1).

You will need to change the output code if you want the graph rather
than the sorted list. I'm sure there are already CPAN modules which will
do this for you.

Ben



------------------------------

Date: Wed, 11 Apr 2012 03:13:09 -0700 (PDT)
From: Marc Girod <marc.girod@gmail.com>
Subject: Re: pairs to tree
Message-Id: <99b14dcb-e488-4302-b200-487927974b8d@2g2000yqp.googlegroups.com>

On Apr 4, 8:25=A0pm, "George Mpouras"
<nospam.gravitalsun.antis...@hotmail.com.nospam> wrote:
> order is not important. pairs are unique. it is about building topology m=
aps.

I have the same problem as Tim to understand your question.
There are even cycles...

t -> a -> d -> t
f -> a -> b -> f

Marc


------------------------------

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:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#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 3662
***************************************


home help back first fref pref prev next nref lref last post