[11173] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4773 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 28 19:07:11 1999

Date: Thu, 28 Jan 99 16:00:24 -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           Thu, 28 Jan 1999     Volume: 8 Number: 4773

Today's topics:
    Re: 1 Last Thing:  Re: Sorting a file in Perl question  <uri@ibnets.com>
    Re: 1 Last Thing:  Re: Sorting a file in Perl question  <steve@NOSPAMcyber-distributors.com>
    Re: 1 Last Thing:  Re: Sorting a file in Perl question  (Martien Verbruggen)
        A more efficient & cleaner method of doing this? <gavin@optus.net.au.dontspam.myass>
    Re: Compiling PERL5.005_02 on a Sun Ultra 2 w/o Solaris (Martien Verbruggen)
        DBI / DBD / ODBC - Need Engine? <jjarrett@ecpi.com>
    Re: Floating point math errors (Larry Rosler)
    Re: Floating point math errors <uri@ibnets.com>
        Forms in CGI prakashpatel@hotmail.com
    Re: Forms in CGI <staffan@ngb.se>
    Re: Forms in CGI dhosek@webley.com
    Re: Good CGI Book <nessus@shell5.ba.best.com>
    Re: Gosh, s// faster than m// (was Re: Counting charact <rra@stanford.edu>
    Re: Help on deleting an item in an array? (Larry Rosler)
    Re: Help on deleting an item in an array? <uri@ibnets.com>
    Re: HELP with string parsing and scoring <ludlow@us.ibm.com>
    Re: How long would the Unixes last without Perl? <iansmith@pepper.ncinter.net>
    Re: impossible configure perl CGI on IIS4? glissmannr@quanterra.com
    Re: installing perl (Martien Verbruggen)
    Re: is crypt() function compatible? (Martien Verbruggen)
    Re: Mail INBOX parsing script <nuno.leitao@uk.uu.net>
        newbie pipe <dropzone@mail.utexas.edu>
    Re: newbie pipe <nuno.leitao@uk.uu.net>
    Re: Out of memory <?> <ludlow@us.ibm.com>
    Re: Porting from Win32 perl to Unix perl <Denis.Haskin@bigfoot.com>
    Re: Simple CGI with Perl <jjarrett@ecpi.com>
    Re: Stopping a foreach loop <nessus@shell5.ba.best.com>
    Re: Stopping a foreach loop (Harold Bamford)
    Re: Stopping a foreach loop <ludlow@us.ibm.com>
    Re: Stopping a foreach loop dhosek@webley.com
    Re: Stopping a foreach loop (Larry Rosler)
    Re: system function, Pros and Cons?? (Martien Verbruggen)
    Re: system function, Pros and Cons?? <tchrist@mox.perl.com>
    Re: The behaviour of split() <tbriles@austin.ibm.com>
    Re: URI.pm Problem <derek_price@stortek.com>
    Re: Using Time:CTime <stampes@xilinx.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 28 Jan 1999 16:51:18 -0500
From: Uri Guttman <uri@ibnets.com>
Subject: Re: 1 Last Thing:  Re: Sorting a file in Perl question ::  please help :)
Message-Id: <393e4vukvd.fsf@ibnets.com>

>>>>> "SJ" == Steve Jackson <steve@NOSPAMcyber-distributors.com> writes:


  SJ> sub pleasesort{

  SJ> 	open (FILE,"all.txt");

you are not checking the result of open. bad boy!!

  SJ> 	@filelist=<FILE>;
  SJ> 	close(FILE);

  SJ> 	@sorted_rows = sort (@filelist);

  SJ> 	open (workfile, ">all.txt");

same here. double bad boy! also file handles are all uppercase by convention.

  SJ>         	print workfile "@sorted_rows";

why are you quoting @sorted_rows? do you know what happens to arrays
when interpolated in double quoted strings? lookup in perlvar the
variable $" and read perldata too.

uri

-- 
Uri Guttman                             Hacking Perl for Ironbridge Networks
uri@sysarch.com				uri@ironbridgenetworks.com	


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

Date: 28 Jan 1999 22:09:42 GMT
From: "Steve Jackson" <steve@NOSPAMcyber-distributors.com>
Subject: Re: 1 Last Thing:  Re: Sorting a file in Perl question ::  please help :)
Message-Id: <01be4b0a$555a73e0$030e4dc0@sysadmin>

You are wonderful my friend.
Taking it out of quotes did the trick!  I'll have to read up on
that problem or would you like to tell me briefly.

Also, you refering to this?
open (workfile, ">all.txt") || die "Content-type: text/html\n\nCan't Open
all.txt(r): $!\n";

:)


Uri Guttman <uri@ibnets.com> wrote in article
<393e4vukvd.fsf@ibnets.com>...
> >>>>> "SJ" == Steve Jackson <steve@NOSPAMcyber-distributors.com> writes:
> 
> 
>   SJ> sub pleasesort{
> 
>   SJ> 	open (FILE,"all.txt");
> 
> you are not checking the result of open. bad boy!!
> 
>   SJ> 	@filelist=<FILE>;
>   SJ> 	close(FILE);
> 
>   SJ> 	@sorted_rows = sort (@filelist);
> 
>   SJ> 	open (workfile, ">all.txt");
> 
> same here. double bad boy! also file handles are all uppercase by
convention.
> 
>   SJ>         	print workfile "@sorted_rows";
> 
> why are you quoting @sorted_rows? do you know what happens to arrays
> when interpolated in double quoted strings? lookup in perlvar the
> variable $" and read perldata too.
> 
> uri
> 
> -- 
> Uri Guttman                             Hacking Perl for Ironbridge
Networks
> uri@sysarch.com				uri@ironbridgenetworks.com	
> 


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

Date: Thu, 28 Jan 1999 23:02:48 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: 1 Last Thing:  Re: Sorting a file in Perl question ::  please help :)
Message-Id: <s06s2.24$LH2.1585@nsw.nnrp.telstra.net>

In article <01be4b0a$555a73e0$030e4dc0@sysadmin>,
	"Steve Jackson" <steve@NOSPAMcyber-distributors.com> writes:

> Also, you refering to this?
> open (workfile, ">all.txt") || die "Content-type: text/html\n\nCan't Open
> all.txt(r): $!\n";

CGI Script?

die output goes to STDERR, which normally ends up in your server's log
file. The client expects stuff on STDOUT.

For error handling in CGI scripts, you're much better off using the
CGI module.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | 
Commercial Dynamics Pty. Ltd.       | 'I hate gramaticle errors!' 'Me to!'
NSW, Australia                      | 


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

Date: Thu, 28 Jan 1999 23:52:23 GMT
From: "Gavin Cato" <gavin@optus.net.au.dontspam.myass>
Subject: A more efficient & cleaner method of doing this?
Message-Id: <XK6s2.5$0r.318950@news0.optus.net.au>

I have quickly (and nastily with my knowledge of perl) restricted access to
a CGI script with this ;

$passlist = "/foo/bar.list";
$security = $ENV{'REMOTE_HOST'};
        chomp $security;
        $checkip = `grep $security $passlist`;
        chomp $checkip;

if ($checkip ne $security) {
        $results[0] = "\nAccess Denied. Your IP $security is not
permitted\n";
        $results[1] = "\nFor access to this site please email
gavin\@optus.net.au\n";
        &print_results;
        exit;
        }


It is working fine, but just wondering if there is a cleaner way of doing it
without shelling out using grep etc...


--
Gavin Cato - Optus Network Engineer - gavin@optus.net.au

gawk; talk; date; wine; grep; touch; unzip; touch; gasp; finger; gasp;
mount; \
 fsck; more; yes; gasp; umount; make clean; make mrproper; sleep






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

Date: Thu, 28 Jan 1999 22:21:45 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Compiling PERL5.005_02 on a Sun Ultra 2 w/o Solaris 2.6 OS
Message-Id: <Zp5s2.21$LH2.1585@nsw.nnrp.telstra.net>

In article <36B05930.79C4E0BC@tcon.net>,
	Ken McNamara <conmara@tcon.net> writes:
> Pete -
> 
> Solaris ships with a "Worse than nothing" cc.  That is, it appears to be
> there - but is so crippled you can't even call it vaporware.  Not only cc
> but a lot of libraries are missing too (which generates a lot of errors).
> 
> We purchased the Solaris C compiler, installed it and (fortunately) used it
> to bootstrap a gcc compiler.

[offtopic, sorry]

Of course, you don't _need_ to buy Sun's C compiler to do that. You
can get precompiled gcc packages from the net, and use one of those to
build your own new gcc, if it isn't the version you want. A lot
cheaper, and it keeps that money out of those grabby little Sun hands.

Who would have believed 10 years ago that a Unix system could ship
without a decent C compiler. Have people forgotten how closely linked
C and Unix are?

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | The number of the beast is not 666. Its
Commercial Dynamics Pty. Ltd.       | number is 95, and it's awake.
NSW, Australia                      | 


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

Date: Thu, 28 Jan 1999 16:59:54 -0500
From: "John T. Jarrett" <jjarrett@ecpi.com>
Subject: DBI / DBD / ODBC - Need Engine?
Message-Id: <36B0DDDA.DC789450@ecpi.com>

First off, I work with clients on various hosts that I don't own and I'm
not going to get root permissions on.

So, if you've stuck the DBI and DBD for, say, MSQL databases in your
cgi-bin so they show up in the path, can you then use them to
create/access/modify MSQL databases without ever having installed the
MSQL database stuff itself?

I can't compile Msql, I can't install (via Make) DBI and DBD files
correctly, I can't use a CSV/textfile database for so complicated a
database...Can I cheat and just use the DBD and DBI stuff to create the
db without compiling all the important stuff?

Thanks,
(feeling like an idiot)
John T. Jarrett
webmaster@wondertek.com



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

Date: Thu, 28 Jan 1999 13:53:20 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Floating point math errors
Message-Id: <MPG.111a7c27f2ff8c5f9899dd@nntp.hpl.hp.com>

In article <Pine.LNX.4.05.9901281219300.8809-100000@hill.ucr.edu> on 
Thu, 28 Jan 1999 12:20:04 -0800, Abraham Grief <abey@hill.ucr.edu> 
says...
> 
> Read the faq.
> 
> http://language.perl.com/newdocs/pod/perlfaq4.html

Usenet convention is to quote only what you need to, and *before* your 
comments on it.

> On Thu, 28 Jan 1999 eharrington@paymentech.com wrote:
> 
 ...
> >    ${amt} = 1.01;
> > 
> >    while ( ${totl} < 999999 )
> >    {
> >       ${amt} += 0.01;
 ...
> >    amt=2.29999999999999 totl=214.14
> > 
> > Can anything be done in Perl to prevent losing molecules from these pennies?

The FAQ referred to above will tell you how to *conceal* the problem (by 
printf-ing only two decimals in your output).  But it will not tell you 
how to *fix* the problem.

0.01 is imprecise.  Every time you add it to $amt you accumulate error.  
You could either keep track of the number of times through the loop as 
an integer, multiply it by 0.01 and add it; or (far better) do all your 
arithmetic in integers (pennies, as you say), then divide by 100 to 
display totals in dollars. 

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


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

Date: 28 Jan 1999 18:04:00 -0500
From: Uri Guttman <uri@ibnets.com>
Subject: Re: Floating point math errors
Message-Id: <39zp73t2xr.fsf@ibnets.com>

>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:

  LR> better) do all your arithmetic in integers (pennies, as you say),
  LR> then divide by 100 to display totals in dollars.

i always do money calculations as integral pennies and convert on
i/o. it is clean, accurate and works anyone who does floating point math
on his money is a fool and will soon be parted from it.

uri

-- 
Uri Guttman                             Hacking Perl for Ironbridge Networks
uri@sysarch.com				uri@ironbridgenetworks.com	


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

Date: Thu, 28 Jan 1999 21:44:05 GMT
From: prakashpatel@hotmail.com
Subject: Forms in CGI
Message-Id: <78qln3$vs0$1@nnrp1.dejanews.com>

Hey guys I am writing a script to delete data from a file.  What i am doing
is having a search input from user.  My cgi searches that name or names and
outputs the data with delete button on the bottom. Well i can out put data
from cgi using input type text.  But when i try to use the hidden type it
doesn't work. can someone help me please. Here is the code.

  print "<input TYPE=text NAME=name VALUE='@name[$x]'> <BR>";
  print "<input TYPE=text NAME=address VALUE='@add[$x]'> <BR>";
  print "<input TYPE=text NAME=city VALUE='@city[$x]'>";
  print "<input TYPE=text NAME=state size=2 VALUE='@state[$x]'>";
  print "<input TYPE=hidden NAME=state size=9 VALUE='@zip[$x]'> <BR>";
  print "<input TYPE=hidden NAME=phone size=13 VALUE='@phone[$x]'> <BR>";
  print "<input TYPE=hidden NAME=kid VALUE='@kids[$x]'> <BR>";
  print "<input TYPE=submit VALUE=<img src=email.gif>> <BR>";

The lines with the hidden type doesn't show any thing. IT doesn't give me any
errors either.

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


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

Date: Thu, 28 Jan 1999 23:26:19 +0100
From: Staffan Liljas <staffan@ngb.se>
Subject: Re: Forms in CGI
Message-Id: <36B0E40B.552BF0@ngb.se>

prakashpatel@hotmail.com wrote:

> from cgi using input type text.  But when i try to use the hidden type
> it doesn't work. can someone help me please. Here is the code.

What do you mean "doesn't work"? If you mean "doesn't show", it's
because hidden fields shouldn't be showed...

>   print "<input TYPE=hidden NAME=state size=9 VALUE='@zip[$x]'> <BR>";

And why do you have a size for a hidden field? And why a <BR> after?
Seems unnecessary...

>   print "<input TYPE=submit VALUE=<img src=email.gif>> <BR>";

And what is this code? I've never seen anything like it. It might be
that my html is rusty, but I don't really think so.

> The lines with the hidden type doesn't show any thing. IT doesn't give 
> me any errors either.

Try looking at the source. Hidden fields are -- hidden. OK??

HTH
Staffan


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

Date: Thu, 28 Jan 1999 23:09:23 GMT
From: dhosek@webley.com
Subject: Re: Forms in CGI
Message-Id: <78qqms$46p$1@nnrp1.dejanews.com>

In article <78qln3$vs0$1@nnrp1.dejanews.com>,
  prakashpatel@hotmail.com wrote:
> Hey guys I am writing a script to delete data from a file.  What i am doing
> is having a search input from user.  My cgi searches that name or names and
> outputs the data with delete button on the bottom. Well i can out put data
> from cgi using input type text.  But when i try to use the hidden type it
> doesn't work. can someone help me please. Here is the code.

>   print "<input TYPE=text NAME=name VALUE='@name[$x]'> <BR>";
>   print "<input TYPE=text NAME=address VALUE='@add[$x]'> <BR>";
>   print "<input TYPE=text NAME=city VALUE='@city[$x]'>";
>   print "<input TYPE=text NAME=state size=2 VALUE='@state[$x]'>";
>   print "<input TYPE=hidden NAME=state size=9 VALUE='@zip[$x]'> <BR>";
>   print "<input TYPE=hidden NAME=phone size=13 VALUE='@phone[$x]'> <BR>";
>   print "<input TYPE=hidden NAME=kid VALUE='@kids[$x]'> <BR>";
>   print "<input TYPE=submit VALUE=<img src=email.gif>> <BR>";

> The lines with the hidden type doesn't show any thing. IT doesn't give me any
> errors either.

This looks more like an HTML question than a perl question. But what are you
expecting to happen that doesn't? Type=hidden means that nothing will be
displayed for that <input> tag.

-dh


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


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

Date: 28 Jan 1999 22:14:25 GMT
From: "J. David Eisenberg" <nessus@shell5.ba.best.com>
Subject: Re: Good CGI Book
Message-Id: <36b0e141$0$16666@nntp1.ba.best.com>

Tom Renic <trenic@nortelnetworks.ca> wrote:
: Can anyone suggest a very good CGI Textbook that is a good
: starting point for a beginner, yet can act as a good desk reference
: for an experience programmer?

"CGI Programming on the World Wide Web", by Shishir Gundavaram,
published by O'Reilly; ISBN 1-56592-168-2

-- 
J. David Eisenberg    http://www.best.com/~nessus


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

Date: 28 Jan 1999 15:12:12 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Gosh, s// faster than m// (was Re: Counting characters with tr///           (in perl))
Message-Id: <ylpv7zat6b.fsf@windlord.stanford.edu>

In comp.lang.perl.moderated, Brand Hilton <bhilton@tsg.adc.com> writes:
> Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:

>> Though some systems have pretty good malloc()s.  Say, Linux malloc() is
>> reported to be only 50% slower and only 5% more wasteful than Perl's
>> one.

> Now I'm curious.  Why is it that, when running Configure, the default is
> to NOT use Perl's malloc?

I can't speak to the default, but the reason why I personally use the
system malloc rather than Perl's is that it's generally been banged upon
*for that particular operating system and libc platform* a good bit more
than Perl's malloc has.  Ilya's done a lot of really great work on Perl's
malloc, and if I wanted the last few units of speed and memory out of Perl
I'd probably use it.  But stability is pretty much the paramount concern
for me.

That's not to say that there aren't systems out there with really bad
mallocs where Perl's malloc is probably quite a bit stabler.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Thu, 28 Jan 1999 15:05:02 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Help on deleting an item in an array?
Message-Id: <MPG.111a8cf94d588b759899de@nntp.hpl.hp.com>

In article <394spbul5i.fsf@ibnets.com> on 28 Jan 1999 16:45:13 -0500, 
Uri Guttman <uri@ibnets.com> says...
> >>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:
> 
>   >> @fred[6..$#fred] = @fred[7..$#fred]; # leaves 1..5 same, last
>   >> becomes undef $#fred --; # shortens array removing last (undef)
> 
>   LR> Good Lord.  Don't even *think* of doing that!
> 
> i don't know who got more repulsed, you or i!! i followed up as fast as
> i could.

But I took the time to cook up the amazing benchmark to show *why* it 
was so repulsive.

>   LR>      Cntrl:  5 wallclock secs ( 4.66 usr +  0.00 sys =  4.66 CPU)
>   LR>      Slice: 19 wallclock secs (19.03 usr +  0.00 sys = 19.03 CPU)
>   LR>     Splice:  5 wallclock secs ( 4.77 usr +  0.00 sys =  4.77 CPU)
> 
> it is amazing how close splice is to control! assuming that it really
> only used .11 seconds more, the it is about 130 [ (19.03-4.77)/.11 ]
> times faster than the slice code. this is probably close to a record for
> slow dumb code.

We could have a contest.  My 'slow' side would certainly use 'eval 
STRING' and I'll bet it could get worse than 130. :-)

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


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

Date: 28 Jan 1999 18:39:40 -0500
From: Uri Guttman <uri@ibnets.com>
Subject: Re: Help on deleting an item in an array?
Message-Id: <39yamnt1ab.fsf@ibnets.com>

>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:

  >> it is amazing how close splice is to control! assuming that it really
  >> only used .11 seconds more, the it is about 130 [ (19.03-4.77)/.11 ]
  >> times faster than the slice code. this is probably close to a record for
  >> slow dumb code.

  LR> We could have a contest.  My 'slow' side would certainly use 'eval 
  LR> STRING' and I'll bet it could get worse than 130. :-)

but i was refering to an honest newbie with dumb code. you are not a
newbie, nor dumb, but who knows about honest? 

:-)

uri

-- 
Uri Guttman                             Hacking Perl for Ironbridge Networks
uri@sysarch.com				uri@ironbridgenetworks.com	


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

Date: Thu, 28 Jan 1999 16:09:01 -0600
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: HELP with string parsing and scoring
Message-Id: <36B0DFFD.71B989A7@us.ibm.com>

Jerome O'Neil wrote:

> Sorry, Larry, but I'm right.  The additional cycles in your benchmarks

Um, no.

>         'WH' => sub{
>                 while($i < length $string && defined( $char =
                                            ^^                        

So, after the first time though timethese, $i is not less than the
string length.  You still aren't entering your while loop on 99999
trials.  You got around the warning, but the logic error remains.  

-- 
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)


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

Date: Thu, 28 Jan 1999 22:18:00 GMT
From: Ian Smith <iansmith@pepper.ncinter.net>
Subject: Re: How long would the Unixes last without Perl?
Message-Id: <sm5s2.99$Vu.257@news15.ispnews.com>

In comp.lang.perl.misc Eugene Sotirescu <eugene@snailgem.org> wrote:
> Kent Perrier wrote:
> > I don't think that there is a commercial UNIX on the market today that
> > ships and installes perl by default.
>
> If by "commercial" you mean closed-source, you're probably right. But
> both Caldera and RedHat sell their Linux distros with Perl as part of
> the installation (Debian does too, but that might not be "commercial"
> enough).

BSDI comes with perl5.  At a starter price of $1000, and yearly support 
subscription fees that can go into the thousands too, it surely qualifies 
as a commercial product.  Even if it is 'just' BSDI, thats like saying 
something is only for Solaris.  BSDI has a big user base.

I think it comes with 5.004_02 on the 4.0 CD.  It included Perl4 at least 
since  version 2.0 and probably earlier, but I don't have a 1.0 or 1.1 
version CD to check.

I think people who say Linux is not commercial mean they can't go into a
million-a-year-rent office building that says, "Authorised Linux Dealer" 
on the door and get a sales pitch from professionals in suits and ties 
who can give them full color glossy brochures and name companies that
they actually heard of like IBM, Sun and HP instead of Caldera and RedHat.

-- 
IanSmith@ncinter.net                                  Visit Below!
My HP48/Imagine/ImageMaster/FractalExtreme Page  -->  www.ian.org
The best baseball simulation on the market!      -->  www.imonkey.com


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

Date: Thu, 28 Jan 1999 20:58:11 GMT
From: glissmannr@quanterra.com
Subject: Re: impossible configure perl CGI on IIS4?
Message-Id: <78qj0t$tdt$1@nnrp1.dejanews.com>

In article <78kv20$4rl$1@nnrp1.dejanews.com>,
  foobar678@my-dejanews.com wrote:
> *The folder it's in is marked executable.
> *The "Application Settings"|Configuation contains the
>  correct mappings for .pl files.
> *The script checkbox is checked
> *I ran the adsutil script and "adsutil set w3svc/CreateCGIWithNewConsole TRUE"
>  and it seemed to work.
>
> Nothing I do gets perl CGI to run. The perl script is
> very simple, it contains:
>   print "Content-Type: text/plain\n\n";
>   print "Hello, Perl world!\n";
>
> And ever time you click on the file, for a millisecond a console
> window flashes and the "you have chosen to download a file" box
> also flashes. Then Nothing.
>
> I am beginning to think IIS is a big piece of shit.
> Help is possible.
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own
>

Well I'm not going to argue about the wonders of IIS, I can tell you that
Perl works just fine on IIS.  Go to http://www.activestate.com and download
their latest version of Perl for NT and IIS.  They now have an install
program that will automagically configure all of the registry settings
necessary for IIS to recognize Perl, or PerlIsapi as valid applications. 
This includes Perl for ISAPI which is much faster at running Perl scripts
than before.  Unfortuanately I have to grudgenly admit that ASP is faster. 
(Not too surprising considering it's an integral part of IIS).

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


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

Date: Thu, 28 Jan 1999 21:58:19 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: installing perl
Message-Id: <%35s2.18$LH2.1784@nsw.nnrp.telstra.net>

In article <78qfgd$6ad$1@mserv2.dl.ac.uk>,
	mbane@s-crim1.dl.ac.uk (A. Nelson) writes:
> Hello All,
> 
> I am trying to install perl 5.005_02 on my solaris 2.7 box, the
> problem is even though I successfully run Configure and make depend
> when it runs make it comes up with the following error:
> 
> Current working directory /usr/local/perl5.005_02/x2p
> echo Makefile.SH cflags.SH | tr ' ' '\n' >.shlist
> Updating makefile...
> gcc   -o miniperl miniperlmain.o libperl.a 
> Undefined                       first referenced
>  symbol                             in file
> log                                 libperl.a(pp.o)

All these function are defined in libm.(a,so). You will need to make
sure that your linker knows to include this library, with the -lm
flag.

I am surprised that that didn't work though. How did you configure
perl? Which platform did you tell it to use when doing the Configure
step?

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | That's funny, that plane's dustin'
Commercial Dynamics Pty. Ltd.       | crops where there ain't no crops.
NSW, Australia                      | 


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

Date: Thu, 28 Jan 1999 22:35:49 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: is crypt() function compatible?
Message-Id: <9D5s2.22$LH2.1585@nsw.nnrp.telstra.net>

In article <19990127191233.17233.00000082@ng155.aol.com>,
	thegroovy@aol.comNOSPAM (THE Groovy) writes:

>       I am making a mailing list manager for resale and am trying to
>       determine how compatible it is with Win NT. However, I was
>       stumped on the crypt() function, and am not sure if it is one
>       of those Unix-only commands, or does Win NT work the same?

Your question is a bit vague. Do you mean:

- Does perl for win32 have a crypt() function?

Yes. Current releases of the ActiveState perl ports do have a crypt
function. Older releases don't. I'm not entirely sure about the
5.004_02 GS port. You should be using a current release, and so should
your clients. :)

- Does the crypt() function produce the same output on all platforms?

No. crypt() is platform and configuration dependent. On unices it
makes a call to the crypt() C function, which can be implemented in
any way the OS manufacturer or the sysadmin decides. Some platforms or
configurations even remove it from their libraries, because of
'security' reasons.  The perl error you'll get is 'The crypt()
function is unimplemented due to excessive paranoia'.

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


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

Date: Thu, 28 Jan 1999 23:26:42 +0000
From: Nuno Leitao <nuno.leitao@uk.uu.net>
To: Steven Parker <sparker@wash.inmet.com>
Subject: Re: Mail INBOX parsing script
Message-Id: <36B0F232.AA113A2A@uk.uu.net>

  Go to CPAN (http://www.cpan.org) and check the MIME modules.

    Cheers.

Steven Parker wrote:

> I am interested in writing a script (or finding) that will parse the
> ASCII
> INBOX mail file.
>
> I don't know how to handle attachments.  How would you take the part of
> the
> file that corresponds to the attachment (say, a .exe file) and create
> the
> corresponding .exe file?
>
> Is there any code that anyone knows of that would give me hints (e.g.,
> emacs's mail parsing code)
>
> Any help here would be much appreciated!
>
> Thanks,
>
> Steve



-- Nuno Leitao (nuno.leitao@uk.uu.net)
Development Engineer, UUNET - An MCI WorldCom Company,
Internet House, 332 Science Park, Milton Road, Cambridge, CB4 4BZ
Tel +44 1223 250100
Fax +44 1223 250358     http://www.uk.uu.net/




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

Date: Thu, 28 Jan 1999 16:48:07 -0600
From: Forrest Reynolds <dropzone@mail.utexas.edu>
Subject: newbie pipe
Message-Id: <36B0E927.79BE789D@mail.utexas.edu>

Hello,
   I am trying to learn to work with pipes but I can't seem to wrap my mind
around the syntax. I know a pipe passes info from one program to another, but
I'm unsure how this is specified. For experiment, I'd like to open a file in
one program and pass it to another program that will then print it. Very
basic. Here's what I have so far:
#!/usr/bin/perl -w
while (<>) {

open (PASS,"| > see.pl") || die " couldnt open PASS"

   }

see.pl just has a while (<>){print;} in it.
see.pl is getting wiped out though, I think by the ">"
in the program above.
  Can someone show me how to this simple task so I can continue my
experimentation? or suggest where I could find out?

    Thanks, Forrest


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

Date: Thu, 28 Jan 1999 23:25:44 +0000
From: Nuno Leitao <nuno.leitao@uk.uu.net>
To: Forrest Reynolds <dropzone@mail.utexas.edu>
Subject: Re: newbie pipe
Message-Id: <36B0F1F7.B2ADEE6B@uk.uu.net>

  Hi there...

Forrest Reynolds wrote:

>  Here's what I have so far:
> #!/usr/bin/perl -w
> while (<>) {
>
> open (PASS,"| > see.pl") || die " couldnt open PASS"
>
>    }

Do it like:

open(PASS, "| see.pl") || die "oops!\n";

to pipe input *to* see.pl.

If you wanted to *get* input from a program you would something like:

open(PASS, "see.pl |" || die "oops!\n";

    Bye.


-- Nuno Leitao (nuno.leitao@uk.uu.net)
Development Engineer, UUNET - An MCI WorldCom Company,
Internet House, 332 Science Park, Milton Road, Cambridge, CB4 4BZ
Tel +44 1223 250100
Fax +44 1223 250358     http://www.uk.uu.net/




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

Date: Thu, 28 Jan 1999 16:18:06 -0600
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: Out of memory <?>
Message-Id: <36B0E21E.26198289@us.ibm.com>

Shawn A. Berg wrote:

> foreach (<SFILE>) {

while (defined ($line = <SFILE>)) {
- or just -
while (<SFILE>) {

-- 
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)


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

Date: Thu, 28 Jan 1999 16:09:19 -0500
From: Denis Haskin <Denis.Haskin@bigfoot.com>
To: Don <don@globalexpos.co.nz>
Subject: Re: Porting from Win32 perl to Unix perl
Message-Id: <36B0D1FF.47A6903C@bigfoot.com>

Could you provide some information as to what about it "doesn't work"?

dwh


Don wrote:

> Hiya...
>
> I was needed some help on this please..
>
> I have a script that needs to be ported ot Unix form a win32 platform...
> but when i port this bit from *Win32..
>
> print qq!
>
>  <table border=0 width=550><tr><td valign=top width=450>
>
>  !;
>
> to Unix..
>
> print ("<table border=0 width=550><tr><td valign=top width=450>");
>
> It doesn't work!!
>
> WHY?!
>
> Thanks
> Andrew



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

Date: Thu, 28 Jan 1999 17:02:25 -0500
From: "John T. Jarrett" <jjarrett@ecpi.com>
To: Chris Yeates <C.N.Yeates@cs.cf.ac.uk>
Subject: Re: Simple CGI with Perl
Message-Id: <36B0DE71.B1E1AACE@ecpi.com>

Also try setting and passing variables through XSSI. Check out webmonkey.com
for a good intro to XSSI if you are on an Apache machine.

Chris Yeates wrote:

> I am just embarking on a project to produce web pages with multiple choice
> tests at the end of each section. Does anybody know how I can write a CGI
> script to mark the tests and prevent access to the next section to those
> failing to achieve a high enough mark. ie 8 out of 10.
>
> Cheers
>
> C.N.Yeates@cs.cf.ac.uk



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

Date: 28 Jan 1999 22:11:29 GMT
From: "J. David Eisenberg" <nessus@shell5.ba.best.com>
Subject: Re: Stopping a foreach loop
Message-Id: <36b0e091$0$16666@nntp1.ba.best.com>

Ryan.Haman@mci.com wrote:
: Is there anyway to break (stop) a foreach loop?

Yes; use the "last" construct.  Here's an example:

   @the_list = (1, 2, 3, -1, 4, 5);

   foreach $item (@the_list)
   {
      last if $item < 0;
      print $item, "\n";
   }

-- 
J. David Eisenberg    http://www.best.com/~nessus


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

Date: 28 Jan 1999 21:57:38 GMT
From: hbamford@marconi.ih.lucent.com (Harold Bamford)
Subject: Re: Stopping a foreach loop
Message-Id: <78qmgi$p88@ssbunews.ih.lucent.com>

In article <78qkep$uqm$1@nnrp1.dejanews.com>,  <Ryan.Haman@mci.com> wrote:
>Is there anyway to break (stop) a foreach loop?

foreach $val (@list) {
	($val eq 'dead end') && last;
	&otherstuff;
}

>From the perlsyn man page:

> The last command is like the break statement in C (as used in loops);
> it immediately exits the loop in question.
> The continue block, if any, is not executed: 
> 
>     LINE: while (<STDIN>) {
>         last LINE if /^$/;      # exit when done with header
>         ...
>     }
-- 
-- Harold Bamford
   mailto:hbamford@lucent.com
   (630)713-1351


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

Date: Thu, 28 Jan 1999 16:25:08 -0600
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: Stopping a foreach loop
Message-Id: <36B0E3C4.4139EB0D@us.ibm.com>

Ryan.Haman@mci.com wrote:
 
> Is there anyway to break (stop) a foreach loop?

$ perldoc perlsyn

-- 
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)


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

Date: Thu, 28 Jan 1999 23:07:01 GMT
From: dhosek@webley.com
Subject: Re: Stopping a foreach loop
Message-Id: <78qqie$45g$1@nnrp1.dejanews.com>

In article <78qkep$uqm$1@nnrp1.dejanews.com>,
  Ryan.Haman@mci.com wrote:
> Is there anyway to break (stop) a foreach loop?

Yes. First, get a copy of the llama book and read the section on loops and
controls. I imagine that you're looking for last.

perldoc perlsyn will tell you a great deal if you're unwilling to buy a book

perldoc perl will tell you what "chapters" of information are available.

-dh

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


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

Date: Thu, 28 Jan 1999 15:17:32 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Stopping a foreach loop
Message-Id: <MPG.111a8fe49fd538b89899df@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <78qkep$uqm$1@nnrp1.dejanews.com> on Thu, 28 Jan 1999 
21:22:44 GMT, Ryan.Haman@mci.com <Ryan.Haman@mci.com> says...
> Is there anyway to break (stop) a foreach loop?

perldoc -f last
perldoc -f return
perldoc -f exit
perldoc -f die
perldoc -f exec

even (ugh!)

perldoc -f goto

That's off the top of my head.  Did I miss any?

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


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

Date: Thu, 28 Jan 1999 22:13:30 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: system function, Pros and Cons??
Message-Id: <ei5s2.19$LH2.1585@nsw.nnrp.telstra.net>

In article <36B0B73A.BD5224D@uwm-dev.gte.com>,
	John Chambers <jc@uwm-dev.gte.com> writes:
> Abigail wrote:
> 
>> Do you honestly believe that the basic UNIX tools are compatible?
>> Even very old tools like 'grep' and 'awk' are different between
>> well-known UNIX platforms as Solaris and HP-UX.

> Now I suppose someone will give me an example where it's better
> to fire up a grep subprocess than to do it in perl.  I wonder if
> there are such examples?

not grep, but awk. :)

>From perlvar:

             Remember: the value of $/ is a string, not a regexp.
             AWK has to be better for something :-)

Although I must say that I personally have never fired up awk from
within perl to get at this specific functionality. 

I avoid system() as much as possible, and if I _have_ to use it, it
gets its own sub/package, with appropriate tests around it (OS being a
big one, presence of certain directories/binaries being the next).

There aren't many things that tools do and that perl can't do, but
ofttimes you'll find that tools do it (much) faster, or have
implemented that one little option which is hell to code. If this
is the case, I'll use the tool, until I can find a way to duplicate
the functionality in perl, and at least approach the speed of the
tool.

Also, I never call system without specifying the full path to a
binary. As Abigail mentioned in another post, people have /usr/bin and
/usr/ucb (and on some platforms /usr/xpg4/bin or some other XOpen dir)
in their path, but the order of those depends on personal preference.
Some people have tools in /usr/local/bin and have that before
/usr/bin. I don't ever want to deal with search paths. If I want
/usr/ucb/ps, I will call it that.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | In the fight between you and the world,
Commercial Dynamics Pty. Ltd.       | back the world - Franz Kafka
NSW, Australia                      | 


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

Date: 28 Jan 1999 16:35:40 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: system function, Pros and Cons??
Message-Id: <36b0f44c@csnews>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, mgjv@comdyn.com.au (Martien Verbruggen) writes:
:not grep, but awk. :)


:There aren't many things that tools do and that perl can't do, but
:ofttimes you'll find that tools do it (much) faster, or have

You'll find that GNU grep is *dramatically* faster than Perl.

:implemented that one little option which is hell to code. 

You don't really want to code gnugrep's -C, or agrep's -2.

:Also, I never call system without specifying the full path to a
:binary. 

Well, that's certainly horrible.  It severely limits your portability.
Either assume the user has things ordered the way *they* want, or us for
setuid programs, just set a sane path at the beginning and then *only*
use relative paths.  You have no idea how many times this has bitten
me.  Is it in /bin or /usr/bin?  /etc or /sbin?  No, full paths 
severely hurt you.  Trust the user, or set the path, or both, 
but don't hard-wire paths without EXTREMELY good reason.  

Pick ten commands: true, netstat, more, perl, vi, sort, sendmail, mail,
ifconfig, route, and netscape.  Now, what are there paths? 
Remember the answer must work everywhere.  Now go to SunOS, BSD,
Linus, AIX, Solaris, HPUX, Irix, and Ultrix/DEC Unix.  Check the
paths.  See the problem?

--tom
-- 
"I'd rather have :rofix than const."
	    --Dennis Ritchie


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

Date: Thu, 28 Jan 1999 16:57:58 -0600
From: Tom Briles <tbriles@austin.ibm.com>
Subject: Re: The behaviour of split()
Message-Id: <36B0EB76.AED13648@austin.ibm.com>

Michael D. Hofer wrote:

> Tom Briles wrote:
> >
> > Michael wrote:
> >
> > > Hello!

<snipped sorta description of a problem>

> > > Any explanation?
> > >
> > > Michael
> >
> > And the answer is...
> >
> > One script has it coded one way, the other script has it coded another way!
> >
> > (I.e., post the code, and maybe we can help.)
> >
> > - Tom
>
> Nah, Nah, Nah!  Let's do it blind!  I'll bet he has a leading blank
> space in the string in the second instance:  The first element of the
> array will then be "".

That's a pretty good guess, but we'll have to see if the original poster
replies.

The first element is of course there, just not where expected.

> Can you guess how many times _I've_ done that?

Yes, 16.

- Tom



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

Date: Thu, 28 Jan 1999 15:45:28 -0700
From: "Derek R. Price" <derek_price@stortek.com>
Subject: Re: URI.pm Problem
Message-Id: <36B0E888.96917422@stortek.com>

I traced it.  It turned out to be an unlisted dependency of URI::data on
MIME::Base64.  I installed MIME::Base64 and all went well.

For those who like to know:

The URI->new method is testing for $@ =~ /^Can\'t locate.*in \@INC/ after
eval "require URI::$scheme" and treating the (non-error) case where the
URI::$scheme module couldn't be found and the (error) case where one of
URI::$scheme's dependencies couldn't be found the same.

Obviously the URI makefile isn't explicitly testing for dependencies
either and Bundle::LWP on CPAN currently attemps to install URI before
MIME::Base64 .

Derek

"Derek R. Price" wrote:

> I'm at a loss.  I was attempting to install the URI package using CPAN
> and got the following error:
>
> ------- Begin Inclusion -------
>
> Running make for GAAS/URI-1.00.tar.gz
> Unwrapped into directory /home/pricedr/.cpan/build/URI-1.00
> Has already been processed within this session
> Running make test
> PERL_DL_NONLAZY=1 /build/nss/tools/test/sparc-SunOS-5.5/bin/perl
> -Iblib/arch -Iblib/lib
> -I/build/nss/tools/test/sparc-SunOS-5.6/perl/lib/sun4-solaris
> -I/build/nss/tools/test/sparc-SunOS-5.6/perl/lib -e use Test::Harness
> qw(&runtests $verbose); $verbose=0; runtests @ARGV; t/*.t
> t/abs...............ok t/data..............Cant locate object method
> media_type via package URI::_foreign at t/data.t line 9.  dubious
> Test returned status 2 (wstat 512, 0x200)
> DIED. FAILED tests 2-21
> Failed 20/21 tests, 4.76% okay
>

[snip]

> ------- End Inclusion -------
>
> Derek



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

Date: 28 Jan 1999 21:15:52 GMT
From: Jeff Stampes <stampes@xilinx.com>
Subject: Re: Using Time:CTime
Message-Id: <78qk28$7p1@courier.xilinx.com>

Jeff Kalikstein <Jeff.Kalikstein@amd.com> wrote:
: I am new to perl, and appoligize if this question seems dumb.

no dumb questions if you've tried to help yourself first.

: I am writing a small script that needs to do some date manipulation, and
: Time:CTime seems to be the perfect solution for me.  However, I can not
: figure out how to do it.  I see in the documentation "strftime coverstions"-
: how do I use these.  

You read the documentation...great start!  

: For example, %a is supposed to give the day of the week
: abbreviation.  Could someone please give me an example of using CTime to do
: something simple, like storing the month into a scalar?  I should be able to
: work from there.

main::(-e:1):   1
  DB<1> use Time::CTime

  DB<2> $month = strftime("%b",localtime(time))

  DB<3> print $month
January
  DB<4> 

HTH,

Jeff


-- 
Jeff Stampes -- Xilinx, Inc. -- Boulder, CO -- jeff.stampes@xilinx.com


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

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

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