[11563] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5163 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Mar 18 02:07:24 1999

Date: Wed, 17 Mar 99 23:00:22 -0800
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, 17 Mar 1999     Volume: 8 Number: 5163

Today's topics:
    Re: 2d-array sort (Ronald J Kimball)
        adding a number to an existing value in another file <tgj@snip..net>
    Re: Appending Large Files <ebohlman@netcom.com>
    Re: Array lengths <bwb@dowebpages.com>
        by the way... <bcornwell@mail.peds.lsumc.edu>
    Re: chdir : how do I pass parameters to this function?? (Ronald J Kimball)
    Re: chdir : how do I pass parameters to this function?? (Martien Verbruggen)
    Re: chdir : how do I pass parameters to this function?? (Tad McClellan)
    Re: chdir : how do I pass parameters to this function?? <jlarke@ans.net>
    Re: chdir : how do I pass parameters to this function?? <dillon@grex.cyberspace.org>
        CPAN (Fernando Ariel Gont)
    Re: CPAN (Sam Holden)
        gethostname() (Fernando Ariel Gont)
    Re: gethostname() <mirabai@don't.send.me.spam.ok.frii.com>
        How can I get ALL the content of a HTTP POST, including <Claude.Bonnard@isrec.unil.ch>
    Re: How do I split an list of text into separate lists  (Jim Britain)
    Re: How do I split an list of text into separate lists  (Jim Britain)
    Re: How do I split an list of text into separate lists  <ebohlman@netcom.com>
        how to refresh the html content when I updated it? <zhouyh@263.net>
    Re: how to refresh the html content when I updated it? (Martien Verbruggen)
    Re: how to run scrip on mac via html <bill@fccj.org>
    Re: How to sort a LoL? (Ronald J Kimball)
    Re: Input for PERL Course request (Martin Vorlaender)
    Re: Newbe here again... <madebeer@igc.apc.org>
    Re: Regular Expression Help (Tad McClellan)
        Sending a Unique Image Height From HTML to CGI? (Laertis)
    Re: Server doesnt recognize my .pl files <bill@fccj.org>
        socket timeout (Fernando Ariel Gont)
    Re: socket timeout <mirabai@don't.send.me.spam.ok.frii.com>
    Re: Stats Question (Tad McClellan)
    Re: Testing CGI scripts on a standalone <bill@fccj.org>
    Re: The truth about the Pentium III chip and ID --- **b <bcornwell@mail.peds.lsumc.edu>
        Web Login <simon_ng@pacific.net.sg>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Wed, 17 Mar 1999 23:18:11 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: 2d-array sort
Message-Id: <1dou0yq.t0cvz0bfph4wN@p26.block2.tc2.state.ma.tiac.com>

Federico Abascal <fabascal@gredos.cnb.uam.es> wrote:

> I have tried this way of sorting an array of arrays but it seems it
> doesn't work
> 
> @arrayOfarrays = (["Hello", 23], ["Bye", 4]);
> @ordenado = sort({ $a->[1] <=> $b->[1] } @arrayOfarrays);
>  foreach $tt (@ordenado) {
           ^^^
>   print "\n @$tts \n";
              ^^^^^
>  }
> 
> Is any error in my code?

Yes.  Your variable names do not coincide.  Consider using -w and 'use
strict;'

-- 
 _ / '  _      /         - aka -          rjk@linguist.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: Thu, 18 Mar 1999 00:39:56 -0800
From: "TinP" <tgj@snip..net>
Subject: adding a number to an existing value in another file
Message-Id: <7cq3bi$dc8$1@news1.fast.net>

I wrote a few days ago with a problem and want to commend the group on the
great answer and how fast my post was answered.

I am stuck again and looking for help.
Here is what I have:

In one file I have a database of scores

filename scores.txt
Tom | 56
Bill   | 43
Joe  | 32

In another file I have another list of names and scores for this week.

scores_this_week.txt
Tom | 3
Sue | 15
Mary| 8
Joe | 3

What I wanted to do was this:
If the name isn't already in the scores.txt file I want to add the name and
the score. That is easy enough for me but If the name already exists, I want
to just add the new value to the current number that is already there. Any
suggestions on how do that?

Also I was wondering if someone answers my question what is the proper
netiquette?Should I write back a thanks? Of course I appreciate the help but
don't want to clog the thread with a useless post of thanks even though I am
thankful.

Tom






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

Date: Thu, 18 Mar 1999 06:35:21 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Appending Large Files
Message-Id: <ebohlmanF8s2Ax.HCA@netcom.com>

Vincent P. Mautone <vince@oxxfordinfo.com> wrote:
: I wrote a perl script which is meant to append File A to File B. However,
: once File B reaches 4.3GB(yes, gigabytes), the appends no longer work. We
: have successfully read files larger than 4.3GB yet I do not know why I
: cannot write-append to a file larger than 4.3GB. I am using ActiveState Perl
: 5.005_02 on NT Server 4.0 (SP4). I have included my script below

4.3GB sounds suspiciously close to the point where a 32-bit file pointer 
runs out of steam.



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

Date: Wed, 17 Mar 1999 23:36:20 -0600
From: Bill Binkley <bwb@dowebpages.com>
Subject: Re: Array lengths
Message-Id: <36F090D4.53B66D76@dowebpages.com>

Thanks Larry

Larry Rosler wrote:

> [Posted and a courtesy copy sent.]
>
> In article <36EB08FB.DC1F54B@dowebpages.com> on Sat, 13 Mar 1999
> 18:55:23 -0600, Bill Binkley <bwb@dowebpages.com >says...
> > @ppw = ();
> > @ppw[0]=();
>
> This should be:
>
>   $ppw[0] = [];
>
> > $ppw[0][0]="adm\/";
>                  ^   Why???
>
> > $ppw[0][1]="adm.htm";
> > $ppw[0][2]="detail.htm";
> > $ppw[0][3]="help.htm";
> > @ppw[1]=();
> > $ppw[1][0]="all\/";
>
> Similar problems for the above two lines.
>
> > Length of @ppw can be obtained with $#ppw
>
> Actually, length - 1 (highest index).
>
> > Is there a corresponding way to get the length of $#ppw[0] and
> > $#ppw[1]
>
>   $#{$ppw[0]}   # == 3
>   $#{$ppw[1]}   # == 0
>
> I didn't know this off the top of my head, but I tried a few ways and
> found one that worked.  Computing is an 'experimental science'!
> Experiment!!!
>
> In retrospect, it seems obvious, though:
>
>   $#ARRAY-NAME  or $#{ARRAY-REF}
>
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Company
> http://www.hpl.hp.com/personl/Larry_Rosler/
> lr@hpl.hp.com

--
Bill Binkley
Software Composers, Inc.
http://www.dowebpages.com

Go to this URL for JavaScript examples
and sample code. For JavaScript at it's
best see the "European Tour". If you
have a question about the examples, put
it in the comments of the visitors form.




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

Date: Wed, 17 Mar 1999 22:53:43 -0600
From: "Brent Cornwell, Pediatrics Computer Administrator" <bcornwell@mail.peds.lsumc.edu>
Subject: by the way...
Message-Id: <7cq13a$7mc$1@fox.comm.net>

take this thread to:   comp.sys.intel
it's more relevant there..




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

Date: Wed, 17 Mar 1999 23:18:12 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: chdir : how do I pass parameters to this function???
Message-Id: <1dou17d.qaruwq175c41cN@p26.block2.tc2.state.ma.tiac.com>

knataraj <knataraj@worldnet.att.net> wrote:

> while(<STDIN>) {
> 
>    $dir=$_;
> chdir $dir
>      or print " Couldn't change dir to $dir  reason: $!\n";
>  print `pwd` ;
> }
> 
> this script always gives me  "directory not found" error

You forgot to chomp() the contents of $_.  You're trying to chdir to a
directory whose name ends with a newline.

while (defined($dir = <STDIN>)) {
  chomp $dir;
  chdir $dir
    or print "" Couldn't change dir to $dir  reason: $!\n";
}


Good job remembering to check the return value!

-- 
 _ / '  _      /         - aka -          rjk@linguist.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: Thu, 18 Mar 1999 04:37:40 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: chdir : how do I pass parameters to this function???
Message-Id: <oq%H2.302$hp2.2441@nswpull.telstra.net>

No need to post this twice.

In article <36F055F8.A2A65D22@worldnet.att.net>,
	knataraj <knataraj@worldnet.att.net> writes:

> while(<STDIN>) {

	chomp;

	There's a newline at the end of the line you just read in.

>    $dir=$_;

Why don't you just do:

while (defined($dir = <STDIN))
{
	chomp $dir;

> I have perl 5.002

Time to upgrade. That is a seriously out of date perl version with
many bugs, some of which are serious.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | 
Commercial Dynamics Pty. Ltd.       | Curiouser and curiouser, said Alice.
NSW, Australia                      | 


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

Date: Wed, 17 Mar 1999 17:19:48 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: chdir : how do I pass parameters to this function???
Message-Id: <4q9pc7.sma.ln@magna.metronet.com>

knataraj (knataraj@worldnet.att.net) wrote:

:          Here's is the pbm. I'll be grateful if anyone of ou can give me


   What is a pbm?


: #!/usr/bin/perl


   You have a bug on the very first line there...

      #!/usr/bin/perl -w


: while(<STDIN>) {
:    $dir=$_;

   Does the directory name have a newline in it?

   The $dir variable does.

      chomp $dir;


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 18 Mar 1999 00:42:00 -0500
From: Jason Larke <jlarke@ans.net>
Subject: Re: chdir : how do I pass parameters to this function???
Message-Id: <vat1zin8ic7.fsf@anthem.aa.ans.net>

>>>>> On 18 Mar 1999 02:27:12 GMT, knataraj
>>>>> <knataraj@worldnet.att.net> said:

k> AAAAAAAAAAAAAAHHHHHh!!!!
k>          Here's is the pbm. I'll be grateful if anyone of ou can give me
k> a solution..

k>    $dir=$_;
k> chdir $dir
k>      or print " Couldn't change dir to $dir  reason: $!\n";
k>  print `pwd` ;
k> }

k> this script always gives me  "directory not found" error

k> if I define $dir="/root" then the script works fine !!!!! ?????
k> what's the reason & how do I pass variable values to chdir function.

You need to chomp your input. Right now the trailing return is
getting passed through to the system.
-- 
Jason Larke- jlarke@ans.net- http://www.nnaf.net/~jlarke Send mail for PGP key
I don't speak for UUnet Worldcom or the international communist conspiracy.
"The Rock can't say I quit, because the Rock only talks in the third person."
"People change, and smile: but the agony abides."-T.S. Eliot, The Dry Salvages


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

Date: Wed, 17 Mar 1999 21:15:23 -0800
From: "Dillon Savage" <dillon@grex.cyberspace.org>
Subject: Re: chdir : how do I pass parameters to this function???
Message-Id: <7cq29n$2hl1@enews3.newsguy.com>

It could be because when you get input from <STDIN>, it adds a "\n" to the
end of the string. So when you type "/root," it interprets it as "/root\n,"
and since there is no "/root\n," it returns an error.

Just a thought...

#!/usr/bin/perl

while(<STDIN>) {
    chomp;
    chdir || print "Couldn't change to $_:$!";
    print `pwd`;
}

knataraj wrote in message <36F055AA.D39980AF@worldnet.att.net>...
>AAAAAAAAAAAAAAHHHHHh!!!!
>
>         Here's is the pbm. I'll be grateful if anyone of ou can give me
>a solution..
>
>#!/usr/bin/perl
>
>while(<STDIN>) {
>
>   $dir=$_;
>chdir $dir
>     or print " Couldn't change dir to $dir  reason: $!\n";
> print `pwd` ;
>}
>
>this script always gives me  "directory not found" error
>
>if I define $dir="/root" then the script works fine !!!!! ?????
>what's the reason & how do I pass variable values to chdir function.
>
>I have perl 5.002
>
>
>
>Kanda
>




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

Date: Wed, 17 Mar 1999 23:39:42 GMT
From: fgont@hotpop.com (Fernando Ariel Gont)
Subject: CPAN
Message-Id: <7copeq$8gb$3@vnews.prima.com.ar>

Hullo All , hope you are having a nice day!!

Hi, I was looking for CPAN, but couldn't find it all in a file.

Is the CPAN available in *only* *one* large file anyware?

Read U!
Fernando Ariel Gont

e-mail:   fgont@hotpop.com
Web site: http://members.xoom.com/gont/


* Gont's Tagliner *
"My past is my wisdom to use today . . . my future is my wisdom yet to

 experience. Be in the present moment because that is where life
resides." 
- Unknown -

Bye!

Fernando Ariel Gont

E-mail:   fgont@hotpop.com
Web site: http://members.xoom.com/gont/
Fidonet:  4:900/470.10




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

Date: 18 Mar 1999 04:44:57 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: CPAN
Message-Id: <slrn7f1168.aak.sholden@pgrad.cs.usyd.edu.au>

On Wed, 17 Mar 1999 23:39:42 GMT, Fernando Ariel Gont <fgont@hotpop.com> wrote:
>Hullo All , hope you are having a nice day!!
>
>Hi, I was looking for CPAN, but couldn't find it all in a file.
>
>Is the CPAN available in *only* *one* large file anyware?

I hope not...

;zcat ls-lR.gz | perl -ane '$sum+=$F[3]; END {print $sum,"\n";}'
723670271

ls-lR.gz is from the CPAN mirror I use. Do you really want
to download a ~690Mb file  (OK I double/triple/whatever counted hard
links, counted symlinks, etc)?

Possibly it would be better to download the files you need. If you
must get everything, then it is probably nice to ask whoever runs
the mirror you use, and just create a private mirror for yourself
(that may be suitable if you want it on your LAN for a lot of
people I guess).

After creating a personal mirror (wget is a program that comes to
mind) you could then use tar to create '*only* *one* large file'.

-- 
Sam

I took the initiative in creating the Internet. 
	--Al Gore



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

Date: Wed, 17 Mar 1999 23:39:40 GMT
From: fgont@hotpop.com (Fernando Ariel Gont)
Subject: gethostname()
Message-Id: <7copen$8gb$1@vnews.prima.com.ar>

Hullo All , hope you are having a nice day!!

Hi, is there any other way to get the local host name rather than
using
'localhost' ?

I mean, in C there's gethostname()...

Isn't there any Perl function to do this, rather than depending on the
operating system?

Read U!
Fernando Ariel Gont

e-mail:   fgont@hotpop.com
Web site: http://members.xoom.com/gont/


* Gont's Tagliner *
ATWOODS COROLLARY
No books are lost by lending, except those you particularly wanted to
keep.



Bye!

Fernando Ariel Gont

E-mail:   fgont@hotpop.com
Web site: http://members.xoom.com/gont/
Fidonet:  4:900/470.10




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

Date: Wed, 17 Mar 1999 22:49:32 -0700
From: mirabai <mirabai@don't.send.me.spam.ok.frii.com>
Subject: Re: gethostname()
Message-Id: <Ts0I2.285$Yc8.187638272@news.frii.net>

$ man perlfunc | grep -c geth # returns '8' on my machine.

Fernando Ariel Gont wrote:
> 
> Hullo All , hope you are having a nice day!!
> 
> Hi, is there any other way to get the local host name rather than
> using
> 'localhost' ?
> 
> I mean, in C there's gethostname()...
> 
> Isn't there any Perl function to do this, rather than depending on the
> operating system?
> 
> Read U!
> Fernando Ariel Gont
> 
> e-mail:   fgont@hotpop.com
> Web site: http://members.xoom.com/gont/
> 
> * Gont's Tagliner *
> ATWOODS COROLLARY
> No books are lost by lending, except those you particularly wanted to
> keep.
> 
> Bye!
> 
> Fernando Ariel Gont
> 
> E-mail:   fgont@hotpop.com
> Web site: http://members.xoom.com/gont/
> Fidonet:  4:900/470.10

-- 
========================================================
| nicholas dronen             mirabai at frii dot com  |
| "Let us go then, you and I . . ." -- T.S. Eliot      |
========================================================


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

Date: Wed, 17 Mar 1999 17:50:53 +0100
From: Claude Bonnard <Claude.Bonnard@isrec.unil.ch>
Subject: How can I get ALL the content of a HTTP POST, including new line?
Message-Id: <36EFDD6C.86FA1F99@isrec.unil.ch>


--------------FB6A7803BFAA7565FEFBC08E
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello!

I have a (probably ) basic problem in getting, from a perl script , data
which are POSTed from a client.

In  fact, I gest, using CGI, every "words" I am posting, but NOT the
"\n"


I send:
PROGRAM programname
DATA LIB base1
LOWSCORE 10
BEGIN
> query sequence to test the parameter extraction
MNTIKILIGLLGIFLFSLSGIVSAQSDATTQLSQLLSNFRTYQAKF

the script looks like:


--------------------------------------------
#!/usr/local/bin/perl -w

use CGI;
my $form = new CGI();
#check if something is coming back...
print ($form->header());
print ('<h1 align=center>Hi!</h1>');
print ('<hr>');
print ("\n");

open (FORM, $blast_form);
binmode (FORM);
my $blast_form = new CGI();
open (FILE, ">/tmp/REQUEST.SAV");
binmode(FILE);
$blast_form->save('FILE');
print ("$blast_form","\n");


and my result file looks like:
keywords=PROGRAM
keywords=progname
keywords=DATALIB
keywords=base1
keywords=LOWSCORE
keywords=BEGIN
keywords=%3E
keywords=query
keywords=sequence
keywords=to
keywords=test
keywords=the
keywords=parameter
keywords=extraction
keywords=MNTIKILIGLLGIFLFSLSGIVSAQSDATTQLSQLLSNFRTYQAKF




As you see, the line breaks "\n" are NOT transmitted, apparently, and
I cannot get the lines as posted :-((

I do not need to write the POST into a file: I just want to get the
parameters to start a new program from the script. I thus need to keep
the organisation of the POSTed data WITH the "\n" in order to select the
parameters and query!

Do you know any method to get this (ALL this) in a buffer, a variable or
somewere?

Thanks a lot for your help!

Regards
Claude

--
Claude Bonnard Ph.D.
ISREC (Swiss Institute for Experimental Cancer Research)
Bioinformatics Group
Ch des Boveresses 155
CH-1066 Epalinges
Switzerland

email: Claude.Bonnard@isrec.unil.ch
phone: [41-21]-692-5891/-2236
  fax: [41-21]-652-6933



--------------FB6A7803BFAA7565FEFBC08E
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
Hello!
<P>I have a (probably ) basic problem in getting, from a perl script ,
data which are POSTed from a client.
<P>In&nbsp; fact, I gest, using CGI, every "words"&nbsp;I&nbsp;am posting,
but NOT the "\n"
<BR>&nbsp;
<P>I send:
<BR>PROGRAM programname
<BR>DATA LIB base1
<BR>LOWSCORE 10
<BR>BEGIN
<BR>> query sequence to test the parameter extraction
<BR>MNTIKILIGLLGIFLFSLSGIVSAQSDATTQLSQLLSNFRTYQAKF
<P>the script looks like:
<BR>&nbsp;
<P>--------------------------------------------
<BR>#!/usr/local/bin/perl -w
<P>use CGI;
<BR>my $form = new CGI();
<BR>#check if something is coming back...
<BR>print ($form->header());
<BR>print ('&lt;h1 align=center>Hi!&lt;/h1>');
<BR>print ('&lt;hr>');
<BR>print ("\n");
<P>open (FORM, $blast_form);
<BR>binmode (FORM);
<BR>my $blast_form = new CGI();
<BR>open (FILE, ">/tmp/REQUEST.SAV");
<BR>binmode(FILE);
<BR>$blast_form->save('FILE');
<BR>print ("$blast_form","\n");
<BR>&nbsp;
<P>and my result file looks like:
<BR>keywords=PROGRAM
<BR>keywords=progname
<BR>keywords=DATALIB
<BR>keywords=base1
<BR>keywords=LOWSCORE
<BR>keywords=BEGIN
<BR>keywords=%3E
<BR>keywords=query
<BR>keywords=sequence
<BR>keywords=to
<BR>keywords=test
<BR>keywords=the
<BR>keywords=parameter
<BR>keywords=extraction
<BR>keywords=MNTIKILIGLLGIFLFSLSGIVSAQSDATTQLSQLLSNFRTYQAKF
<BR>&nbsp;
<BR>&nbsp;
<BR>&nbsp;
<P>As you see, the line breaks "\n" are NOT transmitted, apparently, and
I&nbsp;cannot get the lines as posted :-((
<P>I do not need to write the POST into a file: I just want to get the
parameters to start a new program from the script. I&nbsp;thus need to
keep the organisation of the POSTed data WITH the "\n" in order to select
the parameters and query!
<P>Do you know any method to get this (ALL this) in a buffer, a variable
or somewere?
<P>Thanks a lot for your help!
<P>Regards
<BR>Claude
<PRE>--&nbsp;
Claude Bonnard Ph.D.
ISREC (Swiss Institute for Experimental Cancer Research)
Bioinformatics Group
Ch des Boveresses 155
CH-1066 Epalinges
Switzerland</PRE>

<PRE>email: Claude.Bonnard@isrec.unil.ch
phone: [41-21]-692-5891/-2236
&nbsp; fax: [41-21]-652-6933</PRE>
&nbsp;</HTML>

--------------FB6A7803BFAA7565FEFBC08E--



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

Date: Thu, 18 Mar 1999 04:34:30 GMT
From: jbritain@home.com (Jim Britain)
Subject: Re: How do I split an list of text into separate lists of paragraphs
Message-Id: <36f0802b.6678786@news>

On Wed, 17 Mar 1999 10:38:00 -0600, Forrest Reynolds
<dropzone@mail.utexas.edu> wrote:

>Hello,
>    You can switch from processing lines to processing paragraphs by setting $/:
>
>local $/ = '';    #sets itself back when you're done
>
>	This is explained in the Perl Cookbook p.282, 
>also perlvar(1), "special variables" chap2-camel.

That's fine for file processing, but how do you apply it for array
processing?  Remember, the text is already stored in @abstracts

I always see this discussed for file operations, and have never seen
it discussed for array operations.




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

Date: Thu, 18 Mar 1999 04:53:29 GMT
From: jbritain@home.com (Jim Britain)
Subject: Re: How do I split an list of text into separate lists of paragraphs
Message-Id: <36f18337.7458543@news>

On Wed, 17 Mar 1999 14:30:54 GMT, Eric Bohlman <ebohlman@netcom.com>
wrote:

>Jim Britain <jbritain@home.com> wrote:
>
>: There's got to be a better way to break text to paragraphs..
>
>
>: Code snippet:
>
>:                foreach (@abstract){
>:                     if (/^$/ or $set){
>:                         push(@para2, $_);
>:                     $set=1;
>:                     }else{
>:                         push(@para1, $_);
>:                     }
>:                 }
>
>: I can forsee the day, when I may need more than two paragraphs, and
>: for a week now, I have been trying to generate a list of paragraphs
>: for an arbitrary number of paragraphs without success.
>
>You'll probably want to use a two-dimensional array ('list of lists' aka 
>lol) to store the paragraphs, rather than separate variables.  We'll call 
>it @paras.
>
>my $nparas=0;
>foreach (@abstract){
>  ++$nparas if /^$/;
>  push(@{$paras[$nparas]}, $_);
>}
>
>Note that this duplicates your code's behavior of treating the blank line 
>between paragraphs as the first line of the next paragraph.

Yes, this is along the lines of what I am looking for.  With a C and
C++ background I was going nuts with references, and dereference
syntax.  Seems that references are explained all over the place, but
dereferencing is sorta glossed over with single critical lines of text
here and there in the documentation.

But this example is clear.

Re your Note -- the Text::Format module will drop the blank lines, so
that is not a problem in this case -- That behavior was what prompted
splitting to separate paragraphs to begin with.

I might also try setting the record separator locally, rather than
incrementing on blank lines (extra blank lines == empty paragraphs)?

Time to play, when a little less burnt.




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

Date: Thu, 18 Mar 1999 06:22:58 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: How do I split an list of text into separate lists of paragraphs
Message-Id: <ebohlmanF8s1qA.GJ1@netcom.com>

Jim Britain <jbritain@home.com> wrote:
: Yes, this is along the lines of what I am looking for.  With a C and
: C++ background I was going nuts with references, and dereference
: syntax.  Seems that references are explained all over the place, but
: dereferencing is sorta glossed over with single critical lines of text
: here and there in the documentation.

Probably the key rule to remember about dereferencing is "dereferencing 
binds tighter than subscripting."  Thus '@$ref[$index]' means "the array 
slice built from the index'th element of the array referenced by $ref," 
not "the array referenced by the index'th element of @ref."  To get the 
latter, you'd need '@{$ref[$index]}'.


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

Date: Thu, 18 Mar 1999 11:09:24 +0800
From: "wild horse" <zhouyh@263.net>
Subject: how to refresh the html content when I updated it?
Message-Id: <36f06e74@news-1.net-gw.net>

I use perl to make a BBS,now It can work!
I use a frame:top is BBS content,bottom is submit form.
But when I submit a form data,I wish the BBS content
can refresh,I don't know how to do this,
On the BBS content html,I use a link to itself,but
when click on it,the html shown is now the newly version.
can anyone help me?

I'm not usually on newagroup,can you send me a private
mail?

thanks!







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

Date: Thu, 18 Mar 1999 04:39:30 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: how to refresh the html content when I updated it?
Message-Id: <6s%H2.307$hp2.2441@nswpull.telstra.net>

In article <36f06e74@news-1.net-gw.net>,
	"wild horse" <zhouyh@263.net> writes:
> I use perl to make a BBS,now It can work!
> I use a frame:top is BBS content,bottom is submit form.
> But when I submit a form data,I wish the BBS content
> can refresh,I don't know how to do this,

The same way you would do this in any other language. It has nothing
to do with programming. It has to do with HTML and stuff. Ask on one
of the comp.infosystems.www.* groups.

> I'm not usually on newagroup,can you send me a private
> mail?

No.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | Unix is user friendly. It's just
Commercial Dynamics Pty. Ltd.       | selective about its friends.
NSW, Australia                      | 


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

Date: Wed, 17 Mar 1999 23:48:40 -0500
From: "Bill Jones" <bill@fccj.org>
Subject: Re: how to run scrip on mac via html
Message-Id: <36f08594.0@usenet.fccj.cc.fl.us>

In article <36F03D9F.4D64DD56@imago.hr>, Super-User <zax@imago.hr> wrote:


> I am new to perl and this newsgroup, so please be gentle with the
> answers.
>
> Is there something I should put down in the first line of the script
> like a path to perl app, and how to set it.
>

You will need an HTTP (www) server to run .shtml or .cgi CGIs,
but you can just run MacPerl code on a Mac,
no special setup other then proper installation
of MacPerl.

HTH,
-Sneex-  :]
________________________________________________________________________
Bill Jones  |  FCCJ Webmaster  |  http://www.fccj.org/cgi/mail?webmaster
FCCJ  |  501 W State St  |  Jacksonville, FL 32202  |  1 (904) 632-3089

         Jacksonville Perl Mongers
         http://jacksonville.pm.org
         jax@jacksonville.pm.org


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

Date: Wed, 17 Mar 1999 23:18:14 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: How to sort a LoL?
Message-Id: <1dou1uu.6b1ohxdcjru0N@p26.block2.tc2.state.ma.tiac.com>

Tad McClellan <tadmc@metronet.com> wrote:

> #!/usr/bin/perl -w
> use strict;
> 
> my @ra = ( ['Bubba', 250],
>            ['Joe', 200],
>            ['Mary', 225]
>          );
> 
> # Schwartzian Transform
> my @sorted = map  { $_->[0] }
>              sort { $a->[1] <=> $b->[1] }
>              map  { [ $_, $$_[1] ] } @ra;
> 
> foreach (@sorted) {
>    print "$$_[0] ==> $$_[1]\n";
> }

Why the heck are you using a Schwartzian Transform??


It's a very good sign that a Schwartzian Transform is overkill when you
sort without it without changing the sort subroutine.


#!/usr/bin/perl -w
use strict;

my @ra = ( ['Bubba', 250],
           ['Joe', 200],
           ['Mary', 225]
         );

my @sorted = sort { $a->[1] <=> $b->[1] } @ra;

foreach (@sorted) {
   print "$_->[0] ==> $_->[1]\n";
}


-- 
 _ / '  _      /         - aka -          rjk@linguist.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: Thu, 18 Mar 1999 05:55:07 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: Input for PERL Course request
Message-Id: <36f0872b.524144494f47414741@radiogaga.harz.de>

William D. Redman (wredman@ycc.kodak.com) wrote:
: I am working on putting together an introduction class for scripting in
: awk and PERL. [...] This course is to be an offering in
: IT, and within the System Administration concentration. I am looking
: forward to putting together some fun labs with SA tasks. I need some
: help starting out simply.  What  I am looking for is resources, besides
: CPAN, for material. [...]

Have a look at Randal Schwartz' Unix Review column at
http://www.stonehenge.com/merlyn/UnixReview/
That could give you some ideas for your SA labs.

cu,
  Martin
--
                        | Martin Vorlaender | VMS & WNT programmer
 VMS is today what      | work: mv@pdv-systeme.de
 Microsoft wants        |       http://www.pdv-systeme.de/users/martinv/
 Windows NT 8.0 to be!  | home: martin@radiogaga.harz.de


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

Date: Wed, 17 Mar 1999 18:33:40 -0800 (PST)
From: Michael de Beer <madebeer@igc.apc.org>
Subject: Re: Newbe here again...
Message-Id: <APC&1'0'50775d90'868@igc.apc.org>

the manpage perlre will tell you.

-Michael


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

Date: Wed, 17 Mar 1999 17:22:55 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Regular Expression Help
Message-Id: <vv9pc7.sma.ln@magna.metronet.com>

Gala Grant (gala@sonic.net) wrote:
: I am trying to remove a varying amount of a string from the end of it.

: "c:\\web\\content\\tbuedit\\alpha\\tools\\pressroom\\releases\\"

: what I need is to be able to remove the end of the string up to the nth set
: of \\.  


   There are no consecutive backslash characters in that string.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Thu, 18 Mar 1999 06:36:46 GMT
From: lerna@terna.com (Laertis)
Subject: Sending a Unique Image Height From HTML to CGI?
Message-Id: <36f09ca8.19580233@news.supernews.com>

Well, nobody has really answered a very simple question:

How do I get the size of an image in CGI?

When I try

($width,$height) = imgsize("friend.jpg");

I get an error from any browser that I use to call the CGI program.
Now, here is an alternate question:  I have a long FORM with twenty
pictures in it. One of the inputs for each picture is HIDDEN, has the
name  NAME="picture"  and has the value "HEIGHT 157" (or some other
number instead of 157).
I am trying to send to the CGI program the HEIGHT of a selected
picture. Obviously, I cannot just send "picture" because then
I will always send the CGI the value of THE LAST picture (the 20th).
How do I modify the FORM so that I can send the relevant height for
each selected picutre? For example, if the user selects picture
number 11, I should be able to send ITS OWN HEIGHT.
Thank you for your help.

With best regards,

tatabu@ministre.net





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

Date: Wed, 17 Mar 1999 23:51:48 -0500
From: "Bill Jones" <bill@fccj.org>
Subject: Re: Server doesnt recognize my .pl files
Message-Id: <36f08651.0@usenet.fccj.cc.fl.us>

In article <36F00DCD.3500D97C@1185design.com>, mikej <mikej@1185design.com>
wrote:


<snip>

> The requested method POST is not allowed for the URL (url to my .pl file
> would be here)
>
> This most likely has to do with some small, inconspicous server setting
> somewhere, but I have no clue how to fix it to recognize my perl
> scripts. If anyone knows, please help!

Did you ask in a WWW-related newsgroup?  The answer is
WWW-server dependent, but would be somewhere inside the
CGI settings, more than likely.

Seriously,
-Sneex-  :]
________________________________________________________________________
Bill Jones  |  FCCJ Webmaster  |  http://www.fccj.org/cgi/mail?webmaster
FCCJ  |  501 W State St  |  Jacksonville, FL 32202  |  1 (904) 632-3089

         Jacksonville Perl Mongers
         http://jacksonville.pm.org
         jax@jacksonville.pm.org


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

Date: Wed, 17 Mar 1999 23:39:41 GMT
From: fgont@hotpop.com (Fernando Ariel Gont)
Subject: socket timeout
Message-Id: <7copeo$8gb$2@vnews.prima.com.ar>

Hullo All , hope you are having a nice day!!

How can I set a timeout to a try for connection?

I mean, I use sockets, but when I try to connect to a server, it waits
for
about ten seconds before reporting that it cannot connect to the
server...

I want to reduce this timeout timing.... how can I do it?

Read U!
Fernando Ariel Gont

e-mail:   fgont@hotpop.com
Web site: http://members.xoom.com/gont/


* Gont's Tagliner *
 ...If this is hell, then where are all the lawyers?

Bye!

Fernando Ariel Gont

E-mail:   fgont@hotpop.com
Web site: http://members.xoom.com/gont/
Fidonet:  4:900/470.10




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

Date: Wed, 17 Mar 1999 22:47:25 -0700
From: mirabai <mirabai@don't.send.me.spam.ok.frii.com>
Subject: Re: socket timeout
Message-Id: <Uq0I2.284$Yc8.187638272@news.frii.net>

Consult the Sockets-FAQ on this.

	http://www.lcg.org/sock-faq/
	http://www.lcg.org/sock-faq/detail.php3?id=36

	The answer is to use alarm() to set the timeout.
	The perlfunc manpage has more information on this.

	Best,

	Nicholas

Fernando Ariel Gont wrote:
> 
> Hullo All , hope you are having a nice day!!
> 
> How can I set a timeout to a try for connection?
> 
> I mean, I use sockets, but when I try to connect to a server, it waits
> for
> about ten seconds before reporting that it cannot connect to the
> server...
> 
> I want to reduce this timeout timing.... how can I do it?
> 
> Read U!
> Fernando Ariel Gont

-- 
========================================================
| nicholas dronen             mirabai at frii dot com  |
| "Let us go then, you and I . . ." -- T.S. Eliot      |
========================================================


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

Date: Wed, 17 Mar 1999 17:24:35 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Stats Question
Message-Id: <33apc7.sma.ln@magna.metronet.com>

Steve Veloudos (zebra@cyberhighway.net) wrote:
: I have just installed Hitlog 1.1 on my site which keeps track of hits and where
: they are coming from. My question is that it needs server side includes to run
: so I have to run it off my main page with a .shtml prefix. I set up a redirect
: from my main page (index.html) but it looses the info on where the visitor came
: from. Is there any way to either do a redirect while keeping the refering web
: site of where the visitor came from or runnig a ssi from a non .shtml page?


   What is your Perl question?


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Wed, 17 Mar 1999 23:55:06 -0500
From: "Bill Jones" <bill@fccj.org>
Subject: Re: Testing CGI scripts on a standalone
Message-Id: <36f0871c.0@usenet.fccj.cc.fl.us>

In article <36f00c66.102515890@wv-proxy>, jcasey@workingventures.ca (John 
Casey) wrote:


> Ahhhhhhh...now maybe I can get some answers. I am a beginner as well.
> I have OMNIHTTPd and Perl 5.004 installed. I have tried using reliable
> code to return the HTTP_REFERER variable and it just does not work.
> Have you noticed this as well? The reason I asked you is you are also
> running OMNIHTTPd and I believe that is the culprit.


Since neither supplied any code examples of what was tried,
I could hazard a guess and ask -

Did you try using the CGI.pm modules to get the HTTP_REFERER ?

HTH,
-Sneex-  :]
________________________________________________________________________
Bill Jones  |  FCCJ Webmaster  |  http://www.fccj.org/cgi/mail?webmaster
FCCJ  |  501 W State St  |  Jacksonville, FL 32202  |  1 (904) 632-3089

         Jacksonville Perl Mongers
         http://jacksonville.pm.org
         jax@jacksonville.pm.org


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

Date: Wed, 17 Mar 1999 22:51:10 -0600
From: "Brent Cornwell, Pediatrics Computer Administrator" <bcornwell@mail.peds.lsumc.edu>
Subject: Re: The truth about the Pentium III chip and ID --- **boycott info**
Message-Id: <7cq0ug$7m2$1@fox.comm.net>

Greg Gershowitz wrote in message <36ee69a8.992557692@news.vnet.net>...
> Someone tell my why this is such a big deal?  Every unix box in
> existance has a unique ID.  It's the hostid.  What's it for?
> Licensing, mostly.  Of course unix licensing is far more mature than
> for windows.  Heck, even a 486 can be made to cough up a hostid.  Of
> course, I don't know of any cases where that hostid get transmitted to
> a vendor, but what's to stop it from happening?


the problem with Intel's PSN is not the fact that it actually HAS a serial
number, but their REASONING behind putting it in the chip. They said it
would improve e-commerce. HOW exactly would it improve it, other than verify
the identification of the computer (and possibly, but not always, the
user)... The problem comes in when (and i've already heard people wanting to
do this) web admins start to incorporate the processor identification into
their servers, so as to associate a specific serial number (the PSN of the
user's computer), with any and all accounts that user may have at that
website... That alone doesn't garuntee that the person using the computer is
the owner of the account... and also, making scripts with such an
association makes a mess and several arguments between user and webmaster,
when the user tries to access his/her accounts from another computer.

 ...and who's to say that the original owner of the processor isn't going to
sell it to someone else? and then they'd have "authorization" to access
his/her accounts?????!!!!

 ...and i'm sure crackers have already designed a worm to go around the web,
extracting serial numbers when it comes across P3 systems....

just a little to think about...

Brent Cornwell, Computer Support Administrator
Pediatrics Dept., LSU Medical






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

Date: Thu, 18 Mar 1999 13:24:12 +0800
From: Simon Ng <simon_ng@pacific.net.sg>
Subject: Web Login
Message-Id: <36F08DFC.146436A@pacific.net.sg>

Hi, Can anybody help me.

How to create a webpage that requires user to login with password using
perl?

Thank you.

Regards
Simon Ng




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

Date: 12 Dec 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 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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