[11084] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4684 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 19 00:05:14 1999

Date: Mon, 18 Jan 99 21:00:18 -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           Mon, 18 Jan 1999     Volume: 8 Number: 4684

Today's topics:
    Re: A plea for less goofy signature files! <gellyfish@btinternet.com>
    Re: append to beginning of file <gellyfish@btinternet.com>
    Re: append to beginning of file <eugene@snailgem.org>
    Re: Array slices with a maximum length (Ronald J Kimball)
        as400 net.data <richardr@ldr.com>
        Binary and Hex number conversion <markn_nospam_@mincom.com>
        Can I do this is Perl? <darreld@mail.his.com>
    Re: CGI error with C extensions in PERL <gellyfish@btinternet.com>
        file ownership in NT jmpnz@my-dejanews.com
    Re: foreach dilemma (Ronald J Kimball)
    Re: Help: Advanced Search and Replace Question (Abigail)
        How to best process a large CGI form? jlatifi@tsicable.com
    Re: How to get IP address of a local machine under NT <gellyfish@btinternet.com>
        How to link image in Perl script ? <ex5316@netvigator.com>
    Re: How to link image in Perl script ? (Sam Holden)
    Re: Including a CGI script in a Web Page <jamion@geocities.com>
    Re: Newbie Question (Larry Rosler)
    Re: Odering an Array <jamion@geocities.com>
        pattern matching between multiple lines in a file <sysop@scbbs.com>
    Re: Perl Criticism (Randal L. Schwartz)
    Re: perl Help (Sam Holden)
    Re: Perl Web browser problem (Abigail)
    Re: Problem with Perl script <jamion@geocities.com>
        Questions about cookies <jdebay@NOSPAMearthlink.net>
    Re: Secuity hole with perl (suidperl) and nosuid mounts (Peter Samuelson)
    Re: split not working... <scott.craig@moh.hnet.bc.ca>
    Re: Statistics for comp.lang.perl.misc <allan@due.net>
    Re: Using GetOptions? (Ronald J Kimball)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 18 Jan 1999 22:46:44 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: A plea for less goofy signature files!
Message-Id: <780dkk$14r$1@gellyfish.btinternet.com>

On 16 Jan 1999 11:08:46 PST Phlip wrote:
> 
>                              - depends on the QA format of public
> fora to answer questions which are then warehoused; in DejaNews or
> in each list server's archives. 

So what you are saying is that we should pursue BS5750 (ISO90000 I believe)
certification in our posts here ?

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 19 Jan 1999 02:47:33 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: append to beginning of file
Message-Id: <780ro5$1a8$1@gellyfish.btinternet.com>

On Mon, 18 Jan 1999 08:17:16 -0600 Tad McClellan wrote:
> Uri Guttman (uri@home.sysarch.com) wrote:
> 
> : not only is this an FAQ but the stupid oxymoron "append to beginning of
> : a file" is actually mentioned in the title of this FAQ. how convenient!
> 
> 
>    This has been mentioned here before. It seemed so strange that
>    I actually remembered it.
> 
>    "append" does not imply any particular position, though common
>    usage seems to imply "at the end".
> 
>    My Websters says:
> 
>       1: attach, affix
>       2: to add as a supplement or appendix
> 

Thats as maybe but I prefer 'prepend' in this context.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Mon, 18 Jan 1999 23:59:34 -0500
From: Eugene Sotirescu <eugene@snailgem.org>
Subject: Re: append to beginning of file
Message-Id: <36A41136.E917AEB0@snailgem.org>

Tad McClellan wrote:
> 
>    "stupid oxymoron" _is_ a redundancy though.

1. You mean that something like "moronic oxymoron" is non-oxymoronic
(i.e. a pleonastic)? 

2. You mean that "clever oxymoron" is an oxymoron? What about Milton's
"darkness visible"?

-- 

Eugene

 "I have an Apache Web Server that uses CGI forms written in COBOL."
 							Post in clpm


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

Date: Mon, 18 Jan 1999 22:50:07 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Array slices with a maximum length
Message-Id: <1dlulp0.x6ppme11puolkN@bay1-68.quincy.ziplink.net>

Sean McAfee <mcafee@waits.facilities.med.umich.edu> wrote:

> sub min { $_[0] < $_[1] ? $_[0] : $_[1] }

I like this one:

sub min { $_[$_[1]<$_[0]] }

:-)

-- 
 _ / '  _      /         - 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: Mon, 18 Jan 1999 19:37:04 -0800
From: Richard Robinson <richardr@ldr.com>
Subject: as400 net.data
Message-Id: <36A3FDD8.99565299@ldr.com>

I've installed PERL 5.003 port for as400 on as400 box. The program is in
/QSYS.LIB/PERL5.LIB/PERL.PGM

All I need to do is get it activated for use via Net.data. I created a
stub HTML block in a macro that has a call to a stub DTW_PERL function
that merely prints "hello world".

Then I  edited my DB2WWW.INI file with the following command:

ENVIRONMENT (DTW_PERL) /QSYS.LIB/PERL5.LIB/PERL.PGM (OUT RETURN_CODE)

but this doesn't work. Net.data gives me following error message:

Net.data error: The activation of the language environment service
program /QSYS.LIB/PERL5.LIB/PERL.PGM failed.

Does anyone have any suggestions? The ENVIRONMENT line is obviously (?)
wrong, but what should it be?

Perl libraries are in /QopenSys/usr/local/lib

--
Richard Robinson
Web Administrator
Litho Development & Research
richardr@ldr.com
503-255-5800 x172




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

Date: Tue, 19 Jan 1999 09:34:04 +0800
From: "Mark Nold" <markn_nospam_@mincom.com>
Subject: Binary and Hex number conversion
Message-Id: <780n9g$p40$1@pithy.mincom.oz.au>

Hi i want to easily convert fractional binary numbers to decimal.

ie:

1.10111

Is there an easy way to do this?


This is actually part of a bigger problem... where i need to convert a hex
number to a decimal. It is a 8 byte real number expressed as hex in a
reversed byte format.... (i assume there are better names for this)

For example, the number 0000000000003e40 is in fact 30.

The way i calculate this follows;

1. Reverse the bytes
403e000000000000

2. Convert to Binary
0100000000111110000000000000000000000000000000000000000000000000

3. The first bit is the sign bit (ie: positive in this case)

4. The next 11 characters are the exponent (which is biased by 1023)
10000000011
= 1027 - 1023
= 4
5. The next 52 characters represent the fractional part of the mantissa with
an assumed leading 1
111
= 1.875

6. Put it all together
1.875 * (2 ** 1027)
= 30


Any help would be appreciated.

mn





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

Date: Mon, 18 Jan 1999 22:25:11 -0500
From: Darrel Davis <darreld@mail.his.com>
Subject: Can I do this is Perl?
Message-Id: <Pine.BSI.4.05L.9901182214450.5689-100000@mail.his.com>

I have a question for the perl hackers.  I have a server
system that I'm currently coding in Java but would like
to move to perl for a couple of reasons; performance and
string handling (plus I've never implemented anything big
in Perl).  

This program listens on a port for connections; takes connections;
spawns threads (for now, I think I'll have enough connections that
I'll have to go to processes soon as threads become inefficient
after a while); read data from the port char at a time since It's a
proprietary protocol without CR/NL's.  When I get a packet, I check
the verb, then I do the appropriate thing and build and send back
a packet. 

I have dinked with perl but was only able to read a complete line from
a socket which is no good for me.  I get a string of characters which
starts with a char count.  I then parse and disect the line. Oh yeah,
I hit a database for most verbs also.

Is this something I could do with Perl or would there be alot of work
arounds for some of this.  This is not flamebait; I'd like to know.
Java is going OK but seems pretty slow under Linux and some of the
Perl stuff I've run (Sirc) is real snappy.

In short, I need multithreading, sockets, reading variable length packets
from sockets, database.  Doable?

-darrel
============================================
Darrel Davis         darreld@his.com
                     darreld@hotmail.com
============================================




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

Date: 19 Jan 1999 01:38:56 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: CGI error with C extensions in PERL
Message-Id: <780nng$15h$1@gellyfish.btinternet.com>

On Sun, 17 Jan 1999 15:33:23 +0100 Black K wrote:
> Thanks for your answer.
> 
> I cannot run make install because I don't have the rights to do it.
> 
> Do you know another way to install the extension  ?
> 

You should follow the instructions given in perlfaq8:

    =head2 How do I keep my own module/library directory?

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Tue, 19 Jan 1999 01:04:56 GMT
From: jmpnz@my-dejanews.com
Subject: file ownership in NT
Message-Id: <780lni$ock$1@nnrp1.dejanews.com>

Is there a way (module/lib) to check the ownership of a file under NT?  I need
to collects statics on who owns what file on my network.

Ian Ennis


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


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

Date: Mon, 18 Jan 1999 22:50:08 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: foreach dilemma
Message-Id: <1dlum2h.1ew2edy11pmg74N@bay1-68.quincy.ziplink.net>

Rich Grise <off-duty@entheosengineering.com> wrote:

> When I have a foreach loop going through a file
> one line at a a time, and match something that
> breaks the loop, then does the next foreach on
> the same list pick up where the last one left
> off, or start from the top again? (I want to
> capture the lines between a certain "From"
> address and the ensuing "end of message" line
> in an In.mbx file).

What happened when you tried it?

The foreach iterator is local to the foreach loop, not to the list being
iterated over.  If you break out of one foreach loop, the next one will
start at the beginning of the list, of course.

It sounds like you might want to use a C-style for loop and keep track
of the index yourself.

-- 
 _ / '  _      /         - 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: 19 Jan 1999 00:33:16 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Help: Advanced Search and Replace Question
Message-Id: <780jsc$ki3$1@client2.news.psi.net>

Brook Harty (harty@gte.com) wrote on MCMLXVI September MCMXCIII in
<URL:news:780abt$ecm$1@news-1.news.gte.net>:
;; I want to remove all html tags from a document.

FAQ

;; tags are anything between <> tags. example <foobar>

But you said HTML tags!



Abigail
-- 
perl -we '$_ = q ?4a75737420616e6f74686572205065726c204861636b65720as?;??;
          for (??;(??)x??;??)
              {??;s;(..)s?;qq ?print chr 0x$1 and \161 ss?;excess;??}'


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

Date: Tue, 19 Jan 1999 03:39:04 GMT
From: jlatifi@tsicable.com
Subject: How to best process a large CGI form?
Message-Id: <36a3fd90.19105872@corp.supernews.com>

I have a large form, (many similar form objects), that I need to put
into arrays.  I will then check for null, and mail away non-null
variables.  How can I do this without explicitly loading each object
into the arrays?

Thnx.
Eldorado


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

Date: 19 Jan 1999 03:39:04 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: How to get IP address of a local machine under NT
Message-Id: <780uoo$1b8$1@gellyfish.btinternet.com>

On Fri, 15 Jan 1999 16:03:19 +0300 Igor Proskuriakov wrote:
> Hi, there!
> Could you please tell me how I can get an IP address of a local computer
> running Windows NT, assuming that it has only one network card.
> 

Check perlfaq9 (ie perldoc perlfaq9):

=head2 How do I find out my hostname/domainname/IP address?

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Tue, 19 Jan 1999 12:01:28 +0800
From: Alex <ex5316@netvigator.com>
Subject: How to link image in Perl script ?
Message-Id: <36A40398.72BC8D06@netvigator.com>

Hello there,
I have a problem.
I wish to put a image Logo in  my perl script. The script is :
----------------------
----------------------
print  "Content-type: text/html\n\n";
print  "<CENTER><IMG SRC="mainlogo.gif" HEIGHT=54 WIDTH=577></CENTER>";
--------------
--------------
The image already saved in my cgi-bin directory.
However, I cannot run this script. Error appear.
Please tell me how to do this.
Thank you
Alex



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

Date: 19 Jan 1999 04:10:12 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: How to link image in Perl script ?
Message-Id: <slrn7a81d4.416.sholden@pgrad.cs.usyd.edu.au>

On Tue, 19 Jan 1999 12:01:28 +0800, Alex <ex5316@netvigator.com> wrote:
<snip>
>print  "<CENTER><IMG SRC="mainlogo.gif" HEIGHT=54 WIDTH=577></CENTER>";
        ^                 ^            ^                              ^
Here's a novel suggestion, why don't you read the error message...

-- 
Sam

Can you sum up plan 9 in layman's terms? It does everything Unix does
only less reliably.
	--Ken Thompson


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

Date: Mon, 18 Jan 1999 20:39:13 -0700
From: jamion <jamion@geocities.com>
Subject: Re: Including a CGI script in a Web Page
Message-Id: <36A3FE60.2BD398A6@geocities.com>



jgalenski@my-dejanews.com wrote:

> I'm trying to include a CGI script in a web page (HTML) via the exec sever
> side include.  If my script does not require any inputs, it works ok.
> However, if I have to pass in inputs, it fails.  Here's a sample of what I'm
> trying to do:
>
> <!-- test.shtml -->
> <html><body bgcolor="#123456">
> This is a test
> <p>
> <!--#exec cgi="/cgi-local/weather/weather.cgi?Augusta&ME"-->
> </body></html>
>
> When 'test.shtml' is accessed, it should run 'weather.cgi' using 'Augusta'
> and 'ME' as the inputs.
>
> Any ideas how to do this?
>
> Thanks,
> -John Galenski (johng@mathworks.com)
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own

Shouldn't this line look like this
<!--#exec
cgi="/cgi-local/weather/weather.cgi?&something1=Augusta&something2=ME"-->

then in the cgi script you would use
$something1 = param('something1');
    and
$something2 = param('something2');

Hope this is right and hope it works

james



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

Date: Mon, 18 Jan 1999 17:56:37 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Newbie Question
Message-Id: <MPG.110d862fb6158f98999f@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and a copy mailed.]

In article <780gk6$r9b$1@ash.prod.itd.earthlink.net> on Mon, 18 Jan 1999 
18:35:24 -0500, Nathan Owen <nathan.owen@isocor.com> says...
 ...
> ...   I use the "exec" function in perl
> to fire off the process along with the options I need.  I execute the
> process nine times, each time with seperate options.  What I need to know is
> how do I "exec" a operating system command, and make sure the that command
> has completed before the next "exec" of a operating system command fires
> off?  I think I am looking for some kind of wait statement.

Try using 'system' instead of 'exec'.  Then you can execute your process 
once, calling 'system' each time with separate options.  Each one will 
return only when completed.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Mon, 18 Jan 1999 20:51:42 -0700
From: jamion <jamion@geocities.com>
Subject: Re: Odering an Array
Message-Id: <36A4014E.741B9351@geocities.com>

If I were you I would use a 2-3 tree, this would definitely be one of the
fastest ordering processes you could use,  make sure to use oop while doing it,
this way you can use it again and again.  Since I have no clue what you have
tried, I figured you must have tried some simple ones and they just wern't fast
enough for you.

have fun.

cbleask@olemiss.edu wrote:

> Given an array of real numbers, say A whose index from 1 to 100.
> How could I write a program to produce a list or print out which gives each
> element's order?
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own



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

Date: Tue, 19 Jan 1999 02:51:42 GMT
From: Ron Parker <sysop@scbbs.com>
Subject: pattern matching between multiple lines in a file
Message-Id: <36A3F44D.1ABB664A@scbbs.com>

I wish to match a pattern which could extend across several lines in a
file.

For example, if these titles appear in the file:

TITLE1

Blah Blah

TITLE2

Blah Blah
Blah Blah Blah

I want to replace the pattern and re-write to the file:

TITLE1 Blah Blah
TITLE2 Blah Blah Blah Blah Blah

Now, I've figured out how to do the actual pattern matching (or
something like this):

$input =~ s/(TITLE[0-9])\r\n(Blah[^\r\n]+)\r\n\r\n/$1 $2\r\n/gi;
$input =~ s/(TITLE[0-9])\r\n(Blah[^\r\n]+)\r\n(Blah[^\r\n]+)\r\n\r\n/$1
$2 $3\r\n/gi;

What I can't figure out is how to do this pattern replacing in a file.
The file is 6MB, so right now if I try and read the file into a string
on which I can do the pattern replacement, I get an "out of memory"
error.  I'm don't know how to do the replace using only the filehandle.

Is there a way to do this?  Am I going about it the wrong way?  I'd
appreciate any suggestions.

Thanks.

-ron

--
Ron Parker
Software Creations      http://www.scbbs.com
TradeWinds Publishing   http://www.intl-trade.com
TradePoint Los Angeles  http://www.tradepointla.org




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

Date: 18 Jan 1999 17:37:34 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Perl Criticism
Message-Id: <m1hftooxep.fsf@halfdome.holdit.com>

>>>>> "I" == I R A Aggie <fl_aggie@thepentagon.com> writes:

I> +    Daffy Duck is a celebrity...

I> Yeah, but he can't get a check cashed...

And he always gets stuck with a bill.

use RimShot qw(ba dump dum!);

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: 19 Jan 1999 02:12:09 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: perl Help
Message-Id: <slrn7a7qfp.1uc.sholden@pgrad.cs.usyd.edu.au>

On Mon, 18 Jan 1999 15:49:10 GMT, ptimmins@netserv.unmc.edu wrote:
>In article <slrn7a5ulp.hi2.sholden@pgrad.cs.usyd.edu.au>,
>  sholden@cs.usyd.edu.au wrote:
>
>> On Mon, 18 Jan 1999 08:22:16 GMT, ptimmins@netserv.unmc.edu
>> 	<ptimmins@netserv.unmc.edu> wrote:
<snip>
>> The last posters solution shows how 'split' can be used to break up a
>> string into a bunch of characters, which may be useful if you want to
>> access them a lot. Why all the reference crap was included I will never
>> know...
>
>so the information could be stored for later use ... obviously

Well that 'obviously' made me actually check since nothing is ever 'obvious'
when dealing with stupidly complex (for the situation) data structures...

And I came to the conclusion that I would just use substr, as the FAQ says,
as my answer said, as everyone elses answer said... What if I have to access
the characters a lot you ask... well I'd still use substr :

Benchmark: timing 10 iterations of references, substrs...
references: 13 wallclock secs (12.70 usr +  0.01 sys = 12.71 CPU)
   substrs: 12 wallclock secs (11.03 usr +  0.04 sys = 11.07 CPU)

So what is the advantage of jumping through all the reference hoops?

#!perl #for use with -x
use Benchmark;

#Use large since I tried with small strings and the results were the same
#so I thought large strings might disadvantage substr...
@data = ("abcd"x100,"efgh"x100,"ijkl"x100);

# We won't even bother counting the cost of the preprocessing...
# which will be significant if we only do a few accesses...
$row = 0;
for (@data) {
  $chr[$row]{char} = [split //];
  $row++;
}

timethese(10, #I don't have all day...
        {substrs => \&substrs,
        references => \&references,
        });

sub references {
        for (1...100000) {
                $temp = $chr[int rand 3]{char}[int rand 400];
        }
}

sub substrs {
        for (1...100000) {
                $temp = substr($data[int rand 3],(int rand 400),1);
        }
}
__END__
-- 
Sam

Even if you aren't in doubt, consider the mental welfare of the person
who has to maintain the code after you, and who will probably put parens
in the wrong place.	--Larry Wall


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

Date: 19 Jan 1999 00:38:59 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Perl Web browser problem
Message-Id: <780k73$ki3$2@client2.news.psi.net>

jmauney@my-dejanews.com (jmauney@my-dejanews.com) wrote on MCMLXVI
September MCMXCIII in <URL:news:7808qr$ct9$1@nnrp1.dejanews.com>:
;; 
;; Third try from command line:
;; [root@downy Usenet]# ./usenet31.pl
    ^^^^

*shudder*



Abigail
-- 
perl  -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
          for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
          print chr 0x$& and q
          qq}*excess********}'


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

Date: Mon, 18 Jan 1999 20:53:58 -0700
From: jamion <jamion@geocities.com>
Subject: Re: Problem with Perl script
Message-Id: <36A401D5.851C1A88@geocities.com>

where is the code for &readparse?

John wrote:

> I am (a newbie) getting an error message
> 'premature ending of script' for the
> following:
>
> #!/usr/bin/perl
> #
> &readparse;
> print "Content-type: text/html\n\n";
> #
> #*****************BEGIN BODY*************
> print "<h1>Thank you for filling out the form</h1>";
> $firstname = $value[0];
> $lastname = $value[1];
> $email = $value[2];
>
> print "Your first name is $firstname<BR>";
> print "Your last name is $lastname<BR>";
> print "Your e-mail is $email<BR>";
>
> Can anyone spot the problem?
>
> john



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

Date: Mon, 18 Jan 1999 22:16:37 -0600
From: "John" <jdebay@NOSPAMearthlink.net>
Subject: Questions about cookies
Message-Id: <780ta0$qgl$1@fir.prod.itd.earthlink.net>

I have a page where I set a number of cookies from JavaScript.  I then want
to read these cookies when a seperate form is submitted.  The script that
handles the form can't seem to see the cookies.  I try to read the
HTTP_COOKIES (or whatever it is) envoronment variable, but it doesn't
contain any data.  These cookies do exist when I check through JavaScript,
though.  Is there something I'm doing wrong?  Is there something special I
have to do to get them sent to the script?  The books I have are no help.
Thanks to anyone who has any advice.

John





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

Date: 18 Jan 1999 19:12:40 -0600
From: peter@nemesis.niar.twsu.edu (Peter Samuelson)
Subject: Re: Secuity hole with perl (suidperl) and nosuid mounts on Linux
Message-Id: <780m68$o9i$1@nemesis.niar.twsu.edu>

[Oleg Mercader <o.mercader@cesca.es>]
> If you haven't an exec permition in your /etc/fstab for a floppy
> mounting point you can't execute any from a floppy and if you copy a
> file to a harddisk you lost your suid.

All you need is an entry for a floppy which includes the "user" option
and some type other than "msdos" or "vfat" or whatever ("auto" works)
so that a user can mount an ext2 (or minix, or xia, etc) floppy.

The option "noexec" does not affect this, since the kernel *already*
has a check for this hole if you execute the script directly.  (It will
refuse to run it, with EPERM.)  You have to invoke the script with

  perl /mnt/fd0/script.pl

or some such, so that *perl* is calling the shots, not the kernel.
That is what makes this a hole -- a bug in suidperl.  suidperl is
supposed to emulate the kernel permission checks, and it just isn't
clever enough to emulate *this particular* check.

Let it be noted that allowing physical access to an important machine
is asking for trouble already, and allowing users to do things like
mount floppies and cdroms is maybe even a little more careless, so a
truly paranoid admin wouldn't have been hit by this bug anyway.

-- 
Peter Samuelson
<sampo.creighton.edu!psamuels>



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

Date: Mon, 18 Jan 1999 18:41:52 -0800
From: Scott Craig <scott.craig@moh.hnet.bc.ca>
Subject: Re: split not working...
Message-Id: <36A3F0F0.76B9BEB3@moh.hnet.bc.ca>



Keith Woodworth wrote:

> Need some fresh eyes on this: split does not seem to be splitting.
>
> Part of what I'm trying to split:
>
> wtrowell       431
> wwscpr       13
> wylie       58
> xwiselan       4
> ykangas       1
> ymurland       33
> yoshi       3
> youth       38
> zapco       1
> zog       820
>
> Code I'm using:
> #!/usr/local/bin/perl5 -w
> use diagnostics;
>
> $user="kwoody";
> open(FILE,"kwoody.test") || die "File $!\n";
> @_ = <FILE>;
> close(FILE);
>
> @_ = grep(/$user/,@_);
> print "@_, $user";
> ($user_name, $total_mins) = split(/\s+/);
> print "$user_name, $total_mins";
>
> I have something very similar to the above in another program and it
> works. Any reason why this wont? BAsically it prints out whats in @_ and
> $user then after it splits (or doesnt) the next print just gives me a ,
>
> I'm thinking is the format of the file I"m trying to split. Ive tried
> changing the format of the kwoody.test file to be nicely lined up and
> formated via a sprintf. Ive tried putting in a | char and split on that
> but it doesnt work either. I even tried escaping the | char thinking it
> might be reserved.
>
> Anyone help on this?
> Thanks,
> Keith
> kwoody@citytel.net

      My guess is that there is a blank line at the end of "kwoody.test".
The special variable $_ was last used as an iterator for the list passed to
the grep, so it should contain the last line of (the original value of) @_
at this point. If this is a blank, or a newline character, then this would
explain why the split comes up with nothings.
    I don't see exactly what you're trying to do. The grep returns a list of
lines with "kwoody" in them, but then the split doesn't use it.




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

Date: 19 Jan 1999 02:20:14 GMT
From: "Allan M. Due" <allan@due.net>
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <780q4u$h8k$0@206.165.165.170>

Greg Bacon wrote in message <7803f0$6bl$1@info.uah.edu>...

[snip]
:
:Top 10 Posters by OCR (minimum of five posts)
:==============================================
:
:         (kb)    (kb)
:OCR      orig /  body  Posts  Address
:-----  --------------  -----  -------
:
:0.981  ( 11.5 / 11.7)     21  fl_aggie@thepentagon.com (I R A Aggie)
:0.932  ( 25.7 / 27.5)     49  abigail@fnx.com
:0.907  ( 16.1 / 17.7)      7  Greg Bacon <gbacon@cs.uah.edu>
:0.869  (  3.1 /  3.6)      6  bluepuma@mailexcite.com
:0.792  ( 13.0 / 16.4)     11  Staffan Liljas <staffan@ngb.se>
:0.779  (  3.9 /  5.0)      5  moseley@best.com (Bill Moseley)
:0.757  ( 11.0 / 14.5)     11  gward@cnri.reston.va.us
:0.754  (  4.2 /  5.6)      5  Scratchie <upsetter@ziplink.net>
:0.747  (  5.9 /  7.8)     10  dturley@pobox.com
:0.735  (  5.0 /  6.9)      5  "Allan M. Due" <due@murray.fordham.edu>


I love it when I am a statistic. <g>

AmD




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

Date: Mon, 18 Jan 1999 22:50:09 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Using GetOptions?
Message-Id: <1dlumtl.jbx8vt7ib6o3N@bay1-68.quincy.ziplink.net>

[posted and mailed]

Bob Waltenspiel <bobw@sr.hp.com> wrote:

> I want to allow my perl script to allow multiple instances of a
> particular option.  For instance, using my script 'lt':
> 
> lt -s file1 -s file2 -l file3 -l file4
> 
> I don't see how GetOptions as described in the O'Reilly books will
> allow this, so I'm looking for another suggestion.  Any help would be
> greatly appreciated.

Which O'Reilly books are you looking at, exactly?

Programming Perl, 2nd ed., page 447:

[GetOpt::Long]

  If an argument specifier concludes with @ (as in =s@), then the option
  is treated as an array.  That is, **multiple invocations of the same
  option, each with a particular value, will result in the list of
  values being assigned to the option variable, which is an array.**
  See the following section for an example.  [my emph]

-- 
 _ / '  _      /         - 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: 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 4684
**************************************

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