[10395] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3988 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 16 01:01:27 1998

Date: Thu, 15 Oct 98 22:00:20 -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           Thu, 15 Oct 1998     Volume: 8 Number: 3988

Today's topics:
    Re: Compiling perl with mingw32 <metcher@spider.herston.uq.edu.au>
    Re: Cool company has Perl jobs! <dgris@perrin.dimensional.com>
        Help using SSI call to Perl to set Cookies <kent@sitstay.com>
    Re: Help using SSI call to Perl to set Cookies (Martien Verbruggen)
    Re: Help using SSI call to Perl to set Cookies <kent@sitstay.com>
    Re: Help using SSI call to Perl to set Cookies <rootbeer@teleport.com>
        How can I parse output from a form response? (me)
    Re: How can I parse output from a form response? <rootbeer@teleport.com>
    Re: New to programming - New to Perl - LOST!!!! <tim.hicks@lineone.net>
    Re: New to programming - New to Perl - LOST!!!! <tim.hicks@lineone.net>
    Re: Newbie Loop Help (Mark-Jason Dominus)
    Re: One question on writing Perl module (Wong Kin Sang)
    Re: Programmer's Text Editor (Simon Brooke)
    Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has regi <eashton@bbnplanet.com>
        Redirecting output of the system function <olafm@seas.upenn.edu>
        Reverse foreach loop darrensw@my-dejanews.com
        Reverse foreach loop darrensw@my-dejanews.com
        Set up FTP via Perl? <mostoc@mail.mankato.msus.edu>
    Re: Set up FTP via Perl? (Mike Stok)
    Re: Set up FTP via Perl? (Michael J Gebis)
    Re: Sorry Lee.Lindley@bigfoot.com
    Re: Sorry (Ronald J Kimball)
    Re: sorting file entries by time (Martien Verbruggen)
    Re: Statistics for comp.lang.perl.misc (Ronald J Kimball)
    Re: The space deletion woes... (Mark D.)
    Re: The space deletion woes... (Mark D.)
    Re: The space deletion woes... (Martien Verbruggen)
    Re: The space deletion woes... <rootbeer@teleport.com>
    Re: The space deletion woes... <eashton@bbnplanet.com>
    Re: The space deletion woes... (Ronald J Kimball)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Fri, 16 Oct 1998 13:03:11 +1000
From: Jaime Metcher <metcher@spider.herston.uq.edu.au>
Subject: Re: Compiling perl with mingw32
Message-Id: <3626B76F.E3DE58A5@spider.herston.uq.edu.au>

massimobalestra@my-dejanews.com wrote:
> 
> Hi,
> I am trying to compile Perl with mingw32 (with gcc) but I've got some
> compilation errors.
> 
> I tryed also with egcc but I have the same errors.
> 
> Does someone have suggestions?
> 

It's pretty hard to read with the strange line wrapping, but here
goes...

<snip>
> gcc -c -I..\lib\CORE -I.\include -I. -I.. -Ic:\mingw32\\include 
                                                        ^^
                                              This is weird

> ..\doio.c:1010: warning: passing arg 2 of `win32_execvp' from incompatible
> pointer type

I think these warnings are OK

<snip>
> c:\mingw32\\include\Windows32/Base.h:231: redefinition of `TCHAR'
> c:\mingw32\\include\tchar.h:138: `TCHAR' previously declared here 

My compile said this, too, but seems to work OK.

win32.c: In

> function `win32_environ': win32.c:1345: `_environ' undeclared (first use in
> this function) win32.c:1345: (Each undeclared identifier is reported 

Hmmm..._environ is defined in win32.h, which is included in config.h,
which is included in perl.h, which is included in win32.c.  What does
your config.h look like?  Does it include win32.h?

> api32 -lshell32 -lmingw32 -lgcc -lmoldname -lcrtdll ld: cannot open
> .\mini\win32.o: No such file or directory cd .. && miniperl minimod.pl >

Boy, your make just ploughs on.  Maybe it should have given up here.

-- 
Jaime Metcher


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

Date: Fri, 16 Oct 1998 02:06:05 GMT
From: Daniel Grisinger <dgris@perrin.dimensional.com>
Subject: Re: Cool company has Perl jobs!
Message-Id: <m3r9w9l15j.fsf@perrin.dimensional.com>

Scratchie <upsetter@ziplink.net> writes:

>                                            It won't be too long before MS
> decides they need to include it with Windows. 

They ship an ancient (5.001 based) version of perl on the NT resource
kit.

dgris
-- 
Daniel Grisinger          dgris@perrin.dimensional.com
`By about halfway through I was beginning to guess the 
ending, but it still kind of surprised me.'
      David Hatunen, talking about the movie Titanic


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

Date: Thu, 15 Oct 1998 19:46:49 -0500
From: Kent <kent@sitstay.com>
Subject: Help using SSI call to Perl to set Cookies
Message-Id: <36269778.2B5E9DF8@sitstay.com>

I would like to use an SSI call to a Perl program that sets a cookie. I
have programs setting cookies successfully elsewhere but when called via

SSI they don't set the cookie. I've tried calling them with: "exec
cgi=", "exec cmd=", and "include virtual=". Basically the Set-cookie
command is ignored and the rest of the program executes successfully.

Is it even possible? Any ideas or examples that work?

Kent



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

Date: Fri, 16 Oct 1998 01:24:14 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Help using SSI call to Perl to set Cookies
Message-Id: <2fxV1.83$LH3.170236@nsw.nnrp.telstra.net>

In article <36269778.2B5E9DF8@sitstay.com>,
	Kent <kent@sitstay.com> writes:
> Is it even possible? Any ideas or examples that work?

If it is, then it has nothing at all to do with perl. It has something
to do with SSI. You should probably ask in one of the
comp.infosystems.www.* groups.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | If at first you don't succeed, try
Commercial Dynamics Pty. Ltd.       | again. Then quit; there's no use being
NSW, Australia                      | a damn fool about it.


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

Date: Thu, 15 Oct 1998 20:28:02 -0500
From: Kent <kent@sitstay.com>
Subject: Re: Help using SSI call to Perl to set Cookies
Message-Id: <3626A122.11EDF5C8@sitstay.com>

I solved my problem by calling the CGI script using an <IMG SRC=> call.

Kent

Kent wrote:

> I would like to use an SSI call to a Perl program that sets a cookie. I
> have programs setting cookies successfully elsewhere but when called via
>
> SSI they don't set the cookie. I've tried calling them with: "exec
> cgi=", "exec cmd=", and "include virtual=". Basically the Set-cookie
> command is ignored and the rest of the program executes successfully.
>
> Is it even possible? Any ideas or examples that work?
>
> Kent



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

Date: Fri, 16 Oct 1998 01:19:40 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Help using SSI call to Perl to set Cookies
Message-Id: <Pine.GSO.4.02A.9810151819060.26848-100000@user2.teleport.com>

On Thu, 15 Oct 1998, Kent wrote:

> I would like to use an SSI call to a Perl program that sets a cookie.
> I have programs setting cookies successfully elsewhere but when called
> via SSI they don't set the cookie. I've tried calling them with: "exec
> cgi=", "exec cmd=", and "include virtual=". Basically the Set-cookie
> command is ignored and the rest of the program executes successfully.

If you're following the proper protocol but some browser or server doesn't
cooperate, then it's the other program's fault. If you're not following
the protocol, then it's your fault. If you aren't sure about the protocol,
you should read the protocol specification. If you've read it and you're
still not sure, you should ask in a newsgroup about the protocol.

Hope this helps!

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



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

Date: Fri, 16 Oct 1998 01:30:36 GMT
From: C.Thurston@palm.a2000.nl (me)
Subject: How can I parse output from a form response?
Message-Id: <7067n6$53l$2@newton.a2000.nl>

I thought this would be easier...
All I need to do is make a form with all fields required, two must be numeric 
only, and then mail the response back and put a <CR> or lf after each pair.

I have  javascript that will validate the fields, that works fine. I get the 
email and everything is there but it's not formatted the way I'd like, it's 
strung together with "&"'s. 

I guess "enctype='plain/text" only works with a mailto action because if I 
include it I get an empty email back.

I've used that before when the form action=mailto:address@abc.com and it 
converted my string of textand &'s into i per line with a <CR>

Does anyone know how I could fix this so I get  output like this?
field1=response
field2=xxxxx
field3=whatever

Here's the perl cgi:
#!/bin/perl
# 
------------------------------------------------------------------------------
----
$mailer = '/usr/lib/sendmail';
read(STDIN, $message, $ENV{'CONTENT_LENGTH'});
open(MAIL, "|$mailer -t") || die "Can't open $mailer!\n";
print MAIL "To:twocats\@xs4all.nl\n";
print MAIL "From:Lidform-" . $ENV{'REMOTE_HOST'} . "\n";
print MAIL "Subject: Form posted: Aanvraag voor lidmaaschap\n\n";
print MAIL "$message\n";
close (MAIL);
print "Content-type: text/html\n\n";
print "<HTML><HEAD><TITLE></TITLE></HEAD>\n";
print "<BODY><H1></H1>\n";
print "Bedankt!";
print "</BODY></HTML>";

And here's the html bit
 that calls it from the form
<FORM NAME="WF_1" ACTION="/test/wf_2.cgi"  METHOD=POST onSubmit="return 
checkdata()">

Any help at all would be appreaciated. 
Thanks,
Curt


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

Date: Fri, 16 Oct 1998 01:43:01 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: How can I parse output from a form response?
Message-Id: <Pine.GSO.4.02A.9810151842100.26848-100000@user2.teleport.com>

On Fri, 16 Oct 1998, me wrote:

> read(STDIN, $message, $ENV{'CONTENT_LENGTH'});

Haven't been reading this newsgroup before, have you? Use the CGI module
to handle this and much more. Hope this helps!

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



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

Date: Fri, 16 Oct 1998 01:04:12 +0100
From: "Tim Hicks" <tim.hicks@lineone.net>
Subject: Re: New to programming - New to Perl - LOST!!!!
Message-Id: <4awV1.21466$Gu6.516@news-reader.bt.net>

I have downloaded the APi504.exe file successfully.  Thanks for all the help
from everyone... I'm sure you'll be hearing from me again in the near
future.


Tim




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

Date: Fri, 16 Oct 1998 01:06:18 +0100
From: "Tim Hicks" <tim.hicks@lineone.net>
Subject: Re: New to programming - New to Perl - LOST!!!!
Message-Id: <bawV1.21467$Gu6.516@news-reader.bt.net>

Do you think I'll be able to get by with the version that I have as I have
already shelled out 20 quid for the book and had a bit of a thumb through.
If it's no good at all, I guess I'll have to see about getting a different
book, but I don't really want to.


Tim



Ben Coleman wrote in message <36265fc8.581159352@news.mindspring.com>...
>On Thu, 15 Oct 1998 15:22:00 +0100, "Tim Hicks" <tim.hicks@lineone.net>
>wrote:
>
>>I have bought myself a copy of 'Learning Perl' by
>>Schwartz and Christiansen and have read most of the first chapter.  I
think
>>that I can get my head around what it is talking about, but for now, that
is
>>no my problem.  I am running Win 95 and everything I read seems to be very
>>UNIX orientated.
>
>You may want to instead get hold of 'Learning Perl on Win32 Systems', which
>is the Win32-oriented version of LP.
>
>Ben
>--
>Ben Coleman
>Senior Systems Analyst
>TermNet Merchant Services, Inc.
>Atlanta, GA




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

Date: 15 Oct 1998 21:26:09 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Newbie Loop Help
Message-Id: <7067bh$jp0$1@monet.op.net>

In article <G5qV1.8927$wV1.5884692@news2.voicenet.com>,
Matt Knecht <hex@voicenet.com> wrote:
>Erik A Belknap <ebelknap@runet.edu> wrote:
>> if ($valid) {
>>   open (INFILE, $infile) || die ("You Suck");
>>   chop($line = <INFILE>);
>>   while ($line =~ /[#^]/ || $line eq "") {
>>    chop($line = <INFILE>);
>>   }
>
>This is only working one a single line.  No need for a while.

Look at the code.  Maybe it wasn't the best way to write it, but it
makes sense the way it was written.


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

Date: Fri, 16 Oct 1998 02:35:55 GMT
From: wongksp@netvigator.com (Wong Kin Sang)
Subject: Re: One question on writing Perl module
Message-Id: <3626aeee.1809541@news.netvigator.com>

On Thu, 15 Oct 1998 08:39:41 -0300, Arved Sandstrom
<Arved_37@chebucto.ns.ca> wrote:

Thanks for your help first. In fact my question is that in the utility
module I want to add the input string to PATH variable. Therefore I
need to use Win32::Registry to achieve this. However when I try to run
the testing script, it fails and point out that
$HKEY_LOCAL_MACHINE->Open fails. Therefore I want to know why it can't
work.

Thanks

Patrick
>In your package 'utility', for one, just name the subroutine SetPath, not
>utility::SetPath. That's what the "package SomePackage" statement is for,
>after all.
>
>Can't comment on the rest of the code, except to say that it reinforces my
>determination to treat myself with dignity and hence avoid Windows... :-)
>
>Arved (UNIX and MacOS)
>
>



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

Date: 15 Oct 1998 08:40:01 GMT
From: simon@caleddon.jasmine.org.uk (Simon Brooke)
Subject: Re: Programmer's Text Editor
Message-Id: <704cd1$4fm@caleddon.jasmine.org.uk>

In article <361C7CB4.5708@iname.com>,
	Jussi Jumppanen <xidicone@iname.com> writes:
> The latest version of the Zeus programmer's editor is now available:
> 
>   Zeus for Windows 3.x or Win32
>   A powerful text editor/ integrated development environment. Features
>   include Brief, Epsilon, Emacs
                            ^^^^^

I'll believe this when I see it. Full EMACS Lisp compatibility, no
doubt? Built in O-O class browser? Tight integration with CVS? Built
in Web browser? Built in News reader, mail client, diary, moon-phase
calendar, psychiatrist (yes, if you didn't know, Emacs does have a
built in psychiatrist)?

Let's face it, Emacs is the _original_ bloatware. It has more arcane
and mysterious (and even pointless) features than the population of
Asia has had hot dinners.  People who like good old Eight Megabytes
And Constant Swapping, _use_ Emacs, and for us there is no substitute,
no alternative religion. People who don't like it, don't want it at
any price. And it's no good trying to emulate the kaystrokes because
I've never seen two real programmers who have their Emacs set up to
use the same key-bindings anyway.

> or Wordstar emulation,  status bar, 
>   toolbar, configurable syntax colorizing, background compiler, inline
>   error correction, unlimited undo/redo, keyboard macros, scripting 
>   language, templates and more.

 .. yes, of course, all of that ...

>   Version: 2.70 Platforms: Windows 3.x, Windows 95 or NT  Size: 1100k

Version (that I'm using at the moment): X 19.15; Platforms: too many
to list; Size: about fifty megabytes but who's really counting?

> For more details and even some nice screen shots of Zeus in action 
> check out the following web page:

For more details and even some nice images of Emacs in action, check
out any _real_ programmer's screen anywhere in the world ;-)


-- 
simon@jasmine.org.uk (Simon Brooke) http://www.jasmine.org.uk/~simon

	my other car is #<Subr-Car: #5d480>
				;; This joke is not funny in emacs.


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

Date: Fri, 16 Oct 1998 04:15:29 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has registered
Message-Id: <3626C5DF.1BADFBF0@bbnplanet.com>

Brad Murray wrote:
> Oh I think the place should be vegetarian.  Why everyone is so interested
> in roasting and eating their mascots, I will never understand.  It just
> doesn't seem right, somehow.  The camel should be the bouncer.

Nay, I like meat, veggies need not apply unless they want to order the
stuffed peppers or something. :) *mwaahaahah*

e.

After all, the cultivated person's first duty is to
always be prepared to rewrite the encyclopedia.  - U. Eco -


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

Date: 15 Oct 1998 23:46:18 -0400
From: Olaf Meyer <olafm@seas.upenn.edu>
Subject: Redirecting output of the system function
Message-Id: <gbjyaqhxj79.fsf@saul.cis.upenn.edu>

Is there an easy way of redirecting the output of commands
executed via the system function?

I would for example like to store the ouput in a string variable,
similar to the bash command
  files=`pick -from whoever +folder`

Any ideas?

Thanks,
  Olaf  (please also e-mail me, since I don't perl too much)
-- 
 Olaf Meyer                       | mailto://olafm@seas.upenn.edu    |    _~o
 Computer and Information Science | http://www.seas.upenn.edu/~olafm |  _-\_<,
 University of Pennsylvania       |				     | (*)/'(*)
 Philadelphia, PA 19104-6389, USA | PGP: finger -l olafm@seas.upenn.edu


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

Date: Fri, 16 Oct 1998 04:07:11 GMT
From: darrensw@my-dejanews.com
Subject: Reverse foreach loop
Message-Id: <706gpf$v6k$1@nnrp1.dejanews.com>

Hi

I am using the following foreach loop:

foreach $i (1 .. $#array)

But, I want to do this in reverse, like:

foreach $i ($#array .. 1)

Can this be done, if so how?

Thanks for any help

Regards

Darren

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Fri, 16 Oct 1998 04:13:01 GMT
From: darrensw@my-dejanews.com
Subject: Reverse foreach loop
Message-Id: <706h4d$vi0$1@nnrp1.dejanews.com>

Hi

I am using a simple foreach loop;
e.g. foreach $i (0 .. $#array)

What I actually need is for it to go in reverse;

e.g. foreach $i ($#array .. 0)

Can this be done?

If so, how?

Thanks for all help,

regards

Darren


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Thu, 15 Oct 1998 20:25:27 -0500
From: "mostoc" <mostoc@mail.mankato.msus.edu>
Subject: Set up FTP via Perl?
Message-Id: <7067d6$90k$1@nitrogen.mankato.msus.edu>

I know you can do this, I just don't know how.  Can somebody help me?

Chad Moston




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

Date: 16 Oct 1998 01:50:24 GMT
From: mike@mike.stok.co.uk (Mike Stok)
Subject: Re: Set up FTP via Perl?
Message-Id: <7068p0$gsa@news-central.tiac.net>

In article <7067d6$90k$1@nitrogen.mankato.msus.edu>,
mostoc <mostoc@mail.mankato.msus.edu> wrote:
>I know you can do this, I just don't know how.  Can somebody help me?

You should visit the comprehensive perl archive network (CPAN), maybe by
visiting http://www.perl.com/CPAN/ and look at the modules avaialbe for
perl.  There are a couple of big files which list the modules and what
they do.  The libnet bundle includes Net::FTP which is probably what you
want.

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: 16 Oct 1998 02:18:06 GMT
From: gebis@fee.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Set up FTP via Perl?
Message-Id: <706acu$1ja@mozo.cc.purdue.edu>

"mostoc" <mostoc@mail.mankato.msus.edu> writes:

}I know you can do this, I just don't know how.  Can somebody help me?

Go to CPAN, and find Net::FTP.  Whoo!  www.perl.com is a good place
from which to find CPAN, BTW.  I could go more into detail, but it's
all documented already (and far more accurately than I could do in a
USENET posting.)  Good luck.

-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


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

Date: Fri, 16 Oct 1998 02:08:51 GMT
From: Lee.Lindley@bigfoot.com
Subject: Re: Sorry
Message-Id: <7069rk$l2k$1@nnrp1.dejanews.com>

In article <705tni$jq@kiev.wall.org>,
  larry@kiev.wall.org (Larry Wall) wrote:
> In article <362627ED.C42390AC@min.net>, John Porter  <jdporter@min.net> wrote:
> >Larry Wall wrote:
> >>
> >> Perl is worse than Python because people wanted it worse.
> >
> >Meaning "wanted it more badly", I take it?
>
> I intended you to take it however you like.  :-)
>
> Larry
>

Is it ethical for a linguist to make a play on words?

I read it as people wanted Perl to be "worse" because it makes
it more useful.


--
// Lee.Lindley@Bigfoot.com
// Be nice.  It isn't that hard to do and it
// makes people happy.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Fri, 16 Oct 1998 00:56:14 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Sorry
Message-Id: <1dgyuxt.1s9yanzvwev18N@bos-ip-1-106.ziplink.net>

[posted and mailed]

Lee Brandson <rlb@intrinsix.ca> wrote:

> As an occasional watcher of this ng and its predecessor for some two years
> now, I would like to ask whether it is strictly necessary to be as rude as
> possible when answering (or not answering, as the case may be) a question?
> Is this what it takes to be "in the club?

If you were more than an "occasional" watcher of this ng and its
predecessor, then you would know that this very question has been asked
numerous times.  No, it's not in the FAQ.  That's probably because there
is no agreed upon answer; instead it just leads to another drawn-out
debate between people who are unlikely to be convinced to change their
own opinion on the matter.

> Do you enjoy the unending long threads of justifications for such rudeness?

Oh, apparently you do know.  No, I don't enjoy the threads.  And thank
you *so much* for starting yet one more!

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Fri, 16 Oct 1998 00:01:23 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: sorting file entries by time
Message-Id: <n1wV1.28$LH3.123603@nsw.nnrp.telstra.net>

In article <3625B224.EBB86C71@juno.ltd.uk>,
	Lee Musgrave <lee@juno.ltd.uk> writes:

> currently each line is split into an array to be worked on, this i
> have running fine, but what i need now is a sort routine that will
> sort every line in this file so that a have a file where every entry

It isn't entirely clear from your post, but you seem to want to sort
the file before processing the lines? You might want to have a look at
the sort program, if you're on a Unix box. Otherwise you might as well
do it in perl, after processing the lines.

> is in chronological order. You'll probably notice that this line
> also contains the date, but this is not important, i have a function
> which discards all but the current date.  i've had a look at the
> built in sort function, but i don't think that will work without
> splitting the entire file into an array, this file is a couple of
> thousand lines long, and speed is essential.

A couple of thousand lines isn't that much, and perl's sort is quite
good. If you need many accesses to this file, and don't want to sort
it all the time, sort the file once, and keep it in sorted order. Then
any program that reads it can assume it is sorted.

Either use the unix sort for that, or write a little perl script that
does it. You might want to have a look at perlfaq4

# perldoc perlfaq4
How do I sort an array by (anything)?

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | You can't have everything, where would
Commercial Dynamics Pty. Ltd.       | you put it?
NSW, Australia                      | 


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

Date: Fri, 16 Oct 1998 00:56:15 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <1dgyv8f.vxhja4rpws99N@bos-ip-1-106.ziplink.net>

Russell Schulz <Russell_Schulz@locutus.ofB.ORG> wrote:

> > Top 10 Crossposters

> I know I'm in the list because I set followups to non-Perl things out
> of c.l.p.misc (and include c.l.p.m in the Newsgroups: header to make
> it easier to follow the thread out).

I'm in the list this week too.  I didn't bother to check why, but I
assume it's from crossposting between the clp newsgroups.

But don't worry; the list of crossposters is an observation, not an
accusation.

I just try to stay out of the list of Bottom Ten Posters by OCR.  :-)

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Fri, 16 Oct 1998 00:37:20 GMT
From: mark@doddx.com (Mark D.)
Subject: Re: The space deletion woes...
Message-Id: <36279413.77683025@news.supernews.com>

I wanted to report my results back and offer my thanks again to you
guys (and gals!)

The trick that worked for me was:

  $cgi_client{'upfile'} =~ s/\s+//g;

however, I tried:

  $cgi_client{'upfile'} =~ tr/ //;

which did not work. I was trying to remove any and all spaces from the
given string, as the program that it belongs in uses that string in a
URL and some browsers weren't able to convert the string to complete
the URL. (Whatever browser view spaces as, I know its got a % in it :)
)

I tried for hours, but being the newbie that I am I rely alot on
learning from the code that's out there and I've never encountered
this example.

With that said I christen thee U.S.S. Newbie and set you upon the
dejanews seas for the next newbie that's bright enough to look there
for it!

Mark



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

Date: Fri, 16 Oct 1998 00:23:56 GMT
From: mark@doddx.com (Mark D.)
Subject: Re: The space deletion woes...
Message-Id: <362691ee.77133194@news.supernews.com>

I'm absoluty shocked at the quickness your your replies and the level
of help you provided to me- 

thank you all so much, I will try your options out!

Mark



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

Date: Fri, 16 Oct 1998 01:22:57 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: The space deletion woes...
Message-Id: <RdxV1.81$LH3.170236@nsw.nnrp.telstra.net>

In article <36279413.77683025@news.supernews.com>,
	mark@doddx.com (Mark D.) writes:

>   $cgi_client{'upfile'} =~ tr/ //;

tr/ //d;

# perldoc perlop

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Make it idiot proof and someone will
Commercial Dynamics Pty. Ltd.       | make a better idiot.
NSW, Australia                      | 


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

Date: Fri, 16 Oct 1998 01:20:32 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: The space deletion woes...
Message-Id: <Pine.GSO.4.02A.9810151819540.26848-100000@user2.teleport.com>

On Fri, 16 Oct 1998, Mark D. wrote:

> however, I tried:
> 
>   $cgi_client{'upfile'} =~ tr/ //;
> 
> which did not work. 

I imagine that it did what it's documented to do. Did you check the docs
to find out what that was? :-)

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



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

Date: Fri, 16 Oct 1998 04:11:09 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: The space deletion woes...
Message-Id: <3626C4DA.58929ED0@bbnplanet.com>

Mark D. wrote:

> thank you all so much, I will try your options out!

*smooch* no problem. Now read the perldocs and understand what just
transpired :) We have no problem with newbies, we have a problem with
newbies who don't try. Your quandry was an easy mistake. Hope we helped
:)

e.

After all, the cultivated person's first duty is to
always be prepared to rewrite the encyclopedia.  - U. Eco -


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

Date: Fri, 16 Oct 1998 00:56:16 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: The space deletion woes...
Message-Id: <1dgyvgo.8hs2c61stwp0fN@bos-ip-1-106.ziplink.net>

Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> wrote:

> =~ s/\s+?//g;

Useless use of non-greedy matching.  That will never match more than one
space, because it never has a reason to.

Here's a good rule of thumb: non-greedy matching is *never* useful when
it is the last thing in the regex.


$_ = 'foo   bar   baz';

s/\s+?/++$x/ge;

print;
__END__

foo123bar456baz

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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