[10541] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4132 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 2 17:07:51 1998

Date: Mon, 2 Nov 98 14: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           Mon, 2 Nov 1998     Volume: 8 Number: 4132

Today's topics:
        "Account Manager Beta" crack? hujsan@my-dejanews.com
    Re: "Account Manager Beta" crack? <uri@fastengines.com>
        2Q: Perl modules & htaccess <smiles@wfubmc.edu>
        ActiveX and Perl <rtrussell@hps-inc.com>
    Re: Can CGI run without anyone "browsing it"? <webmaster@fccj.org>
    Re: CGI.pm problems with Xitami Web Server <chris_N0SPAM@trsilvius-co.com>
    Re: CGI.pm problems with Xitami Web Server <chris_N0SPAM@trsilvius-co.com>
    Re: Deleting .htaccess <eric.means@louisville.edu>
    Re: Deleting .htaccess <eric.means@louisville.edu>
    Re: Easy Question: Rounding Numbers <chris_N0SPAM@trsilvius-co.com>
    Re: Easy Question: Rounding Numbers (Larry Rosler)
    Re: help reqd installing GD (or other) module <gellyfish@btinternet.com>
    Re: How do i remove Carriage Returns og Newlines from a <webmaster@fccj.org>
    Re: How does one sort associative array numerically? <nick@perlfect.com>
        HTTP header error:  can't open perl script <alpha@alphasys.net>
    Re: Interesting challenge:  Reformatting text to 80 cha (John Stanley)
    Re: Interesting challenge:  Reformatting text to 80 cha (Larry Rosler)
        mortgage calculator script <talal@pdq.net>
        mortgage calculator script <talal@pdq.net>
    Re: Multiple pattern matching: Newbie question <webmaster@fccj.org>
    Re: Multiple pattern matching: Newbie question <gellyfish@btinternet.com>
    Re: Netscape equivalent of ASP <tmcgee@bondmarkets.com>
    Re: Netscape equivalent of ASP <gellyfish@btinternet.com>
    Re: Parsing problem <cmeilahn@nauiww.org>
        Problem with chop? and testing for null? <montyt@bestnet.com>
    Re: Problem with chop? and testing for null? <Allan@due.net>
    Re: Problem with chop? and testing for null? (Brand Hilton)
    Re: Problem with chop? and testing for null? <montyt@bestnet.com>
    Re: Problem with chop? and testing for null? (Larry Rosler)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Mon, 02 Nov 1998 20:46:17 GMT
From: hujsan@my-dejanews.com
Subject: "Account Manager Beta" crack?
Message-Id: <71l5mo$lbl$1@nnrp1.dejanews.com>

Please, is there a crack for the script "Account Manager Beta" wich you can
find on:

http://cgi.elitehost.com/acctlite/upgrade/

I really need it, can4t afford it...

Martin

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


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

Date: 02 Nov 1998 16:55:12 -0500
From: Uri Guttman <uri@fastengines.com>
To: hujsan@my-dejanews.com
Subject: Re: "Account Manager Beta" crack?
Message-Id: <sarsog1vjy7.fsf@camel.fastserv.com>

>>>>> "h" == hujsan  <hujsan@my-dejanews.com> writes:

  h> Please, is there a crack for the script "Account Manager Beta" wich
  h> you can find on:

  h> http://cgi.elitehost.com/acctlite/upgrade/

  h> I really need it, can4t afford it...

i will charge you only $200 for the cracks. since the program only cost
$149, i think this a fine markup don't you?

:-)

uri

-- 
Uri Guttman                  Fast Engines --  The Leader in Fast CGI Technology
uri@fastengines.com                                  http://www.fastengines.com


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

Date: Mon, 02 Nov 1998 14:20:33 -0500
From: Steve miles <smiles@wfubmc.edu>
Subject: 2Q: Perl modules & htaccess
Message-Id: <363E0601.D176B9@wfubmc.edu>

Hi everyone. I have two questions:

1. What can you type at the telnet command line to get a list of Perl
modules installed on your system? (I'm just using a hosting company...)

2. When creating a password protected membership site, is there any way
of getting around having to use .htaccess and it's password file for the
membership database? Is there a way to use Perl to let the person sign
in via a HTML form instead of the .htaccess popup and still be able to
have the contents of an entire directory protected? (Of course I'm
assuming you will still use an .htaccess file for the protected
directories, but I'm just looking for a way around the popup member
entrance...)

Thanks in advance,
Steve



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

Date: Mon, 2 Nov 1998 15:25:12 -0500
From: "Roger Kenneth Trussell" <rtrussell@hps-inc.com>
Subject: ActiveX and Perl
Message-Id: <71l4lf$fcd$1@supernews.com>

Hello Everyone,

    I'm sorry to bug everyone with a seemingly stupid question but...

    Does anyone know whether there exist a version of Perl for Windows
95/95/NT that can access ActiveX objects?  I've already heard about ActiveX
scripting engines, but I don't think that is what I want.  I want to write a
CGI-BIN script that can access ActiveX objects located on the server.

Sincerely,
Roger Trussell





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

Date: Mon, 02 Nov 1998 15:28:49 -0500
From: "Bill Jones, FCCJ Webmaster" <webmaster@fccj.org>
Subject: Re: Can CGI run without anyone "browsing it"?
Message-Id: <363E1601.688CF912@fccj.org>

Magnus Nilsson wrote:
> 
> Is it possible for a CGI program to, for example, read email from one
> account and send it to another - without constantly being activated by
> someone browsing by?
> 
> I'm really curious... thanks in advance!
> /Magnus Nilsson

Yes, but you have to be careful of program logic branching
into the CGI portion - if it does, it will expect
'parameter=data' pairs...

HTH,
-Sneex-  :]
______________________________________________________________________
Bill Jones  |  904/632-3089  |  http://www.fccj.org/cgi/mail?webmaster


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

Date: Mon, 02 Nov 1998 15:09:43 -0600
From: Chris <chris_N0SPAM@trsilvius-co.com>
To: John Reynolds <john@Ihavenomail.com>
Subject: Re: CGI.pm problems with Xitami Web Server
Message-Id: <71l745$bv6$1@news-2.news.gte.net>


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

So John,

You need to read the FAQ and documentation that comes with the cgi.pm module.

If you open the cgi-docs.html, you are given an example of how to use this,
which
differs slightly from what you did.

Here is an example that works:

#! perl

use CGI qw(:standard) ;
print header('text/plain'),"Nothing to it"'
exit;

I am running Xitami 2.4a and this runs fine from my cgi-bin directory.

Cheers!


John Reynolds wrote:

> Hello,
>
> My platform is Win95, Xitami 2.4a, Perl 5.004_02 (by Gurusamy Sarathy),
> CGI.pm 2.32.
>
> I can run simple CGI programs that use only core Perl (e.g. print
> "Content-type: text/html\n\nHowdy\n" ; ). In a case like this, there are no
> additional DOS windows started on the server for Perl to run. Output is
> sent
> correctly back to the browser.
>
> Here's a sample program using CGI.pm:
>
>
> When this is run, I first get a window on the server saying File Download,
> Temporary Folder. Next I get a DOS window that indicates a syntax error on
> line 1 near "it!". This program does run correctly from the command line
> which indicates that CGI.pm is installed and is being loaded by Perl. I've
> tried using #!perl and get the same results.
>
> TIA for any help!
> -- John

--
Chris Maylor
GTE - DestinationFAX(sm)
christopher.maylor@ins.gte.com
Tel:  972 550-1628

\\/////////////////////////////////////////\\
\\"Good judgment comes from experience, and\\
\\ a lot of that comes from bad judgment"  \\
\\/////////////////////////////////////////\\



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

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
So John,
<P>You need to read the FAQ and documentation that comes with the cgi.pm
module.
<P>If you open the cgi-docs.html, you are given an example of how to use
this, which
<BR>differs slightly from what you did.
<P>Here is an example that works:
<P>#! perl
<P>use CGI qw(:standard) ;
<BR>print header('text/plain'),"Nothing to it"'
<BR>exit;
<P>I am running Xitami 2.4a and this runs fine from my cgi-bin directory.
<P>Cheers!
<BR>&nbsp;
<P>John Reynolds wrote:
<BLOCKQUOTE TYPE=CITE>Hello,
<P>My platform is Win95, Xitami 2.4a, Perl 5.004_02 (by Gurusamy Sarathy),
<BR>CGI.pm 2.32.
<P>I can run simple CGI programs that use only core Perl (e.g. print
<BR>"Content-type: text/html\n\nHowdy\n" ; ). In a case like this, there
are no
<BR>additional DOS windows started on the server for Perl to run. Output
is
<BR>sent
<BR>correctly back to the browser.
<P>Here's a sample program using CGI.pm:
<BR>&nbsp;
<P>When this is run, I first get a window on the server saying File Download,
<BR>Temporary Folder. Next I get a DOS window that indicates a syntax error
on
<BR>line 1 near "it!". This program does run correctly from the command
line
<BR>which indicates that CGI.pm is installed and is being loaded by Perl.
I've
<BR>tried using #!perl and get the same results.
<P>TIA for any help!
<BR>-- John</BLOCKQUOTE>

<PRE>--&nbsp;
Chris Maylor
GTE - DestinationFAX(sm)
christopher.maylor@ins.gte.com
Tel:&nbsp; 972 550-1628

\\/////////////////////////////////////////\\
\\"Good judgment comes from experience, and\\
\\ a lot of that comes from bad judgment"&nbsp; \\
\\/////////////////////////////////////////\\</PRE>
&nbsp;</HTML>

--------------C0EE2E03A048BEF4E92BCDA4--



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

Date: Mon, 02 Nov 1998 15:57:48 -0600
From: Chris <chris_N0SPAM@trsilvius-co.com>
Subject: Re: CGI.pm problems with Xitami Web Server
Message-Id: <71l9t3$rfs$1@news-1.news.gte.net>


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

And of course, don't forget the semi-colon I missed on the print line!!
Damn those low tech fingers....


Cheers!

Chris wrote:

> So John,
>
> You need to read the FAQ and documentation that comes with the cgi.pm
> module.
>
> If you open the cgi-docs.html, you are given an example of how to use
> this, which
> differs slightly from what you did.
>
> Here is an example that works:
>
> #! perl
>
> use CGI qw(:standard) ;
> print header('text/plain'),"Nothing to it"'
> exit;
>
> I am running Xitami 2.4a and this runs fine from my cgi-bin directory.
>
> Cheers!
>
>
> John Reynolds wrote:
>
>> Hello,
>>
>> My platform is Win95, Xitami 2.4a, Perl 5.004_02 (by Gurusamy
>> Sarathy),
>> CGI.pm 2.32.
>>
>> I can run simple CGI programs that use only core Perl (e.g. print
>> "Content-type: text/html\n\nHowdy\n" ; ). In a case like this, there
>> are no
>> additional DOS windows started on the server for Perl to run. Output
>> is
>> sent
>> correctly back to the browser.
>>
>> Here's a sample program using CGI.pm:
>>
>>
>> When this is run, I first get a window on the server saying File
>> Download,
>> Temporary Folder. Next I get a DOS window that indicates a syntax
>> error on
>> line 1 near "it!". This program does run correctly from the command
>> line
>> which indicates that CGI.pm is installed and is being loaded by
>> Perl. I've
>> tried using #!perl and get the same results.
>>
>> TIA for any help!
>> -- John
>
> --
> Chris Maylor
> GTE - DestinationFAX(sm)
> christopher.maylor@ins.gte.com
> Tel:  972 550-1628
>
> \\/////////////////////////////////////////\\
> \\"Good judgment comes from experience, and\\
> \\ a lot of that comes from bad judgment"  \\
> \\/////////////////////////////////////////\\
>
>

--
Chris Maylor
GTE - DestinationFAX(sm)
christopher.maylor@ins.gte.com
Tel:  972 550-1628

\\/////////////////////////////////////////\\
\\"Good judgment comes from experience, and\\
\\ a lot of that comes from bad judgment"  \\
\\/////////////////////////////////////////\\



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

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
And of course, don't forget the semi-colon I&nbsp;missed on the print line!!
<BR>Damn those low tech fingers....
<BR>&nbsp;
<P>Cheers!
<P>Chris wrote:
<BLOCKQUOTE TYPE=CITE>So John,
<P>You need to read the FAQ and documentation that comes with the cgi.pm
module.
<P>If you open the cgi-docs.html, you are given an example of how to use
this, which
<BR>differs slightly from what you did.
<P>Here is an example that works:
<P>#! perl
<P>use CGI qw(:standard) ;
<BR>print header('text/plain'),"Nothing to it"'
<BR>exit;
<P>I am running Xitami 2.4a and this runs fine from my cgi-bin directory.
<P>Cheers!
<BR>&nbsp;
<P>John Reynolds wrote:
<BLOCKQUOTE TYPE=CITE>Hello,
<P>My platform is Win95, Xitami 2.4a, Perl 5.004_02 (by Gurusamy Sarathy),
<BR>CGI.pm 2.32.
<P>I can run simple CGI programs that use only core Perl (e.g. print
<BR>"Content-type: text/html\n\nHowdy\n" ; ). In a case like this, there
are no
<BR>additional DOS windows started on the server for Perl to run. Output
is
<BR>sent
<BR>correctly back to the browser.
<P>Here's a sample program using CGI.pm:
<BR>&nbsp;
<P>When this is run, I first get a window on the server saying File Download,
<BR>Temporary Folder. Next I get a DOS window that indicates a syntax error
on
<BR>line 1 near "it!". This program does run correctly from the command
line
<BR>which indicates that CGI.pm is installed and is being loaded by Perl.
I've
<BR>tried using #!perl and get the same results.
<P>TIA for any help!
<BR>-- John</BLOCKQUOTE>

<PRE>--&nbsp;
Chris Maylor
GTE - DestinationFAX(sm)
christopher.maylor@ins.gte.com
Tel:&nbsp; 972 550-1628

\\/////////////////////////////////////////\\
\\"Good judgment comes from experience, and\\
\\ a lot of that comes from bad judgment"&nbsp; \\
\\/////////////////////////////////////////\\</PRE>
&nbsp;</BLOCKQUOTE>

<PRE>--&nbsp;
Chris Maylor
GTE - DestinationFAX(sm)
christopher.maylor@ins.gte.com
Tel:&nbsp; 972 550-1628

\\/////////////////////////////////////////\\
\\"Good judgment comes from experience, and\\
\\ a lot of that comes from bad judgment"&nbsp; \\
\\/////////////////////////////////////////\\</PRE>
&nbsp;</HTML>

--------------4ED2617A82AA184AC9719577--



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

Date: Mon, 2 Nov 1998 15:33:41 -0500
From: "Eric Means" <eric.means@louisville.edu>
Subject: Re: Deleting .htaccess
Message-Id: <aFo%1.1506$wl.1526@news.ntr.net>

>$member = `ls $files`;


$member = `ls -a $files`;


Also try
man ls

--
Eric Means
Louisville Gas & Electric Co.
eric.means@lgeenergy.com





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

Date: Mon, 2 Nov 1998 15:34:50 -0500
From: "Eric Means" <eric.means@louisville.edu>
Subject: Re: Deleting .htaccess
Message-Id: <gGo%1.1507$wl.1548@news.ntr.net>

>How would you make this code delete .htaccess files too?


Or, more succinctly . . .

rm -r <dir>

--
Eric Means
Louisville Gas & Electric Co.
eric.means@lgeenergy.com





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

Date: Mon, 02 Nov 1998 15:15:31 -0600
From: Chris <chris_N0SPAM@trsilvius-co.com>
To: Alistair Calder <webmaster@topproducer.com>
Subject: Re: Easy Question: Rounding Numbers
Message-Id: <71l7f1$bv6$2@news-2.news.gte.net>


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

Alistair Calder wrote:

A not too tough math problem, just make the number bigger (by the exponent of
the number of
decimals you need, round up, and re-divide)..

Try this:

result= (int (10^dec * source + .5)) / 10^dec

So in your example,
= (int (10 * 12.591237489 +.5)) / 100
= (int (125.91237489 + .5) /100
= (int (126.41237489) /100
= (126) / 100
= 12.6




> I have looked through the Camel book, but I could not find an answer to this
> question:
>
> I have a variable that is the result of a division, and I want to round it
> to 1 or 2 decimal places.
>
> The only thing I have at my disposal is INT(), but it just truncates, it
> doesn't round up or down.
>
> How do I turn this number:
>
> 12.591237489
>
> Into this one:
>
> 12.6
>
> Thanks,
> Alistair Calder

--
Chris Maylor
GTE - DestinationFAX(sm)
christopher.maylor@ins.gte.com
Tel:  972 550-1628

\\/////////////////////////////////////////\\
\\"Good judgment comes from experience, and\\
\\ a lot of that comes from bad judgment"  \\
\\/////////////////////////////////////////\\



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

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
Alistair Calder wrote:
<P>A not too tough math problem, just make the number bigger (by the exponent
of the number of
<BR>decimals you need, round up, and re-divide)..
<P>Try this:
<P>result= (int (10^dec * source +&nbsp;.5)) / 10^dec
<P>So in your example,
<BR>= (int (10 * 12.591237489 +.5)) / 100
<BR>= (int (125.91237489 + .5) /100
<BR>= (int (126.41237489) /100
<BR>= (126) / 100
<BR>= 12.6
<BR>&nbsp;
<BR>&nbsp;
<BR>&nbsp;
<BLOCKQUOTE TYPE=CITE>I have looked through the Camel book, but I could
not find an answer to this
<BR>question:
<P>I have a variable that is the result of a division, and I want to round
it
<BR>to 1 or 2 decimal places.
<P>The only thing I have at my disposal is INT(), but it just truncates,
it
<BR>doesn't round up or down.
<P>How do I turn this number:
<P>12.591237489
<P>Into this one:
<P>12.6
<P>Thanks,
<BR>Alistair Calder</BLOCKQUOTE>

<PRE>--&nbsp;
Chris Maylor
GTE - DestinationFAX(sm)
christopher.maylor@ins.gte.com
Tel:&nbsp; 972 550-1628

\\/////////////////////////////////////////\\
\\"Good judgment comes from experience, and\\
\\ a lot of that comes from bad judgment"&nbsp; \\
\\/////////////////////////////////////////\\</PRE>
&nbsp;</HTML>

--------------4AE4C12786DBED5514FCCF56--



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

Date: Mon, 2 Nov 1998 13:50:44 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Easy Question: Rounding Numbers
Message-Id: <MPG.10a7c9102e193b798985d@nntp.hpl.hp.com>

In article <71l7f1$bv6$2@news-2.news.gte.net> on Mon, 02 Nov 1998 
15:15:31 -0600, Chris <chris_N0SPAM@trsilvius-co.com> says...
 ...
> result= (int (10^dec * source + .5)) / 10^dec

This is a Perl group.  How would that code read in Perl?  Not like that 
at all, I'll wager.  Besides the failure to label scalar variables and 
to terminate the statement.

> So in your example,
> = (int (10 * 12.591237489 +.5)) / 100
> = (int (125.91237489 + .5) /100
> = (int (126.41237489) /100
> = (126) / 100
> = 12.6

Does (126) / 100 really equal 12.6?

The Surgeon General warns you not to use this method on negative 
numbers!

Use sprintf, as discussed in perlfaq4:  "Does perl have a round 
function? ..."

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


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

Date: 2 Nov 1998 21:03:51 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: help reqd installing GD (or other) module
Message-Id: <71l6nn$f9$1@gellyfish.btinternet.com>

On Mon, 02 Nov 1998 16:37:07 GMT psmythe@my-dejanews.com wrote:
> Hi there
> 
> Can someone please point me to the FAQ or give advice on how to install the GD
> module.  Where do I get the module to install it?
> 
You can find the GD module at :

http://www.perl.com/CPAN/authors/id/LDS/GD-1.18.tar.gz

Once you have unpacked the distribution you will have a README file that
has instructions to do the installation.

> There doesn't seem to be much activity in the comp.lang.perl.modules group.

Oh well

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


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

Date: Mon, 02 Nov 1998 15:26:49 -0500
From: "Bill Jones, FCCJ Webmaster" <webmaster@fccj.org>
Subject: Re: How do i remove Carriage Returns og Newlines from a string via regexp's ?
Message-Id: <363E1589.623F4597@fccj.org>

maxm wrote:
> 
> I read in a whole file line by line and then concatenate the lines into one
> string. Including \n \r. How do I remove selected \n \r via s/// ?
> 
> Something like s/somepattern$//
> 

Close - How about:

s/\n//g;
s/\r//g;

HTH,
-Sneex-  :]
______________________________________________________________________
Bill Jones  |  904/632-3089  |  http://www.fccj.org/cgi/mail?webmaster


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

Date: Mon, 02 Nov 1998 22:08:42 +0000
From: Nick Moraitakis <nick@perlfect.com>
Subject: Re: How does one sort associative array numerically?
Message-Id: <363E2D69.D95F6AE1@perlfect.com>


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

Darrin Edwards wrote:

> I might consider some of the contents of that page shameless copying
> of perlfaq4 (without attribution) except:
>
> 1) you omit the "sort" keyword in your last 4 examples;
> 2) you spell "sort" as "dort" at one point (although admittedly not
>    in actual code).

The only related documentation I have read is the camel book and an excellent article
from the perl journal. I have not read the section you refer to from perlfaq4. But, in
any case, I do not claim that I am the inventor of the ideas propsed in the article.
Just about anything I could write about programming techniques in perl is already
documented in one way of another. My articles on this page, are only meant to provide
a tutorial-like approach to certain issues the way I would like to have had read about
them when I first had to learn about them myself. I don't see what's wrong with that.
If you think there is something wrong, I'll be glad to discuss it with you. Perhaps
you are making a point that I failed to recognise or think about. Also, thanks for
pointing me to those errors. They ahve been corrected.

--
Nick Moraitakis
http://perlfect.com



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

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
Darrin Edwards wrote:
<BLOCKQUOTE TYPE=CITE>I might consider some of the contents of that page
shameless copying
<BR>of perlfaq4 (without attribution) except:
<P>1) you omit the "sort" keyword in your last 4 examples;
<BR>2) you spell "sort" as "dort" at one point (although admittedly not
<BR>&nbsp;&nbsp; in actual code).</BLOCKQUOTE>
The only related documentation I have read is the camel book and an excellent
article from the perl journal. I have not read the section you refer to
from perlfaq4. But, in any case, I do not claim that I am the inventor
of the ideas propsed in the article. Just about anything I could write
about programming techniques in perl is already documented in one way of
another. My articles on this page, are only meant to provide a tutorial-like
approach to certain issues the way I would like to have had read about
them when I first had to learn about them myself. I don't see what's wrong
with that. If you think there is something wrong, I'll be glad to discuss
it with you. Perhaps you are making a point that I failed to recognise
or think about. Also, thanks for pointing me to those errors. They ahve
been corrected.
<PRE>--&nbsp;
Nick Moraitakis
<A HREF="http://perlfect.com">http://perlfect.com</A></PRE>
&nbsp;</HTML>

--------------5166E01BCAC25B3104990581--



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

Date: Mon, 02 Nov 1998 15:26:51 -0500
From: E-Mail Transponder <alpha@alphasys.net>
Subject: HTTP header error:  can't open perl script
Message-Id: <363E158B.BAEC3304@alphasys.net>

Hi,

I am using FrontPage98 on a WIN95 platform that later I upgrade to a NT
server.

I got the following error message when I tried to use a cgi program:

The spceified CGI application misbehaved by not returning a complete set
of HTTP headers.  The headers it did return are:

Can't open perl script "??????????i?????": Invalid argument.

Can anyone help me?

--Janice



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

Date: 2 Nov 1998 20:26:02 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Interesting challenge:  Reformatting text to 80 chars.
Message-Id: <71l4gq$1hm$1@news.NERO.NET>

In article <MPG.10a7ac19325bde59989857@nntp.hpl.hp.com>,
Larry Rosler <lr@hpl.hp.com> wrote:
>In article <71ktis$qrv$1@news.NERO.NET> on 2 Nov 1998 18:27:40 GMT, John 
>Stanley <stanley@skyking.OCE.ORST.EDU> says...
>> fmt
>
>Nice if you have such a command.  

Yes. Source is free. Why wouldn't you have it?



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

Date: Mon, 2 Nov 1998 13:21:17 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Interesting challenge:  Reformatting text to 80 chars.
Message-Id: <MPG.10a7c226630971fa989859@nntp.hpl.hp.com>

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

In article <71l4gq$1hm$1@news.NERO.NET> on 2 Nov 1998 20:26:02 GMT, John 
Stanley <stanley@skyking.OCE.ORST.EDU> says...
> In article <MPG.10a7ac19325bde59989857@nntp.hpl.hp.com>,
> Larry Rosler <lr@hpl.hp.com> wrote:
> >In article <71ktis$qrv$1@news.NERO.NET> on 2 Nov 1998 18:27:40 GMT, John 
> >Stanley <stanley@skyking.OCE.ORST.EDU> says...
> >> fmt
> >
> >Nice if you have such a command.  
> 
> Yes. Source is free. Why wouldn't you have it?

Two reasons come to mind immediately:

1.  Might not have a Unix system installed (hard to believe, eh?)

2.  Might not have a C compiler installed  (hard to believe, eh?)

But everyone who reads here presumably has Perl installed.  (I don't 
know if a C compiler is required to install that particular module, 
TEXT::Wrap, though, but I doubt it.)

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


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

Date: Mon, 2 Nov 1998 14:34:23 -0600
From: "Talal Nehme" <talal@pdq.net>
Subject: mortgage calculator script
Message-Id: <MFo%1.1311$%82.890@news12.ispnews.com>

Hello
i am looking for a mortgage calculator perl script
if you know where to find one please email me at talal@pdq.net




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

Date: Mon, 2 Nov 1998 14:24:50 -0600
From: "Talal Nehme" <talal@pdq.net>
Subject: mortgage calculator script
Message-Id: <0xo%1.1309$%82.29@news12.ispnews.com>

I am looking for mortgage calculator script, i found a few free java
scripts, but
i wonder if anyone knows where i can find a perl script.




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

Date: Mon, 02 Nov 1998 15:31:05 -0500
From: "Bill Jones, FCCJ Webmaster" <webmaster@fccj.org>
Subject: Re: Multiple pattern matching: Newbie question
Message-Id: <363E1689.ECD20F63@fccj.org>

Patrick wrote:
> 
> $s=~ /(9FA001)([A-F,\d]{2,2})([A-F,\d]{2,2})/;
> 
>  returning the values in $2, $3 for the first pattern match encountered.
> 
> The thing is the tag also occurs later on in the file with different
> data appended
> and I would like to return this info also.
> Something using /g or \G perhaps??? Thanks for any ideas.


Actually, try reading the file one line at a time, 
instead of trying /g

HTH,
-Sneex-  :]
______________________________________________________________________
Bill Jones  |  904/632-3089  |  http://www.fccj.org/cgi/mail?webmaster


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

Date: 2 Nov 1998 20:34:20 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Multiple pattern matching: Newbie question
Message-Id: <71l50c$dg$1@gellyfish.btinternet.com>

On Mon, 02 Nov 1998 15:15:46 +0100 Patrick <patrick45@hotmail.com> wrote:
> Hi there!
>        I am fairly new to perl, and was interested in finding values in
> a file
> tagged by '9FA001' the following pattern search works fine:
> 
> $s=~ /(9FA001)([A-F,\d]{2,2})([A-F,\d]{2,2})/;
> 
>  returning the values in $2, $3 for the first pattern match encountered.
> 
> The thing is the tag also occurs later on in the file with different
> data appended
> and I would like to return this info also.
> Something using /g or \G perhaps??? Thanks for any ideas.
> 

If uou already have the entire file in the variable $s then yes you would
be able to do :

 while($s=~ /(9FA001)([A-F,\d]{2,2})([A-F,\d]{2,2})/g)
   {
      print $2,$3,"\n" ; # for example
   }

If however you have line oriented data then you will be iterating over
lines read thus:

  while(<>) # assuming data is coming in STDIN
    {
      if( /(9FA001)([A-F,\d]{2,2})([A-F,\d]{2,2})/ )
        {
          print $2,$3,"\n" ; # for example
        }
    }

As an aside the quantifier {2,2} is identical to {2} which will save you
two keystrokes.

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


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

Date: Mon, 02 Nov 1998 15:06:00 -0500
From: Tom McGee <tmcgee@bondmarkets.com>
Subject: Re: Netscape equivalent of ASP
Message-Id: <363E10A8.32A@bondmarkets.com>

no-spam wrote:
> 
> Is there an equivalent of ASP using PERL (or anything) on Netscape's
> servers?

<!--#exec cgi="/cgi-bin/myscript.pl"-->

runs the perl script of your choice, and embeds the content in-place.

--Tom


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

Date: 2 Nov 1998 20:48:15 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Netscape equivalent of ASP
Message-Id: <71l5qf$dk$1@gellyfish.btinternet.com>

On Mon, 02 Nov 1998 16:12:28 GMT Justin Harvey <jbharvey@corp.home.net> wrote:
> 
> Forgive my ignorance, ASP?
> 
> no-spam wrote:
>> 
>> Is there an equivalent of ASP using PERL (or anything) on Netscape's
>> servers?
> 

HeHe Active Server Pages - a MicroSloth thing (in this case ignorance is bliss).
I think this is really a question for a comp.infosystems.www.servers.* group.
OK I know we have PerlScript and Apache::ASP for mod_perl.

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


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

Date: Mon, 02 Nov 1998 16:22:57 -0500
From: Carl Meilahn <cmeilahn@nauiww.org>
Subject: Re: Parsing problem
Message-Id: <363E22B1.BF2583E7@nauiww.org>

Thanks to those who helped... problem fixed..

I now have 1000+ lines of perl cgi programming running.

--Carl M.


Carl Meilahn wrote:

> please respond to email...
>
> I am having problems with one of my subroutines (about 30 lines
> out of  about 1000)...
>
> Background:
> I'm working on scripts to manage a pipe( | ) delimited database,
> based on the Solena Sol DB_Manager scripts.  The database is for
> Job and Resume listings for our website.
>
> my forms are sending:
>
> <textarea wrap=virtual ...>
>
> which works fine, but if someone hits enter/return while in that
> text area, my scripts turn that into a new line, which is then
> turned into a new row for the database (incorrectly).  I would
> like to change this carriage return character into the html <P>.
>
> Any suggestions?
>
> Thanks in advance.
>
> --Carl M.
> webmaster@nauiww.org



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

Date: Mon, 2 Nov 1998 12:14:58 -0800
From: "Monty Taylor" <montyt@bestnet.com>
Subject: Problem with chop? and testing for null?
Message-Id: <71l3sa$30622@roc344.ghc.org>

Sorry about the odd subject, I'm not really sure how to classify this one.
I've tried multiple different covolutions of this one to no avail, so I'm
hoping someone can lend a hand...

 print " New value (return to keep): ";
 $value = <>;
 chop($value);
 if ( $value != "" ) {
     $values{$keys[$choice]} = $value;
 }

This code snip should not do anything if the value entered is null (they
just hit enter) Right? Well, it does that fine... and it also avoids doing
anything if you enter a zero (0) (Which I can't see any reason for) I've
tried changing the test condition around a little. I tried not chopping and
testing for "\n" -- that didn't work either. I'm using perl -w, and this is
5.004 on a Solaris 2.6 machine.
( I know my variable names are the least confusing... sorry.)

Any help will be greatly appreciated.

Thanks,
--
-----------------------------------------------
Monty Taylor
Sybase DBA, UNIX Admin
Best Consulting -- Seattle, WA
montyt@bestnet.com




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

Date: Mon, 2 Nov 1998 16:02:39 -0500
From: "AmD" <Allan@due.net>
Subject: Re: Problem with chop? and testing for null?
Message-Id: <71l6m5$ai$1@camel15.mindspring.com>

Hi Monty,

Monty Taylor wrote in message <71l3sa$30622@roc344.ghc.org>...
>Sorry about the odd subject, I'm not really sure how to classify this one.
>I've tried multiple different covolutions of this one to no avail, so I'm
>hoping someone can lend a hand...
>
> print " New value (return to keep): ";
> $value = <>;
> chop($value);
> if ( $value != "" ) {
>     $values{$keys[$choice]} = $value;
> }
>
>This code snip should not do anything if the value entered is null (they
>just hit enter) Right? Well, it does that fine... and it also avoids doing
>anything if you enter a zero (0) (Which I can't see any reason for)

Well it might be because setting $value to 0 makes it false (in a Boolean
sense) and your if evaluates 0 against "", which is also false.  Since both
0 and "" are false, the if finds a match and the assignment is not made.  It
has nothing to do with the chop.  It also has nothing to do with the fact
that you should probably be using chomp instead of chop.

How about

if ( $value =~ /\d/ ) {

if you are trying to check for digits?

HTH

AmD
[ccd to author]




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

Date: 2 Nov 1998 21:16:35 GMT
From: bhilton@tsg.adc.com (Brand Hilton)
Subject: Re: Problem with chop? and testing for null?
Message-Id: <71l7fj$bh18@mercury.adc.com>

In article <71l3sa$30622@roc344.ghc.org>,
Monty Taylor <montyt@bestnet.com> wrote:
>Sorry about the odd subject, I'm not really sure how to classify this one.
>I've tried multiple different covolutions of this one to no avail, so I'm
>hoping someone can lend a hand...
>
> print " New value (return to keep): ";
> $value = <>;
> chop($value);
> if ( $value != "" ) {

That's an arithmetic operator.  You want 'ne'.

-- 
 _____ 
|///  |   Brand Hilton  bhilton@adc.com
|  ADC|   ADC Telecommunications, ATM Transport Division
|_____|   Richardson, Texas


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

Date: Mon, 2 Nov 1998 12:26:12 -0800
From: "Monty Taylor" <montyt@bestnet.com>
Subject: Re: Problem with chop? and testing for null?
Message-Id: <71l4hc$30623@roc344.ghc.org>

Never mind. ('eq' ne '==') Someone please kill me now.

My dad always told me sleep had a purpose, maybe now I'm beginning to see
it. :)

--
-----------------------------------------------
Monty Taylor
Sybase DBA, UNIX Admin
Best Consulting -- Seattle, WA
montyt@bestnet.com
Monty Taylor wrote in message <71l3sa$30622@roc344.ghc.org>...
>Sorry about the odd subject, I'm not really sure how to classify this one.
>I've tried multiple different covolutions of this one to no avail, so I'm
>hoping someone can lend a hand...
>
> print " New value (return to keep): ";
> $value = <>;
> chop($value);
> if ( $value != "" ) {
>     $values{$keys[$choice]} = $value;
> }
>
>This code snip should not do anything if the value entered is null (they
>just hit enter) Right? Well, it does that fine... and it also avoids doing
>anything if you enter a zero (0) (Which I can't see any reason for) I've
>tried changing the test condition around a little. I tried not chopping and
>testing for "\n" -- that didn't work either. I'm using perl -w, and this is
>5.004 on a Solaris 2.6 machine.
>( I know my variable names are the least confusing... sorry.)
>
>Any help will be greatly appreciated.
>
>Thanks,
>--
>-----------------------------------------------
>Monty Taylor
>Sybase DBA, UNIX Admin
>Best Consulting -- Seattle, WA
>montyt@bestnet.com
>
>




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

Date: Mon, 2 Nov 1998 13:27:30 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Problem with chop? and testing for null?
Message-Id: <MPG.10a7c39de650259598985a@nntp.hpl.hp.com>

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

In article <71l3sa$30622@roc344.ghc.org> on Mon, 2 Nov 1998 12:14:58 -
0800, Monty Taylor <montyt@bestnet.com> says...
 ...
>  if ( $value != "" ) {
>      $values{$keys[$choice]} = $value;
>  }

String comparisons are done using 'eq' or 'ne'.  You are using a 
numerical comparison, and the '-w' flag would have informed you that "" 
isn't numeric.

In a numerical comparison,  "0" and "" are each FALSE, hence equal.  In 
a string comparison, "0" (a string of length 1) and "" (a string of 
length 0) are not equal.

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


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

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


Administrivia:

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

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


The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

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

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

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 4132
**************************************

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