[10799] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4400 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Dec 10 18:07:15 1998

Date: Thu, 10 Dec 98 15: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           Thu, 10 Dec 1998     Volume: 8 Number: 4400

Today's topics:
    Re: Adding commas to Currency Numbers? (Mark-Jason Dominus)
    Re: Adding commas to Currency Numbers? <kenhirsch@myself.com>
    Re: Adding commas to Currency Numbers? (Mitch Rosefelt)
    Re: array initialisation (Larry Rosler)
    Re: Can someone tell me why .... (Joergen W. Lang)
    Re: Change Directory (Tad McClellan)
    Re: file locking question (Bill Moseley)
    Re: file locking question (Craig Berry)
        help on error message <wqi@leland.Stanford.EDU>
    Re: Help wanted: saving remote URL to local file <due@murray.fordham.edu>
    Re: interpolation constipation (Sean McAfee)
    Re: interpolation constipation <uri@ibnets.com>
    Re: interpolation constipation (Mark-Jason Dominus)
    Re: interpolation constipation (Greg Bacon)
        Making O'Reilly phone script do html (Damon K. Haley)
    Re: Newbie Question (Martien Verbruggen)
        Pattern matching and name parsing <kiml@worldnetla.net>
    Re: Pattern matching and name parsing <baliga@synopsys.com>
    Re: Pattern matching and name parsing (Craig Berry)
    Re: Pattern matching and name parsing (Greg Bacon)
        Perl tip needed: High CPU Usage wyndo@cxo.com
    Re: Perl tip needed: High CPU Usage (Craig Berry)
        Scripts <rmegowan@interlogics.net>
    Re: Scripts (Erik)
        SSI in perl? <dixonmat@pouch.com>
    Re: SSI in perl? (Martien Verbruggen)
        Using fonts in table built with CGI.pm brandtr3769@my-dejanews.com
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: 10 Dec 1998 16:53:28 -0500
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Adding commas to Currency Numbers?
Message-Id: <74pfso$44m$1@monet.op.net>

In article <MPG.10d9d3ec91b78813989691@news.midplains.net>,
Mitch Rosefelt <mitch@thepixelfarm.com> wrote:
>Could someone share with me an efficient technique for adding commas to 
>currency numbers I.E.  #######.## --> #,###,###.##


perlfaq5:

       How can I output my numbers with commas added?


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

Date: Thu, 10 Dec 1998 15:27:43 -0500
From: "Ken Hirsch" <kenhirsch@myself.com>
Subject: Re: Adding commas to Currency Numbers?
Message-Id: <74paoe$p0u$1@fddinewz.oit.unc.edu>

sub commaize {
  ($num) = @_;
  while ($num =~ s/(^|[^.\d])(\d+)(?=\d\d\d\b)/$1$2,/) {}
  return $num;
}

Mitch Rosefelt wrote in message ...
>Could someone share with me an efficient technique for adding commas to
>currency numbers I.E.  #######.## --> #,###,###.##
>
>Thanks much.
>
>Mitch Rosefelt




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

Date: Thu, 10 Dec 1998 17:04:56 -0600
From: mitch@thepixelfarm.com (Mitch Rosefelt)
Subject: Re: Adding commas to Currency Numbers?
Message-Id: <MPG.10da0f91ac3f8948989692@news.midplains.net>

In article <74pfso$44m$1@monet.op.net>, mjd@op.net says...
> In article <MPG.10d9d3ec91b78813989691@news.midplains.net>,
> Mitch Rosefelt <mitch@thepixelfarm.com> wrote:
> >Could someone share with me an efficient technique for adding commas to 
> >currency numbers I.E.  #######.## --> #,###,###.##
> 
> 
> perlfaq5:
> 
>        How can I output my numbers with commas added?
> 
Thanks very much.

Mitch


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

Date: Thu, 10 Dec 1998 13:04:10 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: array initialisation
Message-Id: <MPG.10d9d721ab7cad8e9898bd@nntp.hpl.hp.com>

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

In article <36732aa5.1266350@news.skynet.be> on Thu, 10 Dec 1998 
20:11:14 GMT, Bart Lateur <bart.lateur@skynet.be> says...
> Larry Rosler wrote:
> 
> >As I seem to be taking on the benchmarking burden these days...
> 
> Just curious... Do you create the test scripts by hand, or do you have a
> (Perl) tool that converts plain code to a benchmark?

Don't I wish.  All I have a standard benchmarking scaffold (copied a 
while ago from a submission to this newsgroup) into which I write or 
copy snippets.  Usually they are short.  If they are long, they can go 
into subroutines that get called in the benchmark snippets.

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


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

Date: Thu, 10 Dec 1998 23:23:33 +0100
From: jwl@worldmusic.de (Joergen W. Lang)
Subject: Re: Can someone tell me why ....
Message-Id: <1dju6hq.1bmbuiu1dmnsfcN@host024-210.seicom.net>

Ronald J Kimball <rjk@linguist.dartmouth.edu> wrote:

> By the way, my cat just walked across my keyboard and created this Perl
> script that doesn't quite work...  Could you debug it for me?

Your _cat_ ? Naah. ;-)

Joergen
-- 
-------------------------------------------------------------------
   "Everything is possible - even sometimes the impossible"
             HOELDERLIN EXPRESS - "Touch the void"
-------------------------------------------------------------------


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

Date: Thu, 10 Dec 1998 15:28:42 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Change Directory
Message-Id: <aeep47.ln.ln@magna.metronet.com>

Erik van Roode (newsposter@cthulhu.demon.nl) wrote:

: Hm, @list[$loop] is supposed to return an array, assuming the
                                         ^^^^^^^^
: array contains 2 elements, might it be possible that you try to open
: the directory '2'?


   No, that's not what happened.



   @list[$loop] is supposed to return a *list*.

   This is one of the few places where the distinction between
   a 'list' and an 'array' is important.


   An 'array' in a scalar context returns the number of elements
   in the array.

   A 'list' in a scalar context returns the last element of the list.


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

@list = qw / one two three /;

$named_array = @list;
print "\$named_array = $named_array\n";

$array_slice = @list[1];                    # a one-element list
print "\$array_slice = $array_slice\n";

$array_slice = @list[0..2];                 # a three element list
print "\$array_slice = $array_slice\n";
----------------------

output:

Scalar value @list[1] better written as $list[1] at ./clpmisc line 8.
$named_array = 3
$array_slice = two
$array_slice = three


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


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

Date: 10 Dec 1998 21:14:24 GMT
From: moseley@best.com (Bill Moseley)
Subject: Re: file locking question
Message-Id: <367039b0$0$213@nntp1.ba.best.com>

In article <36712862.687825@news.skynet.be>, bart.lateur@skynet.be says...
>If not ALL programs that access a particular file actually lock it, you
>might just as well forget about the whole locking thing. It won't work.
>
>Reason: you are able to read from a file while at the same time another
>program, that "locked" the file, is writing to it. Since you ignore the
>lock, you're bashing in while it is trying to have some privacy.

Oh, the point I missed is that a share lock will wait if an exclusive lock
that is in use.

The other thing I've been told is to not unlock a file opened with an
exclusive lock, rather just close the file to release the lock.  This is
to prevent someone writing to the file between the unlock and the flush 
at close.  That sound correct?


Thanks again,



--------------
Bill Moseley
moseley@best.com



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

Date: 10 Dec 1998 21:23:52 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: file locking question
Message-Id: <74pe58$fgp$2@marina.cinenet.net>

Bill Moseley (moseley@best.com) wrote:
: The other thing I've been told is to not unlock a file opened with an
: exclusive lock, rather just close the file to release the lock.  This is
: to prevent someone writing to the file between the unlock and the flush 
: at close.  That sound correct?

Correct indeed.  Actually, there's almost never any need to release either
type of lock; just let the close machinery do it for you.  It's safer for
writer apps, and less typing for the programmer. :)

-- 
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      "The hills were burning, and the wind was raging; and the
       clock struck midnight in the Garden of Allah."


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

Date: Thu, 10 Dec 1998 14:18:17 -0800
From: Guoying Liu <wqi@leland.Stanford.EDU>
Subject: help on error message
Message-Id: <Pine.HPP.3.96.981210141339.4380B-100000@amy1.Stanford.EDU>

Hi, 

Could anyone please give me some tips on why sometimes I got error message
saying "use of uninitialized value"? We don't have to define any variable
in Perl, right?

Thanks for any help.

Gufeng




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

Date: 10 Dec 1998 21:05:13 GMT
From: "Allan M. Due" <due@murray.fordham.edu>
Subject: Re: Help wanted: saving remote URL to local file
Message-Id: <74pd29$qn4$0@206.165.167.201>

Simmo wrote in message <01be2472$54648ca0$b2c548c2@is>...
>Hi....a virtual beer for anyone that can give me a simple answer to this
>one :)
>I want to retrieve the contents of a text file i have created on a remote
>server and display it on the local server within a web page (but not AS the
>web page) using Perl. Is it possible to:
>use "Location: http://blah" to print to a file rather than the screen


I can't see that working.

>or
>call the unix 'cat' command to bang it in a file....if so what is the

Can't see that either.

Ok you have a file on another server, do you mean a web server?  If so, say
you have a text file at www.domain.tdl  named file.txt.  You can fetch it
with:

#!/usr/local/bin/perl -w
use strict;
use LWP::Simple;
$info = get("Http://www.domain.tdl/file.txt");

Now you can have your Perlish way with $info, and do what you will.
if you just want to just print the file, the above but:

getprint ("Http://www.domain.tdl/file.txt");

HTH

AmD

(I prefer Pilsner Urquel under virtually any circumstance)




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

Date: Thu, 10 Dec 1998 21:36:34 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: interpolation constipation
Message-Id: <C9Xb2.928$4w2.4153174@news.itd.umich.edu>

In article <367035EA.4BFF941D@fabric8_no_spam.com>,
antony quintal  <antony@fabric8_no_spam.com> wrote:
>$sql =  qq{
>	UPDATE Sessions 
>	SET Field = '$object->field' 
>	WHERE SessionID = '$session_id'};

>as you probably know, "$object->field" gets interpolated as
>'Package=HASH(0x82c3228)->field'

>if i use "$object->{FIELD}" it interpolates correctly (i have AUTOLOAD
>accessor methods)
[snip]
>but i was wondering how to construct my sql string directly from my
>object's method...

Either use the @{[ ]} trick described in perlref...

$sql = qq{
    UPDATE Sessions
    SET Field = '@{[$object->field]}'
    WHERE SessionID = '$session_id'
};

 ...or use sprintf...

$sql = sprintf qq{
    UPDATE Sessions
    SET Field = '%s'
    WHERE SessionsID = '%s'
}, $object->field, $session_id;

 ...or one of the many other ways that are available;  I think the above two
are the best.  Normally I avoid @{[]}, but it sorta works here.

-- 
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
            | K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
            | tv+ b++ DI++ D+ G e++>++++ h- r y+>++**          | umich.edu


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

Date: 10 Dec 1998 16:36:06 -0500
From: Uri Guttman <uri@ibnets.com>
Subject: Re: interpolation constipation
Message-Id: <39n24v1xyx.fsf@ibnets.com>

>>>>> "aq" == antony quintal <antony@fabric8_no_spam.com> writes:

  aq> $sql = qq{ UPDATE Sessions SET Field = '$object->field' WHERE
  aq> SessionID = '$session_id'};

  aq> if i use "$object->{FIELD}" it interpolates correctly (i have
  aq> AUTOLOAD accessor methods) and if i do something like

  aq> my $field = $object->field;

well, at least you know 2 good solutions. the trick you want is to
dereference a ref to an expression like this:

	"Field = '${\$object->field}'"

an array version works too:

	"Field = '@{[$object->field]}'"

this is considered minor black magic and is not clear to newbies. there
is an interpolation module which may do some of this for you in a
clearer way. mark-jason dominus is the author IIR.

hth,

uri


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


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

Date: 10 Dec 1998 16:49:33 -0500
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: interpolation constipation
Message-Id: <74pfld$3tj$1@monet.op.net>

In article <367035EA.4BFF941D@fabric8_no_spam.com>,
antony quintal  <antony@fabric8_no_spam.com> wrote:
>here's a snippet from a DBI database call:
>
>$sql =  qq{
>	UPDATE Sessions 
>	SET Field = '$object->field' 
>	WHERE SessionID = '$session_id'};
>
>as you probably know, "$object->field" gets interpolated as
>'Package=HASH(0x82c3228)->field'
>
>but i was wondering how to construct my sql string directly from my
>object's method...


There are several solutions.

You can use

	SET field = '${\do{$object->field}}'

which does work, if you don't mind the punctuation.  To evaluate 
$object->field in list context and interpolate the list, use

	SET field = '@{[$object->field]}'

which you might consider better or worse, depending on taste.

You can use my `Interpolation' module:

	use Interpolation 'eval' => 'eval';

Then you can write your query as

	SET field = '$eval{$object->field}'

Anything inside of $eval{...} gets evaluated and interpolated, no
matter what it is.  If you don't like `$eval', you can do something
like this instead:

	use Interpolation '-' => 'eval';
	 

	SET field = '$-{$object->field}'

One advantage of this method is that you can define any notation you
want that makes your queries easy to understand.  For example, it would
be easy to say that the notation $:{foo} always means $object->foo()
for any `foo' at all; then you could write

	SET field = '$:{field}'

Depending on your application and your queries, this might be either
easier or harder to understand; you have to try to use it wisely.

Finally, you can invent your own syntax and implement it yourself
without much trouble.  For example:

$sql =  fillin qq{
	UPDATE Sessions 
	SET Field = %%$object->field'%%
	WHERE SessionID = %%$session_id%%};


Here code to be interpolated is delimited with %%..%% pairs.
`fillin' is a subroutine that extracts the code between these
delimites, evaluates it, and puts back the results.

	sub fillin {
	  my $s = shift;
	  $s =~ s{ %%
		   (
		    (?:[^%]|%[^%])*  # Any sequence that does not include %%
		   )
		   %%
		 }
		 {$1}eegx
	    ;
	  $s;
	}




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

Date: 10 Dec 1998 21:40:10 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: interpolation constipation
Message-Id: <74pf3q$k4$2@info.uah.edu>

In article <367035EA.4BFF941D@fabric8_no_spam.com>,
	antony quintal <antony@fabric8_no_spam.com> writes:
: but i was wondering how to construct my sql string directly from my
: object's method...

This is a FAQ.  Please consult perlfaq4, and look for "How do I expand
function calls in a string?".

Greg
-- 
It's a miracle that curiosity survives formal education.
    -- Albert Einstein


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

Date: 10 Dec 1998 22:44:17 GMT
From: dhaley@infobeat.com (Damon K. Haley)
Subject: Making O'Reilly phone script do html
Message-Id: <slrn76v9j8.593.dhaley@dhcp133.corp.merc.com>
Keywords: phone, Unix

Hello,

I've been using the phone script I got from the 
O'Reilly Unix Power tools book.  It works nicely
as a command-line address book.  I have attatched it
for those who have not seen it.

Does anyone have a script that will convert its address 
files to html or have an example of something similar preferably
using perl or sh? This is the current phone system I use, but
it there is one that works better with the web (prebuilt)
please let me know.

Thanks in advance

Damon Haley

#!/bin/sh
#
# phone, address - look a phone or address in a file.
# LINK BOTH THE phone AND address SCRIPTS TOGETHER; BOTH USE THIS FILE!

myname="`basename $0`"  # NAME OF THIS SCRIPT (USUALLY address OR phone)
case "$myname" in
phone|address)
    sysfile=~dhaley/contacts/system/phone   # SYSTEM FILE
    persfile=${HOME?}/contacts/personal/phone   # PERSONAL FILE
    ;;
*) echo "$0: HELP!  I don't know how to run myself." 1>&2; exit 1 ;;
esac

if test ! -f $persfile
then touch $persfile
fi

case $# in
0)  echo "Usage: $myname searchfor [...searchfor]
    (You didn't tell me what you want to search for.)" 1>&2
    exit 1
    ;;
*)  # BUILD egrep EXPRESSION LIKE (arg1|arg2|...) FROM NAME(S) USER TYPES:
    for arg
    do
        case "$expr" in
        "") expr="($arg" ;;
        *) expr="$expr|$arg" ;;
        esac
    done
    expr="$expr)"
esac

# SEARCH WITH egrep, USE sed TO ADD sys> TO START OF FILENAMES FROM
# SYSTEM FILE AND pers> TO START OF FILENAMES FROM HOME LIST:
egrep -i "$expr" $persfile $sysfile |
sed -e "s@^$sysfile:@sys>@" -e "s@^$persfile:@pers>@"
exit



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

Date: Thu, 10 Dec 1998 22:51:13 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Newbie Question
Message-Id: <BfYb2.68$Vw4.240@nsw.nnrp.telstra.net>

In article <366fd998.151024211@wv-proxy>,
	jcasey@workingventures.ca (John Casey) writes:

> It is my first time in this news group so bear with me. I have been a
> VB programmer for years now. My boss just came up to me and asked me
> to learn CGI by yesterday.........AGHHHHHHH!!! I do not want to do the

If your boss wants you to do CGI, you should learn about CGI. You
don't need to learn perl for that. The two are unrelated.

A good source for information about cgi: www.cgi-resources.com

If you still want to learn Perl, www.perl.com will get you started,
but if you are only going to learn Perl to program CGI, I advise you
to reconsider. Pick the language you're most comfortable in, and write
CGI applications in that. To choose perl you'd need quite a few other
considerations.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | A Freudian slip is when you say one
Commercial Dynamics Pty. Ltd.       | thing but mean your mother.
NSW, Australia                      | 


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

Date: Thu, 10 Dec 1998 14:45:29 -0600
From: "Kim Long" <kiml@worldnetla.net>
Subject: Pattern matching and name parsing
Message-Id: <36703168.0@209.4.101.246>

I'm sure this is a simple question, but I've just not been able to find it.
(I'm a relative newbie).

I want to retrieve the first letter of every item in an array (@) and set it
to a variable.

I can "match" the first character, but how do I delete the rest of the word
and save the value of the first character to a variable.

Kim




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

Date: Thu, 10 Dec 1998 13:42:40 -0800
From: Yogish Baliga <baliga@synopsys.com>
To: Kim Long <kiml@worldnetla.net>
Subject: Re: Pattern matching and name parsing
Message-Id: <36704050.1BBDF715@synopsys.com>

@array2 = map { m/^(.)/; $1; } @array;

Kim Long wrote:

> I'm sure this is a simple question, but I've just not been able to find it.
> (I'm a relative newbie).
>
> I want to retrieve the first letter of every item in an array (@) and set it
> to a variable.
>
> I can "match" the first character, but how do I delete the rest of the word
> and save the value of the first character to a variable.
>
> Kim



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

Date: 10 Dec 1998 21:37:56 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Pattern matching and name parsing
Message-Id: <74pevk$fgp$4@marina.cinenet.net>

Kim Long (kiml@worldnetla.net) wrote:
: I want to retrieve the first letter of every item in an array (@) and set it
: to a variable.
: 
: I can "match" the first character, but how do I delete the rest of the word
: and save the value of the first character to a variable.

I'm not entirely clear what you want.  Do you mean pull off all the first
letters of strings in the array, and jam them together into a single
string (like an acronym-izer)?  If so, this will work:

  $firsts = join '', map { substr $_, 0, 1 } @array;

-- 
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      "The hills were burning, and the wind was raging; and the
       clock struck midnight in the Garden of Allah."


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

Date: 10 Dec 1998 21:46:03 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Pattern matching and name parsing
Message-Id: <74pfer$k4$3@info.uah.edu>

In article <36703168.0@209.4.101.246>,
	"Kim Long" <kiml@worldnetla.net> writes:
: I want to retrieve the first letter of every item in an array (@) and set it
: to a variable.

I'm not sure what exactly you mean by `set it to a variable', but if
you want to generate an array of first characters, try something like

    my @firsts = map { unpack "a", $_ } @array;

Is there a good reason unpack() doesn't use $_ when it only has one
argument?

Greg
-- 
Fenster: Treat me like a criminal, I'll end up a criminal.
Hockney: You are a criminal.
Fenster: Why you gotta go and do that? I'm trying to make a point.


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

Date: Thu, 10 Dec 1998 21:08:14 GMT
From: wyndo@cxo.com
Subject: Perl tip needed: High CPU Usage
Message-Id: <74pd7r$1lp$1@nnrp1.dejanews.com>

I'm trying to troubleshoot a problem in a set of Perl CGI programs. Server
CPU usage (reported in "ps aux | grep perl) is uncommonly high. In fact, perl
processes are listed as using anywhere from 36 to 99.9% CPU time. With
multiple users online, this tends to bring the server to a sluggish halt for
a period of time.

Are there any well-known causes of this? I still suspect a server
configuration problem, but it isn't my server. I'm now investigating the Perl
code for possible performance bad-spots. Here are a few things currently
being done within the "problem" programs.

>> system calls, mainly to system("chmod 666 $filename");
>> $retval = do "$filename";
>> sleep(1); ... also select(undef, undef, undef, 0.10); and so forth...
>> 4 "require" statements at the top (one brings in a 54k perl file of common
routines).
>> File OPEN/PRINT/CLOSE commands, some >$filename, others append >>$filename;

I appreciate any suggestions on what might cause a program to spike up to
99.9% CPU usage. Thank you.

Mike Snyder

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


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

Date: 10 Dec 1998 21:29:47 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Perl tip needed: High CPU Usage
Message-Id: <74pegb$fgp$3@marina.cinenet.net>

wyndo@cxo.com wrote:
[snipped: 'Perl CGI apps are eating too much CPU']
: Are there any well-known causes of this? I still suspect a server
: configuration problem, but it isn't my server. I'm now investigating the Perl
: code for possible performance bad-spots. Here are a few things currently
: being done within the "problem" programs.
: 
: >> system calls, mainly to system("chmod 666 $filename");

This is a double baddy.  First, why not just juse Perl's built-in chmod()
function?  Second, this version of the system call spawns a whole separate
shell for the command, eating time and other resources.  See the doc on
system() for alternatives.

: >> $retval = do "$filename";
: >> sleep(1); ... also select(undef, undef, undef, 0.10); and so forth...
: >> 4 "require" statements at the top (one brings in a 54k perl file of common
: routines).
: >> File OPEN/PRINT/CLOSE commands, some >$filename, others append >>$filename;
: 
: I appreciate any suggestions on what might cause a program to spike up to
: 99.9% CPU usage. Thank you.

Well, perhaps it's running (under the server) at too high a priority?  If
this is the case, you should see tiny CPU-seconds consumed for each
invocation.  If it's spinning that hard on a single invocation for more
than a few seconds, odds are you have a bug in the app itself that's
eating CPU cycles to no good end -- unless you're (say) sorting a
multi-megabyte text file or something during each invocation.

-- 
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      "The hills were burning, and the wind was raging; and the
       clock struck midnight in the Garden of Allah."


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

Date: Thu, 10 Dec 1998 10:39:19 -1000
From: "Richard Megowan" <rmegowan@interlogics.net>
Subject: Scripts
Message-Id: <01be247c$79db1c60$64c801ac@rmegowan.jdpower.com>

Does anyone know of or know where I can obtain a script to create login
accounts from an HTML page?  Its for online registration for an ISP

Thanx for any help

Richard Megowan
richard.megowan@jdpower.com



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

Date: 10 Dec 1998 21:29:19 GMT
From: eln@cyberhighway.net (Erik)
Subject: Re: Scripts
Message-Id: <74peff$gpv$1@news.cyberhighway.net>

In article <01be247c$79db1c60$64c801ac@rmegowan.jdpower.com>,
	"Richard Megowan" <rmegowan@interlogics.net> writes:
> Does anyone know of or know where I can obtain a script to create login
> accounts from an HTML page?  Its for online registration for an ISP

This is not the place to look if you're interested in merely finding
a script.  You might wish to consult a standard search engine.
Or, you may offer me an exorbitant fee and an open deadline to write
one for you.  This newsgroup is intended to help people sort out
problems they are having with programs they are writing, it is not a
script repository.

My apologies for stepping on Tom Phoenix's standard-reply turf with this
message ;)

-- 
Erik Nielsen, Cyberhighway Internet Services NOC
Never meddle in the affairs of BOFHs, for we have no need of subtlety. 
             -- Bruce in a.s.r.


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

Date: Thu, 10 Dec 1998 21:48:50 GMT
From: "News" <dixonmat@pouch.com>
Subject: SSI in perl?
Message-Id: <6lXb2.2870$5v3.19945205@news.optonline.net>

I have a header sub routine that I want to add this SSI line tag.

print "<!--#exec cgi="../banad/cgi/banner.cgi"-->\n";

now I know it is not correct what should I do to make it work?
please help.




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

Date: Thu, 10 Dec 1998 22:56:11 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: SSI in perl?
Message-Id: <fkYb2.70$Vw4.240@nsw.nnrp.telstra.net>

In article <6lXb2.2870$5v3.19945205@news.optonline.net>,
	"News" <dixonmat@pouch.com> writes:
> print "<!--#exec cgi="../banad/cgi/banner.cgi"-->\n";
        ^              ^                       ^     ^

> now I know it is not correct what should I do to make it work?
> please help.

Either escape the double quotes in your double quoted string, use a
single quoted string, or use one of the qq{} or q{} operators
described in the perlop documentation:

# perldoc perldata
# perldoc perlop

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | I took an IQ test and the results were
Commercial Dynamics Pty. Ltd.       | negative.
NSW, Australia                      | 


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

Date: Thu, 10 Dec 1998 22:13:38 GMT
From: brandtr3769@my-dejanews.com
Subject: Using fonts in table built with CGI.pm
Message-Id: <74ph2f$5ei$1@nnrp1.dejanews.com>

 In the code snip below, I would like the $title varible to use a font. Is it
possible to put a font tag in the brackets?

print
table({-align=>'CENTER',-bgcolor=>'LIGHTBLUE'},
             Tr({-align=>CENTER,-valign=>TOP},
             [
                th({-BGCOLOR=>DARKBLUE},[$title])
             ]
           )
     );

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


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

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

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