[26482] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 8644 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 8 14:05:35 2005

Date: Tue, 8 Nov 2005 11:05:06 -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           Tue, 8 Nov 2005     Volume: 10 Number: 8644

Today's topics:
        how to do this job using perl? <sonet.all@msa.hinet.net>
    Re: how to do this job using perl? <josef.moellers@fujitsu-siemens.com>
    Re: how to do this job using perl? <sonet.all@msa.hinet.net>
    Re: how to do this job using perl? nospam@geniegate.com
    Re: why the perl documents is hard to understand? xhoster@gmail.com
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 8 Nov 2005 23:25:38 +0800
From: "sonet" <sonet.all@msa.hinet.net>
Subject: how to do this job using perl?
Message-Id: <dkqg48$fgs$1@netnews.hinet.net>

#items  parent
01.attr 0
02.attr 0
04.attr 01.attr
03.attr 01.attr
06.attr 02.attr
07.attr 03.attr
08.attr 03.attr
09.attr 07.attr
=========================================
transform to this form
ps: The order must follow above
=========================================
01.attr
    04.attr
    03.attr
        07.attr
            09.attr
        08.attr
02.attr





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

Date: Tue, 08 Nov 2005 16:41:56 +0100
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: how to do this job using perl?
Message-Id: <dkqgng$r8v$2@nntp.fujitsu-siemens.com>

sonet wrote:
> #items  parent
> 01.attr 0
> 02.attr 0
> 04.attr 01.attr
> 03.attr 01.attr
> 06.attr 02.attr
> 07.attr 03.attr
> 08.attr 03.attr
> 09.attr 07.attr
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> transform to this form
> ps: The order must follow above

solution must be delivered to teacher until 5pm today.

> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> 01.attr
>     04.attr
>     03.attr
>         07.attr
>             09.attr
>         08.attr
> 02.attr


What have YOU tried so far and where did YOUR code not produce the=20
desired result?
--=20
Josef M=F6llers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize
						-- T.  Pratchett



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

Date: Wed, 9 Nov 2005 00:07:26 +0800
From: "sonet" <sonet.all@msa.hinet.net>
Subject: Re: how to do this job using perl?
Message-Id: <dkqiin$72v$1@netnews.hinet.net>

First, this is not a homework.

The Tree::Simple can do this job after i search modules in CPAN.
But i don't want to do this by modules only if i can not slove it.
If this is anOS directory , i know how to solve it. But the data is in
a file. Someone design his system fllow this rules and i just want to
try it.

Sorry! My mother language is not english.And my english is very poor.
Please help me and give me a keyword about this  topic. I can slove it
by myself. You don't need to write some code. Just give a suggestion.

"sonet" <sonet.all@msa.hinet.net> ¦b¶l¥ó news:dkqg48$fgs$1@netnews.hinet.net
¤¤¼¶¼g...
> #items  parent
> 01.attr 0
> 02.attr 0
> 04.attr 01.attr
> 03.attr 01.attr
> 06.attr 02.attr
> 07.attr 03.attr
> 08.attr 03.attr
> 09.attr 07.attr
> =========================================
> transform to this form
> ps: The order must follow above
> =========================================
> 01.attr
>     04.attr
>     03.attr
>         07.attr
>             09.attr
>         08.attr
> 02.attr
>
>




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

Date: Tue, 08 Nov 2005 18:40:40 GMT
From: nospam@geniegate.com
Subject: Re: how to do this job using perl?
Message-Id: <Lucy1131474446198810xe56dac@air.tunestar.net>

In: <dkqg48$fgs$1@netnews.hinet.net>, "sonet" <sonet.all@msa.hinet.net> wrote:
>#items  parent
>01.attr 0
>02.attr 0
>04.attr 01.attr
>03.attr 01.attr
>06.attr 02.attr
>07.attr 03.attr
>08.attr 03.attr
>09.attr 07.attr
>=========================================
>transform to this form
>ps: The order must follow above
>=========================================
>01.attr
>    04.attr
>    03.attr
>        07.attr
>            09.attr
>        08.attr
>02.attr


A bit of a complex task for a usenet post, but, the general idea would
be to use references. (I'd probably use a small utility package, creating
a basic tree like structure with methods like $tree->addAttr('name')

Wouldn't be that hard, I've done stuff like it in XML, but it wouldn't
be a 5 minute project either.

Looking/arranging the data this way:

# parent item

0 	01.attr
0 	02.attr
01.attr 	04.attr
01.attr 	03.attr
02.attr 	06.attr
03.attr 	07.attr
03.attr 	08.attr
07.attr 	09.attr

Or perhaps even better:

# Parent   children
0 	01.attr
0 	02.attr
01.attr 	04.attr, 03.attr
02.attr 	06.attr
03.attr 	07.attr, 08.attr
07.attr 	09.attr

may make the problem easier to visualize. (you did say the order followed
above) 

Much of programming is about arranging the right "view" of the information,
sometimes problems solve themselves if you look at it from enough angles.

Jamie
-- 
http://www.geniegate.com                    Custom web programming
guhzo_42@lnubb.pbz (rot13)                User Management Solutions


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

Date: 08 Nov 2005 16:38:06 GMT
From: xhoster@gmail.com
Subject: Re: why the perl documents is hard to understand?
Message-Id: <20051108113806.900$RN@newsreader.com>

Xiaoshen Li <xli6@gmu.edu> wrote:
> Thank you very much for the replies. Yes, a coin has two sides, I agree.
> Anyway, I was taught that there is a trick to learn unix/linux. That is
> to learn how to read man page. Because the man page is always there to
> help you, anytime, anywhere.

Alas, this increasingly seems not to be the case.  Now the man page often
says little more than to see the "info" page, which are often missing or
useless.

>
> This similar trick clearly cannot work in Perl, unless I am at a
> prefessional level already. (If a person is at that level, I think those
> document pages may not be very useful already, at least its usefulness
> has been dramatically decreased.) I wish the wording, discriptions of
> each function are writen for general people, not for professionals or
> the writer himself to read.

I was once a beginner in Perl.  I've read the perldoc pages, and understood
much of it.  It is where most of my knowledge comes from.  If that doesn't
work for you, perhaps you should read a book intended to teach beginners,
rather than reading the documentation.

>
> (By the way, the comment "Unfortunately, Linux/Unix man pages are badly
> writen." is not from me, is from the book "Think Unix" by Jon Lasser and
> I assume & believe a lot of people feel same way.)
>
> Generally, I wish computer science people could improve their expression
> skills dramatically.

I agree.  I think computer science people should start doing so by
providing concrete examples and suggested improvements, rather than just
vague whining, when they criticise other people's expression skills.

> Now I recall one of the greatest poet in China Tang Dynasty, BaiJuYi.
> After finishing a poem, he always read to some old aged general people.
> If they don't understand, he always tore it away and restart to write.
> It is not easy to explain something.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


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

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 8644
***************************************


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