[8946] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2564 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 12 09:39:50 1998

Date: Tue, 12 May 98 06:01:10 -0700
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, 12 May 1998     Volume: 8 Number: 2564

Today's topics:
    Re: @array(@range) possible?? (Mike Stok)
    Re: @array(@range) possible?? (Mark-Jason Dominus)
        [Perl] How to find the Perl FAQ <rootbeer&pfaq*finding*@redcat.com>
    Re: Does Perl have a IDE?I don't like command line. (Stuart McDow)
        GNUSQL anyone? (Paddy Spencer)
    Re: good and bad newsreaders (was: Re: QRe: == vs. eq) (Curtis [Jewell] Whalen)
    Re: How can you break out of a 'while... ' loop in a fu (Tina Marie Holmboe)
    Re: milliseconds (Mike Stok)
    Re: MODULE MANIA STRIKES (Was Re: What does this do?) (Bart Lateur)
    Re: MODULE MANIA STRIKES (Was Re: What does this do?) (Tina Marie Holmboe)
    Re: MODULE MANIA STRIKES (Was Re: What does this do?) (Tina Marie Holmboe)
    Re: MODULE MANIA STRIKES (Was Re: What does this do?) (Tina Marie Holmboe)
    Re: Newbie question for mailing form contents w/ PERL o (Tina Marie Holmboe)
        Passing non-standard characters to scripts. (Luke Steele)
        Perl as a compiled executable? <robyoung@mediaone.net>
    Re: Perl CGI problem... bentzen@forum.dk
    Re: Please HELP...dynamic PERL page doesn't display... <perlguy@inlink.com>
        Recursive find <rest@Extlap.bi.sdm.de>
        removing last line from file <baton@vision.net.au>
        RTF processing or general text processing module <Herve.Guyot@grenoble.sema.fr>
        Set Difference Problem! <e78199@ceng.metu.edu.tr>
        Sorting a hash of a hash (Kent E. Holsinger)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 12 May 1998 12:46:25 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: @array(@range) possible??
Message-Id: <6j9gb1$4rt@news-central.tiac.net>

In article <894945105.694272@thrush.omix.com>,
Zenin  <zenin@bawdycaste.org> wrote:

>	The book is wrong.
>
>  @subarray = @array[@range];
>  @subarray = @array[1 .. 3];
>  @subarray = @array[3 .. 1];  # backwards

This might work better (in the sense of producing a result expected by
an unwary reader) if you said:

  @subarray = @array[reverse (1 .. 3)];

as .. counts up:

main::(-e:1):   1
  DB<1> @l = (1 .. 3); print "(@l)"
(1 2 3)
  DB<2> @l = (3 .. 1); print "(@l)"
()
  DB<3> @l = reverse (1 .. 3); print "(@l)"
(3 2 1)

Mike
-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: 12 May 1998 08:53:10 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: @array(@range) possible??
Message-Id: <6j9gnm$75u$1@monet.op.net>
Keywords: cemetery fantasist impermeable titillate


In article <894945105.694272@thrush.omix.com>,
Zenin  <zenin@bawdycaste.org> wrote:
>  @subarray = @array[3 .. 1];  # backwards

No.  

[3,2,1] works, but 3..1 generates a list of all the numbers between 3
and 1 in ascenting arder, and there aren't any of those, so [3..1] is
an empty slice.




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

Date: Tue, 12 May 1998 10:24:01 GMT
From: Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
Subject: [Perl] How to find the Perl FAQ
Message-Id: <pfaqmessage894968641.9499@news.teleport.com>

Archive-name: perl-faq/finding-perl-faq
Posting-Frequency: weekly
Last-modified: 12 April 1998

[ That "Last-modified:" date above refers to this document, not to the
Perl FAQ itself! The Perl FAQ is modified frequently; the last major
update was in Spring of 1997. ]

For most people, this URL should be all you need in order to find Perl's
Frequently Asked Questions (and answers).

    http://cpan.perl.org/doc/FAQs/

Please look over (but never overlook!) the FAQ and related docs before
posting anything to the comp.lang.perl.* family of newsgroups.

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

Beginning with Perl version 5.004, the Perl distribution itself includes
the Perl FAQ. If everything is pro-Perl-y installed on your system, the
FAQ will be stored alongside the rest of Perl's documentation, and one
of these commands (or your local equivalents) should let you read the FAQ.

    perldoc perlfaq
    man perlfaq

If a recent version of Perl is not properly installed on your system,
you should ask your system administrator or local expert to help. If you
find that a recent Perl distribution is lacking the FAQ or other important
documentation, be sure to complain to that distribution's author.

If you have a web connection, the first and foremost source for all things
Perl, including the FAQ, is the Comprehensive Perl Archive Network (CPAN).
CPAN also includes the Perl source code, pre-compiled binaries for many
platforms, and a large collection of freely usable modules, among its
403_662_481 bytes (give or take a little) of super-cool (give or take
a little) Perl resources.

    http://cpan.perl.org/
    http://www.perl.com/CPAN/
    http://cpan.perl.org/doc/FAQs/FAQ/html/perlfaq.html
    http://www.perl.com/CPAN/doc/FAQs/FAQ/html/perlfaq.html

You may wish or need to access CPAN via anonymous FTP. (Within CPAN,
you will find the FAQ in the /doc/FAQs/FAQ directory. If none of these
selected FTP sites is especially good for you, a full list of CPAN sites
is in the SITES file within CPAN.)

    California     ftp://ftp.cdrom.com/pub/perl/CPAN/
    Texas          ftp://ftp.metronet.com/pub/perl/
    South Africa   ftp://ftp.is.co.za/programming/perl/CPAN/
    Japan          ftp://ftp.dti.ad.jp/pub/lang/CPAN/
    Australia      ftp://cpan.topend.com.au/pub/CPAN/
    Netherlands    ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
    Switzerland    ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
    Chile          ftp://ftp.ing.puc.cl/pub/unix/perl/CPAN/

If you have no connection to the Internet at all (so sad!) you may wish
to purchase one of the commercial Perl distributions on CD-Rom or other
media. Your local bookstore should be able to help you to find one.
Another possibility is to use one of the FTP-via-email services; for
more information on doing that, send mail to <mail-server@rtfm.mit.edu>
(not to me!) with these lines in the body of the message, flush left:

    setdir usenet-by-group/news.announce.newusers
    send Anonymous_FTP:_Frequently_Asked_Questions_(FAQ)_List

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

Comments and suggestions on the contents of this document
are always welcome. Please send them to the author at
<pfaq&finding*comments*@redcat.com>. Of course, comments on
the docs and FAQs mentioned here should go to their respective
maintainers.

Have fun with Perl!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/


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

Date: 12 May 1998 12:18:41 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6j9en1$alc$1@ns1.arlut.utexas.edu>

fl_aggie@thepentagon.com (I R A Aggie) writes:
> 
> And I've come around to the point of view that perl is a miserable
> for people who've never programmed before.

Well, sure it is. And so is C, sh, awk, sed, BASIC, FORTRAN, Lisp,
etc.

--
Stuart McDow                                     Applied Research Laboratories
smcdow@arlut.utexas.edu                      The University of Texas at Austin
            "Look for beauty in roughness, unpolishedness"


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

Date: Tue, 12 May 1998 12:03:25 GMT
From: paddy.spencer@parallax.co.uk (Paddy Spencer)
Subject: GNUSQL anyone?
Message-Id: <894974606.368249@red.parallax.co.uk>

I've checked the FAQ, checked DejaNews, AltaVista and CPAN with no joy so
far. Does anyone know of a module for using gnusql?

-- 
Paddy Spencer        
Parallax Solutions Ltd (http://www.parallax.co.uk/)



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

Date: 12 May 1998 11:40:02 GMT
From: curtis_whalen+usenet@geocities.com (Curtis [Jewell] Whalen)
Subject: Re: good and bad newsreaders (was: Re: QRe: == vs. eq)
Message-Id: <6j9cei$los@enews3.newsguy.com>

Greg Bacon <gbacon@cs.uah.edu> scrawled in news.software.readers:
>In article <1d8v5gb.14qcbep1sdy36oN@roxboro0-002.dyn.interpath.net>,
>	phenix@interpath.com (John Moreno) writes:
>
>: It is my opinion they didn't include the X-Newsreader header because
>: they didn't want people to know what program (Ameol2) was producing such
>: junk.  I of course don't have any evidence to base this on except for
>: the lousy articles that it produced.
>
>Here's what Henry has to say on the matter (from Son-of-1036, Section
>4.2.2, ``Undesirable Headers''):
>
>    Headers  that merely state defaults explicitly (e.g., a Fol-
>    lowup-To header with the  same  content  as  the  Newsgroups
>    header,   or   a  MIME  Content-Type  header  with  contents
>    "text/plain; charset=us-ascii") or  state  information  that
>    reading  agents  can  typically  determine easily themselves
>    (e.g. the length of the body in octets) are redundant,  con-
>    veying no information whatsoever.  Headers that state infor-
>    mation which cannot possibly be of use to a significant num-
>    ber  of relayers, reading agents, or readers (e.g., the name
>    of the software package used as the posting agent) are  use-
>    less and pointless.  Posters and posting agents SHOULD avoid
>    including redundant or useless headers in articles.
>
>        NOTE: Information that someone,  somewhere,  might
>        someday  find useful is best omitted from headers.
>        (There's quite enough of it  in  article  bodies.)
>        Headers  should contain information of known util-
>        ity only.  This is not meant to preclude inclusion
>        of  information  primarily meant for news-software
>        debugging, but such information should be included
>        only  if there is real reason, preferably based on
>        experience, to suspect that it  may  be  genuinely
>        useful.  Articles passing through gateways are the
>        only obvious case  where  inclusion  of  debugging
>        information appears clearly legitimate.  (See sec-
>        tion 10.1.)
>
>        NOTE: A useful rule of thumb for  software  imple-
>        mentors  is:  "if  I had to pay a dollar a day for
>        the transmission of this  header,  would  I  still
>        think it worthwhile?".
>
>Greg

Look up the User-Agent header in current Grandson drafts, however, as
the proposed replacement for X-Newsreader.

-- 
-- Curtis, email: curtis underline whalen plus email at geocities dot com
Change usenet to email if you want your email replies read because of SPAM.
Meet the Carlson Septuplets: http://www.id.net/~kmannist/septs.htm
My other computer is a Pentium II.


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

Date: 12 May 1998 12:45:44 GMT
From: tina@scandinaviaonline.se (Tina Marie Holmboe)
Subject: Re: How can you break out of a 'while... ' loop in a function?
Message-Id: <6j9g9o$71k$2@news1.sol.no>

In article <6j7iml$bp9$1@usenet40.supernews.com>,
	"Peter Perchansky" <fp@pmpcs.com> writes:

> Look at using "next" and "last".

  Whilst this is a correct answer as far as the question in the subject is
concerned, methinks it is worth mentioning - and get flamed for as every
other time I do this :) - that *perhaps* next and last isn't the very
best things in Perl.

  To me, though I am admittedly strange, they translate to goto... there
*is* some good advice in not breaking out of while-loops - or any other
loops - in more than one place.

  Sortof makes things easier to work with, IMHO.

-- 
  Tina Marie Holmboe                
  Application Developer (Geeks'R'Us)         [tina@tech.scandinaviaonline.se]
  Scandinavia Online AB Development Dept.    (+46) 08 587 81000 (switchboard)
                                             (+46) 08 587 81189 (direct)


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

Date: 12 May 1998 12:51:18 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: milliseconds
Message-Id: <6j9gk6$4rt@news-central.tiac.net>

In article <355803E1.EC892F5@eto.ericsson.se>,
Atle Raestad  <etoatr@eto.ericsson.se> wrote:
>Is it possible to measure in milliseconds in perl. "time" returns
>seconds and "times" returns CPU times. I want a function like time, that
>return the value in millisecond instead of seconds.

Have you looked on CPAN at the Time::HiRes module, the README's at

  .../modules/by-module/Time/Time-HiRes-01.16.readme

on a CPAN site.  Is it any help?

The FAQ can also be found on CPAN, one way to get ther is to browse
http://www.perl.com and follow the CPAN link.

Hope this helps,

Mike
-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: Tue, 12 May 1998 11:42:47 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: MODULE MANIA STRIKES (Was Re: What does this do?)
Message-Id: <35593078.2587571@news.tornado.be>

Tina Marie Holmboe wrote:

>  Telling a student to read the *source* to learn something *isn't* very
>clever; it isn't even *smart*. 

It goes straight into the teachings of some (respectable) schools of
software engineering. I don't know exactly who formed the basis (I think
I found it in the book "Softwware Engineering", Academic Service), but
you are supposed to build your software libraries (modules) as if they
were black boxes, where people aren't even *allowed* to look at the
source.

In particular, the language Ada is designed especially to be used this
way: the specification (= how to use a module) is completely, even
physically, separated from the implementation (= the code): it's in
different files. (The compiler does check that interface and
implementation actually match.)

Even C's source and header files are somewhat based upon this thought
(besides laziness of the compiler builders :-).

The whole idea is: if you can't write a simple and understandable
interface to your module, it's a poor design. If people have to look at
the source, to understand what it's supposed to do, is evidence of a
very poor design.

The same goes for Perl itself: you MAY NOT expect people to learn the
Perl syntax by looking at the Perl compiler source.

	Bart.


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

Date: 12 May 1998 12:21:28 GMT
From: tina@scandinaviaonline.se (Tina Marie Holmboe)
Subject: Re: MODULE MANIA STRIKES (Was Re: What does this do?)
Message-Id: <6j9es8$6mp$1@news1.sol.no>

In article <3557E159.906E5468@order.booktraders.com>,
	Birgitt Funk <birgitt@order.booktraders.com> writes:

> Wow, thank you very much for this statement. You answered pretty
> clearly a question I posted in another thread:

  No need to thank - that statement was from the heart.



> Sure, let's say you read through the book once, next step, you read it
> again and solve exercises, but then the next step is what ? More of
> translating source code of other people programs or more trying to
> write little ones you want to make for yourself.

  Writing the little ones - and falling on ones nose - is what most of us
do. When, at times, we can't get up we reach for a helping hand. Being
handed a new nose is of course interesting, but doesn't help with the
fundamental problem of still laying flat on ones face.

  I still *vididly* recall the first time I was presented for Cook's theorem
on NP-completeness. If anyone had said to me "HERE is a great way to learn
how to prove things!" - ... I'd *scream* :)




>>   Telling a student to read the *source* to learn something *isn't* 
>>   very clever; it isn't even *smart*. I'd go as far as claim it is 
>>   directly abusive - and reminds me of the old "The best way to learn 
>>   HTML is to look at the source of webpages!"
>> 
> 
> Well, I don't make a comment to that one, but you may guess how
> I feel about it.

  I'm beginning to get an idea, yes :)



> Thanks for your answer, I think it is very important to
> become more aware about how something is learned and it is
> a coincidence that you answered to something I have been
> thinking about a lot and asked today in public.

  Well... I agree. Being a programmer, and I've been one for a lil' while
now, it seems that our 'community' is the only one who, in response to a
plea for guidance and teachings reply with the now-famous RTFS.

  It would be interesting to see the same philosophy being put to the test
in other professions. Builders, carpenters, surgeons, policemen...

  Oh, weeee.

-- 
  Tina Marie Holmboe                
  Application Developer (Geeks'R'Us)         [tina@tech.scandinaviaonline.se]
  Scandinavia Online AB Development Dept.    (+46) 08 587 81000 (switchboard)
                                             (+46) 08 587 81189 (direct)


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

Date: 12 May 1998 12:27:10 GMT
From: tina@scandinaviaonline.se (Tina Marie Holmboe)
Subject: Re: MODULE MANIA STRIKES (Was Re: What does this do?)
Message-Id: <6j9f6u$6mp$2@news1.sol.no>

In article <35593078.2587571@news.tornado.be>,
	bart.mediamind@tornado.be (Bart Lateur) writes:

> The same goes for Perl itself: you MAY NOT expect people to learn the
> Perl syntax by looking at the Perl compiler source.

  Agreed. However, I want to take this one step further: one MAY NOT expect
people to learn good, or even correct, Perl programming by reading module
source code; be those modules everso much from CPAN.

-- 
  Tina Marie Holmboe                
  Application Developer (Geeks'R'Us)         [tina@tech.scandinaviaonline.se]
  Scandinavia Online AB Development Dept.    (+46) 08 587 81000 (switchboard)
                                             (+46) 08 587 81189 (direct)


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

Date: 12 May 1998 12:40:48 GMT
From: tina@scandinaviaonline.se (Tina Marie Holmboe)
Subject: Re: MODULE MANIA STRIKES (Was Re: What does this do?)
Message-Id: <6j9g0g$71k$1@news1.sol.no>

In article <6j7hf8$q68$2@info.uah.edu>,
	gbacon@cs.uah.edu (Greg Bacon) writes:

> No amount of kindness, politeness, or hand-holding will amount to even
> ten minutes of doc reading.

  Noone has asked anyone to hold anyone's hand or other bodypart. What *is*
asked is that when someone asks to learn about A, he or she isn't told to go
use B instead. The pupil is told where to find what he/she needs to learn
what she/he wants to learn - not that something else is a better tool.

  Of *course* he should have found all he needed to know about read() in the
documentation. THEN he might, *MIGHT*, be better of using CGI.pm.

  But hells-bells; pointing people to CGI.pm or any other module, good or
bad, when they want to *learn Perl* is a good deal *more* hand-holding than 
telling them where they could teach themselves.


  For the original poster and question we don't even know that he intended
to write a CGI-script at all. He might have looked at the source of one to
*learn*, and found something he didn't understand. He then asks here, though
the docs is a better place, and is told to use a module he isn't the least
interested in. A hypothesis, yes. But something, IM(ns)HO worth considering.

-- 
  Tina Marie Holmboe                
  Application Developer (Geeks'R'Us)         [tina@tech.scandinaviaonline.se]
  Scandinavia Online AB Development Dept.    (+46) 08 587 81000 (switchboard)
                                             (+46) 08 587 81189 (direct)


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

Date: 12 May 1998 12:54:58 GMT
From: tina@scandinaviaonline.se (Tina Marie Holmboe)
Subject: Re: Newbie question for mailing form contents w/ PERL on IIS4
Message-Id: <6j9gr2$71k$3@news1.sol.no>

In article <6j2cks$cut@portal.gmu.edu>,
	"Matthew Cate" <mcate@gmu.edu> writes:

> My question is how do I rewrite the script to tell it to send the form
> contents using Exchange or can I?

  The bottom line here is whether Exchange is able to be used in this
way. That, however, is a question slightly out of scope for this newsgroup
I'm afraid. Do you have some more Microsoft-application-specific group 
you could try the question in ?

-- 
  Tina Marie Holmboe                
  Application Developer (Geeks'R'Us)         [tina@tech.scandinaviaonline.se]
  Scandinavia Online AB Development Dept.    (+46) 08 587 81000 (switchboard)
                                             (+46) 08 587 81189 (direct)


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

Date: Tue, 12 May 1998 11:53:46 GMT
From: ljs@cableinet.co.uk (Luke Steele)
Subject: Passing non-standard characters to scripts.
Message-Id: <35583375.10468951@news.cableinet.co.uk>

Hi,

First of all, if this a stupid question which is covered in just about
every FAQ under the sun, I apologise - I have looked, and I've unable
to find anything to answer my question!  I also ought to mention that
my understanding of these things is as yet fairly rudimentary, so I
apologise if I seem to be talking gibberish!  Anyway....

I have a cgi script in which I wish to be to create a link which calls
a second script, passing a parameter (which we'll call 'name') with a
string value containing spaces, e.g.

<a href="somescript?name=some name">link test</a>

Except as I understand it, the link will need to have spaces (and any
other unusual characters) encoded like so:

<a href="somescript?name=some%20name">link test</a>

Now, I think I know how to convert spaces to %20's myself, but if I
write code to cater for all possible characters I'm bound to mess it
up, so I need a piece of code which will take a scalar -

$somescalar = "a string with=various weird%and #!"#%^wonderful
characters";

- and convert it to a 'safe' form.  Any suggestions as to where I find
something like that?  I'm using cgi.pm, but as far as I can tell it
doesn't seem contain a function like the one I'm looking for.

Any suggestions are gratefully received.  Thanks!


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

Date: Tue, 12 May 1998 06:46:04 -0700
From: Robert Young <robyoung@mediaone.net>
Subject: Perl as a compiled executable?
Message-Id: <3558529C.F3CFBFB4@mediaone.net>

passme
approve

I want to hide a portion of my distributed script.  I head that it is
now possible to save your Perl scripts as a compiled executable.  Does
anyone know where I can find out about this?

Thanks,
Rob Young



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

Date: Tue, 12 May 1998 10:00:48 GMT
From: bentzen@forum.dk
Subject: Re: Perl CGI problem...
Message-Id: <6j96kf$h9b$1@nnrp1.dejanews.com>

Thanks for your feed-back !!!

 - but I only have one more question:

my $insert_this = "This is the new line of text to be inserted";

What if $insert_this should be a variabel I have earlier in the code (from a
form)????

Greetings
Martin Bentzen

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Tue, 12 May 1998 11:58:17 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: Please HELP...dynamic PERL page doesn't display...
Message-Id: <35583959.BBA697E@inlink.com>

If you are using IE 3.0x that has been patched for RFC1867

AND 

You have some <SELECT><OPTION>....</SELECT> in your calling web page.

IE puts in an extra & in.  I had to put the following into my code:

if($part =~ /name=\"category\"/){$part=~s/\s{1,}\&//g;}

To get rid of the extra &.  This problem was a pain-in-the-ass to track
down, and it only occurs in IE 3.x, NOT 4.x.

I hope this has helped you...

BRent


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

Date: 12 May 1998 11:46:46 GMT
From: Johannes Rest <rest@Extlap.bi.sdm.de>
Subject: Recursive find
Message-Id: <6j9cr6$5af$1@bsdti6.sdm.de>

Hello!

I'm quite new to perl, and for a start I would like
to program a recursive find in perl, which also allows
to search each matching file for a regular expression, i.e.

find /home/ttt/src *.c int

which should find all c files containing the string "int".
Has anybody hints or samples to get me started?

Thanks in advance
Johannes
-- 
Johannes Rest		mailto:Johannes.Rest@sdm.de
sd&m   GmbH & Co. KG		http://www.sdm.de
Thomas-Dehler-Str. 27, 81737 Muenchen, Germany
Tel +49 89 63812-438  Fax -150


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

Date: 12 May 1998 12:13:11 GMT
From: "Baton" <baton@vision.net.au>
Subject: removing last line from file
Message-Id: <01bd7d9f$f7943800$0400a8c0@bruce>

how would i go about removing the last line of a text file?
also i need a way of displaying that line before it gets deleted

im told it can be done with seek peek sysread  etc...
but i have no idea how to


please email me on baton@xenon.net
if you can help me

cya

Aaron


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

Date: 12 May 1998 12:44:37 +0200
From: Herve GUYOT <Herve.Guyot@grenoble.sema.fr>
Subject: RTF processing or general text processing module
Message-Id: <xt4ra1zhip6.fsf@grenoble.sema.fr>


Hello everyone,

Does anyone know if there exists a module to parse RTF, or at least, a
general file editing utility (somewhat similar - functionally
speaking - to emacs-lisp or DEC's TPU).

I looked through the FAQ, and searched the CPAN, but found none.

What I need to do is to modify and/or remove parts of some RTF files. I
already done a first shot using sed and awk, but it is scarcely
maintainable.

Thank you for any answer.

-- 
	Herve Guyot

Sema Group - Division Energie et Industrie - Meylan - FRANCE
E-mail Herve.Guyot@grenoble.sema.fr


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

Date: Tue, 12 May 1998 12:49:15 +0300
From: Walid ALSAQAF <e78199@ceng.metu.edu.tr>
Subject: Set Difference Problem!
Message-Id: <35581B1A.48E3B401@ceng.metu.edu.tr>

Regards,

 In the Perl faq, there was such a code for obtaining the difference,
uion, and intersection sets of two arrays:
Use a hash. Here's code to do both and more. It assumes that each
element is unique in a given
array:

    @union = @intersection = @difference = ();
    %count = ();
    foreach $element (@array1, @array2) { $count{$element}++ }
    foreach $element (keys %count) {
        push @union, $element;
        push @{ $count{$element} > 1 ? \@intersection : \@difference },
$element;
    }

But when I have:
@array1=(1,2,3,4,5)
@array2=(1,2,6)

but when I try to get the @difference of (array2-array1) I get:
(2,4,6) while I expected (6). How can I modify the code to correct this
problem? Please try to email me the reply as well..

	Regards. 

-- 
/*********************************************/
Walid ALSAQAF

METU 
Computer Engineering Department
mailto:e78199@ceng.metu.edu.tr
http://www.ceng.metu.edu.tr/~e78199/Walid
ICQ # : (9762042)
/*********************************************/


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

Date: 12 May 1998 08:03:17 -0400
From: kent@darwin.eeb.uconn.edu (Kent E. Holsinger)
Subject: Sorting a hash of a hash
Message-Id: <87wwbr66ii.fsf@darwin.eeb.uconn.edu>

This is probably an elementary question, but I have been unable to
locate the answer. If it is elementary, a simple pointer to the place
to look for an answer will be appreciated.

Suppose I have the following:
   
   #!/usr/bin/perl -w
   use strict;
   
   my %hash1 = ();
   my %hash2 = ();
   my %temp  = ();
   
   while (<>) {
       my ($a, $b) = split;
       $hash1{$a}++;
       $hash2{$a}{$b}++;
   }
   
   my $first;
   foreach $first ( sort value1 keys(%hash1) ) {
       print "$first\n";
       %temp = %{$hash2{$first}};
       my $second;
       foreach $second ( sort value2 keys(%temp) ) {
           print "   $second: $hash2{$first}{$second}\n";
       }
   }
   
   sub value1 { $hash1{$a} <=> $hash2{$b} }
   
   sub value2 { $temp{$a} <=> $temp{$b} }

Is there a way to avoid the use of %temp? The way that seemed obvious
to me

   sort value2 keys(%{$hash2{$first}})

   sub value2 { $hash2{$first}{$a} <=> $hash2{$first}{$b} }

fails with the message

   Use of uninitialized value at temp.pl line 25, <> chunk 11.

Line 25 is

   sub value2 { $hash2{$first}{$a} <=> $hash2{$first}{$b} }

Thanks.

Kent

-- 
Kent E. Holsinger                Kent@Darwin.EEB.UConn.Edu
                                 http://darwin.eeb.uconn.edu
-- Department of Ecology & Evolutionary Biology          
-- University of Connecticut, U-43                                       
-- Storrs, CT   06269-3043                                               


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 2564
**************************************

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