[8697] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2314 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 14 03:07:20 1998

Date: Tue, 14 Apr 98 00:01:01 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 14 Apr 1998     Volume: 8 Number: 2314

Today's topics:
    Re: [Q] find largest value in key of associative array? (John T. Stapleton)
    Re: [Q] find largest value in key of associative array? (Abigail)
    Re: ANSI Colour in Perl <zenin@archive.rhps.org>
    Re: Apache/ModPerl Question (Tom Mornini)
    Re: Bill Gates should be invited to O'Reilly's "Free So (Andreas Borchert)
    Re: Can I install perl5.004_04 myself? (Martien Verbruggen)
    Re: Converting  Perl <dfetter@shell4.ba.best.com>
        Easy way to count lines in a file <hareed@bellsouth.net>
    Re: Easy way to count lines in a file <rootbeer@teleport.com>
    Re: Easy way to count lines in a file (Andrew M. Langmead)
    Re: File download problem in IE4.0 (Andrew M. Langmead)
    Re: Finding string and removing remainder file <rootbeer@teleport.com>
    Re: Finding string and removing remainder file (Abigail)
    Re: Finding string and removing remainder file <grinch@whoville.com>
    Re: formatting localtime output (Martin Vorlaender)
    Re: Hide or Encrypt perl source code <dgoddard@us.oracle.com>
    Re: How do I format Local Date? (Philip Gwyn)
    Re: i want to learn Perl. HELP! (Rich Morin)
    Re: Ideas for installations <grinch@whoville.com>
    Re: looking for a good win32 perl editor. (Philip Gwyn)
    Re: Need a Free Perl Data Base to the Web <grinch@whoville.com>
    Re: Need to find web-based e-mail client in Perl! <gwynne@utkux.utk.edu>
    Re: Perl 5.004_64 Slower??? <rootbeer@teleport.com>
    Re: Perl, HP-UX, and memory ... <rootbeer@teleport.com>
    Re: print (Martin Vorlaender)
    Re: Project involving Word (Frank)
    Re: Remove newline <justin@nectar.com.au>
    Re: running perl at command line with arguments: script <rootbeer@teleport.com>
    Re: running perl at command line with arguments: script (Abigail)
    Re: split problem (Andrew M. Langmead)
    Re: Tip: How to selectively quiet warnings <dgoddard@us.oracle.com>
    Re: trying to use grep to give an exact match <lr@hpl.hp.com>
    Re: trying to use grep to give an exact match (Andrew M. Langmead)
    Re: trying to use grep to give an exact match (Philip Gwyn)
    Re: trying to use grep to give an exact match <rootbeer@teleport.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 14 Apr 1998 00:11:15 -0400
From: stapes@ryn.mro.dec.com (John T. Stapleton)
Subject: Re: [Q] find largest value in key of associative array?
Message-Id: <6gunl3$see$1@ryn.mro.dec.com>

In article <Pine.GSO.3.95.980413185643.3796A-100000@cp.pathfinder.com>,
Andrew F. Lee <andrewf@cp.pathfinder.com> wrote:
>On Mon, 13 Apr 1998, Stephen_Chan wrote:
>
>$max = 0;
>for $key (%aa) {
>	if($key > $max) {
>		$max = $key;
>	}
>}
>	
>> What's the fastest way to find the largest key value
>> in an associative array? eg:
>> [deleted]

I know that in the example that Stephen gave all the keys were positive,
but if they were all negative, your solution would not work.

undef $max;		# in case defined from a previous iteration
for $key (%aa) {
    if (! defined $max) {
	$max = $key;
	next;
    }
    if ($key > $max) {
	$max = $key;
    }
}

Of course, that's assuming all the keys are numbers.

Stapes


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

Date: 14 Apr 1998 04:36:16 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: [Q] find largest value in key of associative array?
Message-Id: <6gup40$573$1@client2.news.psi.net>

Dan Boorstein (danboo@negia.net) wrote on MDCLXXXVII September MCMXCIII
in <URL: news:3532B8C0.44FA9A81@negia.net>:
++ Abigail wrote:
++ > 
++ > 
++ > What's the point of suggesting an Omega (N log N) algorithm
++ > if there's a trivial O (N)?
++ > 
++ > foreach ($max = each %hash;
++ >          defined ($a = each %hash);
++ >          $max = $a if $a > $max) {}
++ 
++ if your concerns are speed and trivial code, then what's wrong with:
++ 
++ for (keys %hash) {
++   $max = $_ if $_ > $max;
++ }
++ 
++ it's fewer characters (i.e., faster to type), avoids a moderately
++ obfuscated foreach with a void block (i.e., more trivial code), and
++ by my benchmarks as fast as, if not faster.

But it is wrong. While undef is an appropriate value as the maximum
of an empty set, 0 is *not*. And undef in a comparison is 0.

Your loop will fail to give a maximum if all numbers are non positive.

Furthermore, keys in a list context will generate a list of all the
keys; while my solution doesn't have to create a possible large
temporary list.


Abigail
-- 
perl -e '$a = q 94a75737420616e6f74686572205065726c204861636b65720a9;
         ${qq$\x5F$} = q 97265646f9; s g..gqq e\x63\x68\x72\x20\x30\x78$&eggee;
         {eval if $a =~ s e..eqq qprint chr 0x$& and \x71\x20\x71\x71qeexcess}'


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

Date: 14 Apr 1998 06:47:25 GMT
From: Zenin <zenin@archive.rhps.org>
Subject: Re: ANSI Colour in Perl
Message-Id: <892536869.775212@thrush.omix.com>

[posted & mailed]

Karl Hanmore <avatar@ultra.net.au> wrote:
: 	I was wondering if anyone knows of any code / modules for printing
:  ANSI colour in Perl.  I have had a snoop through CPAN to no avail, and I
:  really want to avoid re-inventing the wheel.   Anyone got any ideas?

	Hmm, are you _sure_ you searched CPAN?  Using the WAIT, a search for
	'ansi' in the name or text fields brings up Term::ANSIColor as the
	first item.  Is this not what you're looking for?

-- 
-Zenin
 zenin@archive.rhps.org


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

Date: Tue, 14 Apr 1998 05:56:22 GMT
From: tmornini@netcom.com (Tom Mornini)
Subject: Re: Apache/ModPerl Question
Message-Id: <tmorniniErE35y.E5w@netcom.com>

Michael J Schout (mschout@gkg.net) wrote:

: > are otherwise ignored).  Is there any way to cause the server to NOT send
: > a header to the browser for you so that the browser will be expecting one
: > (as is the case in normal CGI?)  I have tried both using and not using
: > CGI.pm.
: > 
: > Thanks in advance for any help!!!!!!!!!!!
: > 
: > Jim Turner
: > jim.turner@lmco.com

: Remove "PerlSendHeader On" from your httpd.conf file, and just use print
: $q->header() as normal from CGI.pm.  

I've had the same problem with Perl 5.004_04 and mod_perl 1.10. It sends
headers regardless of the PerlSendHeader config.

-- Tom Mornini
-- InfoMania


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

Date: 14 Apr 98 06:36:26 GMT
From: borchert@turing.mathematik.uni-ulm.de (Andreas Borchert)
Subject: Re: Bill Gates should be invited to O'Reilly's "Free Software Summit" (was Re: RMS should be invited to O'Reilly's "Free Software Summit")
Message-Id: <353303ea.0@news.uni-ulm.de>

On Mon, 13 Apr 1998 12:57:30 GMT, Chris Nandor <pudge@pobox.com> wrote:
> In article <3531c2cc.0@news.uni-ulm.de>, borchert@mathematik.uni-ulm.de wrote:
> 
> # On 11 Apr 1998 03:16:12 -0700, Russ Allbery <rra@stanford.edu> wrote:
> # > In comp.lang.perl.misc, Ben Bullock <ben@hayamasa.demon.co.uk> writes:
> # > > I should say that the perl FAQ does not meet several free software
> # > > criteria.
> # > 
> # > Starting with the really major problem that it's not software....
> # 
> # Documentation is an essential part of software.
> 
> So is distribution, so is a name, so is an idea, so are lots of things
> that are not (necessarily :) themselves software.

Software = program code + associated reference documentation.

Sometimes the associated reference documentation is in separate files,
sometimes it is even mixed with the program code (see embedded POD for
Perl, for example). Independent from this, it is an integral part of
software.

Andreas.

-- 
Andreas Borchert, Universitaet Ulm, SAI, Helmholtzstr. 18, 89069 Ulm,  Germany
E-Mail: borchert@mathematik.uni-ulm.de
WWW:	http://www.mathematik.uni-ulm.de/sai/borchert/
PGP key available via ``finger borchert@laborix.mathematik.uni-ulm.de''


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

Date: 14 Apr 1998 06:13:30 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Can I install perl5.004_04 myself?
Message-Id: <6guuqa$e3l$1@comdyn.comdyn.com.au>

In article <32FE55CB.706F@callisto.si.usherb.ca>,
	John Taylor-Johnston <eslcafe@callisto.si.usherb.ca> writes:
> Can I install perl myself, with the modules, under my public_html
> directory (UNIX SERVER), and then call my version of perl with my
> scripts using this syntax:

You don't really need your own perl, just your own module directory.
Check the perl faq, part 8, look for the questions:

How do I install a CPAN module?
How do I keep my own module/library directory?

And browse through some of the other questions.

# perldoc perlfaq
# perldoc perlfaq8
# perldoc perl

> Please respond by email.

post here, read here.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Inside every anarchy lurks an old boy
Commercial Dynamics Pty. Ltd.       | network - Mitchell Kapor
NSW, Australia                      | 


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

Date: 14 Apr 1998 04:38:57 GMT
From: David Fetter <dfetter@shell4.ba.best.com>
Subject: Re: Converting  Perl
Message-Id: <6gup91$ktk$1@nntp1.ba.best.com>

James Kenny <kennyj@postoffice.co.uk> wrote:
> I have a numberof Perl Scripts running on a UNIX box.  
> I need to convert the Perl so it will run on NT Server.  
> Are there any insumountable problems I am likely to come up against.
> I know a lot will depend on the application but is there any show stoppers
> when converting from UNIX to NT.

There's a showstopper called Windows NT.  If this piece of junk gets
on your system, it will run like a snail on methaaqualone, crash
without explanation, protect your data as if it were there for all the
world to modify, and do very little else.

Should someone install it on your system, delete it immediately.

> I also no nothing about Perl yet but I have a feeling that will change!

Yes, you'll go from a system that works to an expensive doorstop.

-- 
            David Fetter         888 O'Farrell Street Apt E1205
   shackle@ren.glaci.com          San Francisco, CA 94109-7089 USA
  http://www.best.com/~dfetter     +1 415 567 2690 (voice)
print unpack ("u*",q+92G5S="!!;F]T:&5R(%!E<FP@2&%C:V5R"@``+)

Ever wonder why the SAME PEOPLE make up ALL the conspiracy theories?


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

Date: Tue, 14 Apr 1998 04:11:26 GMT
From: "Harold Reed" <hareed@bellsouth.net>
Subject: Easy way to count lines in a file
Message-Id: <OlBY.155$GO6.554867@news3.atl.bellsouth.net>

Is there an easy way to count the number of lines a file has? I am working
with several access log files that are routinely larger than 300MB and I
have developed a crude update that lets the user know every 1000 lines that
are processed by the script - so you can get an idea of where the script is
in it duties (a stdout update, if you will). Is there a way that you can get
a readout of the number of lines in a file quickly? Currently I am using the
incredibly CPU-expensive

while (<ACCESS>) {
    counter++;
}
print "You have $counter lines in this file\n";

This is chewing mountains of time on a huge file as previously decribed. I
have scoured for a way to count the number of lines - quickly (a la grep
perhaps?) - but can't seem to find any sort of clue. Any prompts from the
wizened?

Harold Reed


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

Date: Tue, 14 Apr 1998 04:48:53 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Harold Reed <hareed@bellsouth.net>
Subject: Re: Easy way to count lines in a file
Message-Id: <Pine.GSO.3.96.980413213702.13639a-100000@user2.teleport.com>

On Tue, 14 Apr 1998, Harold Reed wrote:

> Is there an easy way to count the number of lines a file has?

Yes, here's one. If the last line of your file won't end with a newline,
you'll get an answer off by one. Also, checking the return value from read
is left as an exercise. :-)

    open FILE, $file or die "Can't open '$file': $!";
    my $count = 0;
    while (read FILE, $_, 8192) {
	$count += tr/\n//;
    }
    close FILE;
    print "The file '$file' has $count lines.\n";

On my system, this runs at a speed comparable to 'wc -l'. Hope this helps! 

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 14 Apr 1998 05:09:08 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Easy way to count lines in a file
Message-Id: <ErE0z9.FEz@world.std.com>

"Harold Reed" <hareed@bellsouth.net> writes:

>Is there an easy way to count the number of lines a file has? 

ON Unix and similar operating systems, a file is just arbitrary stream
of bytes, and there is no way to count number of newlines (or any
other character) in a file without reading every single character.

>I am working
>with several access log files that are routinely larger than 300MB and I
>have developed a crude update that lets the user know every 1000 lines that
>are processed by the script

But you don't have to start at the beginning each time, do you? Once
you start the script, and reach the end, you just have to try again
and see if the writing program has written any more (hopefully with a
sleep() in there somewhere.) Some of the info from the FAQ entry "How
do I do a `tail -f' in perl?" may be useful. (Since you are reading an
ever growing file, end of file doesn't mean there is no more data, it
just means there is no more data yet.)

And if there is an easy way of telling if the logs have been started
over. (Very likely, since the entries are probably time stamped) you
don't even need to have very invocation of the script read from the
beginning. Keep a second file that contains some telltale signs to
ensure that the file is the same (the date stamp from the first line,
for example) the byte offset and the line count of the log file. Then
the monitor script only needs to read the first of the script to
ensure that it is the same, then seek to the offset and set the
linecount to the stored linecount. When the monitor script ends, it
writes its status information back to the file.

-- 
Andrew Langmead


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

Date: Tue, 14 Apr 1998 04:04:28 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: File download problem in IE4.0
Message-Id: <ErDxzG.7v8@world.std.com>

bidyut@yahoo.com writes:

>thanks for fighting on the post. i am sorry if posted it in the wrong news
>group. Thanks to Kenner for supporting me. Anyway, as Kenner pointed out..
>that i am confused, whether the problem lies in Perl site or IE site, i
>thought best to put it in Perl, beacuse, i Know a lot of people work on these
>issue and there must be some answer for this.

As a rule of thumb, when you have a problem like this, ask yourself
"If someone wrote a script in another language (C, Lisp, Bourne shell,
Fortran, Newtonscript, BASIC, etc.) that performed the exact same
steps as mine, would they see the same problem."

If they answer is yes, the problem does not lie in the programming
language that you are using.

-- 
Andrew Langmead


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

Date: Tue, 14 Apr 1998 04:10:08 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Stathy Touloumis <stathy@jaske.com>
Subject: Re: Finding string and removing remainder file
Message-Id: <Pine.GSO.3.96.980413210951.13639V-100000@user2.teleport.com>

On Mon, 13 Apr 1998, Stathy Touloumis wrote:

> it works when not being processed from the web but when I try and
> process it from a web based form I get a server configuration error.

When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.

   http://www.perl.com/CPAN/
   http://www.perl.org/CPAN/
   http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
   http://www.perl.org/CPAN/doc/manual/html/pod/

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 14 Apr 1998 04:39:30 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Finding string and removing remainder file
Message-Id: <6gupa2$573$2@client2.news.psi.net>

Stathy Touloumis (stathy@jaske.com) wrote on MDCLXXXVII September
MCMXCIII in <URL: news:3532D77E.4FDFED1C@jaske.com>:
++ Hi,
++     I am new to perl and getting my butt kicked!  What I am doing is
++ writing a script that can take a domain name from a form on the web and
++ process it.  I am trying to pull the initial paragraph returned by whois
++ and send that back to the web.  I tried using
++ $dom =~ s/\n.+\n//s;
++ 
++ where $dom is the input from whois
++ it works when not being processed from the web but when I try and
++ process it from a web based form I get a server configuration error.


And that's the only line in your code?



Abigail
-- 
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET", "http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content)) =~ /(.*\))[-\s]+Additional/s) [0]'


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

Date: Tue, 14 Apr 1998 01:42:10 -0400
From: "Grinch" <grinch@whoville.com>
Subject: Re: Finding string and removing remainder file
Message-Id: <6gus60$4bl@fridge.shore.net>

Stathy Touloumis wrote in message <3532D77E.4FDFED1C@jaske.com>...

>    I am new to perl and getting my butt kicked!

Be careful, camels don't just kick, they bite too.

>it works when not being processed from the web but when I try and
>process it from a web based form I get a server configuration error.
>Any suggestions?


First, I strongly suggest reading the previously-mentioned FAQ's. It sounds
as if your script isn't producing the correct MIME-type header before
sending output to the browser. No offense intended, but that's a rather
basic part of CGI scripting, and those tutorials are a great resource to get
you started.

ObPerl: I've found the CGI::Carp module to be of _enormous_ help in
convincing recalcitrant CGI scripts to behave.

HTH!

-grinch

----
"Of course coffee doesn't make the world go around. It
just makes it go faster." - me

Sherm Pendley
grinch@whoville.com
http://www.whoville.com





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

Date: Tue, 14 Apr 1998 05:31:36 +0200
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: formatting localtime output
Message-Id: <3532d898.524144494f47414741@radiogaga.harz.de>

Lee Falkenhagen (falkenl@hotmail.com) wrote:
: YYYYMMDD HHminmin

: if you just return localtime, it truncates the leading zero for the month
: and date.

: Is there anyway to put it in there besides doing a "if less than 10, add
: '0' to string" routine?

Look into the (s)printf function.

cu,
  Martin
--
                          | Martin Vorlaender | VMS & WNT programmer
 Ceterum censeo           | work: mv@pdv-systeme.de
 Redmondem delendam esse. |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


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

Date: Mon, 13 Apr 1998 23:30:33 -0700
From: Denis Goddard <dgoddard@us.oracle.com>
To: Ye Ye <yey@cvilaser.com>
Subject: Re: Hide or Encrypt perl source code
Message-Id: <35330289.7D7D5F8E@us.oracle.com>

[courtesey reply sent to poster]

Ye Ye wrote:
> 
> I am trying to write a system utility using Perl,
> is there a way that I can hide or encrypt my source
> code, but still able to run it?
> 

use Tom.pm qw (autoFAQingreply);
print q{
        You mean, other than the ways listed in perlfaq3, under
        "How can I hide the source for my Perl program?"
};
__END__

Seriously, though, check the following URL:
http://www.perl.com/CPAN-local/doc/FAQs/FAQ/PerlFAQ.html#How_can_I_hide_the_source_for_my

 ... and check the FAQ before posting in the future.

-Denis
-- 
     __  __  _  __     __
~~~~(__)|-< /-\(__ |__(-_
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Denis Goddard, Senior Member, Tech. Staff  |"I see the heads of men
arise
email: dgoddard@us.oracle.com              |with hungry minds and open
eyes!"
ourworld.compuserve.com/homepages/d_goddard| -Rush, from 2112: _The
Oracle_


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

Date: Tue, 14 Apr 1998 04:54:52 GMT
From: fil_nospam@login.net (Philip Gwyn)
Subject: Re: How do I format Local Date?
Message-Id: <3532ebc7.36294405@news.videotron.ca>

On Mon, 13 Apr 1998 17:09:18 -0400, kevin graham
<kgraham@s9000.furman.edu> wrote:

>Chocolate wrote:
>> How do I format the $ENV{'LOCAL_DATE'} so that it will be:
>> $day $date $month $year
>> or can I format the /usr/bin/date?
>Use neither. (localtime) will return a list of this data. Take a look at
>perlfunc for the order. All the ata you're looking for is there.
Or look into the Date::Manip package.

-Philip


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

Date: Mon, 13 Apr 1998 23:37:13 -0700
From: rdm@cfcl.com (Rich Morin)
Subject: Re: i want to learn Perl. HELP!
Message-Id: <rdm-1304982337140001@140.174.42.30>

In article <6gubbi$j74@fridge.shore.net>, "Grinch" <grinch@whoville.com> wrote:

> As for books, buy "Learning Perl", and "Programming Perl", both from
> O'Reilly & Associates. No matter how many other Perl books you buy along
> with them, BUY THESE FIRST. You'll hear them called the "LLama book" and the
> "Camel book" because of the animals on the covers.

Although I have great respect for both the Camel and Llama books, and we
point folks to them several times in our own book ("MacPerl: Power and Ease"),
I must respectfully disagree with you in this case.

Neither the Camel nor even the Llama makes any real concessions to the needs
of beginning programmers.  In fact, both books appear to assume that the
reader already knows at least one programming language.  Many references and
comparisons are made to C, a few less to awk, sed, and sh.  Here is a quote
from the beginning of the Llama book (2nd Ed., p. 35):

  "Perl's operators and expressions are generally a superset of those
  provided in most other ALGOL/Pascal-like programming languages, such
  as C or Java."

Part of our goal, in writing "MacPerl: Power and Ease", was to allow Mac
users, many of whom are not even familiar with command-line interfaces, to
successfully approach and learn programming, using (Mac-)Perl as a platform.

Please don't get me wrong: I have the O'Reilly books sitting right next to
my desk; don't try to borrow them!  But I wouldn't hand either the Camel
or the Llama to a programming neophyte, given a better alternative.

-r

-- 
Canta Forda Computer Laboratory       | Prime Time Freeware - quality 
UNIX consulting, training, & writing  | freeware at affordable prices
+1 415-873-7841                       | +1 408-433-9662   -0727 (Fax)
Rich Morin, rdm@cfcl.com              | www.ptf.com, info@ptf.com


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

Date: Tue, 14 Apr 1998 01:56:37 -0400
From: "Grinch" <grinch@whoville.com>
Subject: Re: Ideas for installations
Message-Id: <6gut12$4lg@fridge.shore.net>

Abigail wrote in message <6gug2p$5mh$1@client3.news.psi.net>...

>Mark Bunkowske (mbunks@coincnx.com) wrote on MDCLXXXVI September MCMXCIII
>in <URL: news:35327256.74B7514A@coincnx.com>:


>++ Im not really looking for code, I just need a plan of action where I can
>++ start and feedback to make sure Im going in the right direction..
>
>
>You mention CGI 4 times, but you don't mention perl once.  There is
>*NOTHING* in the post that even vaguely smells like a perl subject.
>
>Why are you posting this here?


Mark your calendars... I agree with Abigail on this one. Although, I still
don't like the currently popular trend of telling people to look somewhere
else for answers, without giving them any guidance concerning where to look.
It kind of seems like a waste of one's time to spend it posting such a
non-response. Well, anyway, it's your time not mine, so whatever...

If you're not looking for code, you won't get much help from a
language-specific newsgroup. You may have better luck in the
"comp.infosystems.www.authoring.cgi" group. If you're willing to live with a
Windows-only solution, you may want to look into the documentation on
Microsoft's web site concerning Active Channels.

HTH!

-grinch

----
"Of course coffee doesn't make the world go around. It
just makes it go faster." - me

Sherm Pendley
grinch@whoville.com
http://www.whoville.com





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

Date: Tue, 14 Apr 1998 04:48:21 GMT
From: fil_nospam@login.net (Philip Gwyn)
Subject: Re: looking for a good win32 perl editor.
Message-Id: <3532e9f6.35829295@news.videotron.ca>

On Mon, 13 Apr 1998 12:51:47 -0400, James <jamesht@idt.net> wrote:
>Hello all,
>
>I'm ready to pull my hair out.
>
>Any suggestions?

I couldn't live without quickedit (now called TSE pro)
(http://www.semware.com).  Win32 console app, syntax high-lighting,
c-like macro language, totaly reconfigurable keys, yadda yadda yadda,

-Philip


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

Date: Tue, 14 Apr 1998 02:04:08 -0400
From: "Grinch" <grinch@whoville.com>
Subject: Re: Need a Free Perl Data Base to the Web
Message-Id: <6gutf4$4nd@fridge.shore.net>

smile_ wrote in message <3531F265.4950AEDD@cindy.fe.up.pt>...

>Need a Free Perl Data Base to the Web, if you can help me send me one.


If you're working for an educational or non-profit organization, mSQL is
free. You can find it at <URL: http://www.hughes.com.au >. Whatever database
you choose, mSQL or otherwise, once you've got the database itself installed
and working, check out the DBI module and the appropriate DBD module from
CPAN. <URL: http://www.perl.com >

Did you _really_ want someone to email you all of the above??? :-)

HTH!

-grinch

----
"Of course coffee doesn't make the world go around. It
just makes it go faster." - me

Sherm Pendley
grinch@whoville.com
http://www.whoville.com





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

Date: Mon, 13 Apr 1998 23:51:35 -0400
From: "Bob Gwynne" <gwynne@utkux.utk.edu>
Subject: Re: Need to find web-based e-mail client in Perl!
Message-Id: <6gumiq$9nm$1@gaia.ns.utk.edu>

Elmira:

    There is an example of of Perl mail program on pp. 155 ff of Perl
Modules by Eric Foster-Johnson. This is a newly published book with a CD
with all the modules, etc., that you need. You could probably personalize
the script for each student by giving each script a different name, e.g.,
johnsmail.pl, sarasmail.pl, etc., and loading up your HD with as many
scripts as there are students.  The book is $40.

    In lieu of that, perhaps Abigail would be kind enough to dash off what
you want. It would be her good deed for the day.

Bob Gwynne

Elmira Alimova wrote in message <353227C4.9329DD6B@columbia.edu>...
>Hello! My school is installing web kiosks for the students. Idea is to
>enable them to get mail also. If anyone knows of perl script that will
>work as a web-based e-mail client,let me know. Help is greatly
>appreciated.
>E.




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

Date: Tue, 14 Apr 1998 03:56:37 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: sneaker@mediaone.net
Subject: Re: Perl 5.004_64 Slower???
Message-Id: <Pine.GSO.3.96.980413205502.13639S-100000@user2.teleport.com>

On Mon, 13 Apr 1998, Bill 'Sneex' Jones wrote:

> Is perl 5.004_64 slower???

That's an experimental version. If you have problems with it, you
shouldn't be running it. :-)

But if you compile it with threading support, yes, it is slower. Threading
support has a large performance hit, even if you're not using threading.
Use fork instead, and you can compile without threading support. Hope this
helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 14 Apr 1998 04:06:47 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: wvw@fred.net
Subject: Re: Perl, HP-UX, and memory ...
Message-Id: <Pine.GSO.3.96.980413210301.13639T-100000@user2.teleport.com>

On 14 Apr 1998 wvw@fred.net wrote:

> I'm running perl 5.04-1 on an HP-UX platform, with a script that reads
> in a 1.3 meg file.  The script does massive string substitutions and the
> virtual memory usage peaks at about 60 meg VM.  I have been very careful
> to "my" all variables and "undef" the rest.  The problem is that near
> the end of the script it is necessary to do a : 
> 
> system("tar -cf  ...")
> 
> Even though Perl has lots of memory to work with, the OS evidently can't
> get enough to create a subshell and the "system" fails. 
> 
> Does anyone know how to REALLY get Perl to release memory to the
> kernel??? 

Fix the kernel to make it possible for Perl to give memory back. :-)  It
does give memory back on systems which allow this, such as Linux. Failing
that, you may wish to use exec instead of system, or to re-exec your
script itself, or to buy more memory, or to enlarge your system's virtual
memory, or to install Linux... :-)  TMTOWTDI! 

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 14 Apr 1998 05:50:34 +0200
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: print
Message-Id: <3532dd0a.524144494f47414741@radiogaga.harz.de>

Kelby Valenti wrote:
> I have a variable $One = "abc" , for example.
> I want to:
> print "$Oned";
> This thinks that my var name is $Oned, I just want it to print the var and
> then the letter.

print "${One}d";

cu,
  Martin
--
                          | Martin Vorlaender | VMS & WNT programmer
 Ceterum censeo           | work: mv@pdv-systeme.de
 Redmondem delendam esse. |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


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

Date: 14 Apr 1998 08:42:31 +0200
From: dont_use_this_ey@hotmail.com (Frank)
Subject: Re: Project involving Word
Message-Id: <yo9iuocj44o.fsf@nym.sc.philips.com>

Mcoe NT <root@mail.mcoe.k12.ca.us> writes:

> 
> Hello group,
> 
> I have a project where i need to parse a scanned doc and insert the
> whatever ( I say "whatever" because I am not sure what they are) to turn
> this doc into a word template file as a word form. This way my client
> can scan docs in, turn them into word forms, fill them in and print them
> or whatever.  Does any one know of any modules that will allow me to
> control word in this way.
> 
> Thanks. joseph.
> 
Hello Joseph!

OLE::Storage is a module, which might be of interest. As far as I
understand it allows _read_ access to Word docs. You meant this text
system right?

I would advise to stay away as far as possible from any
semi-documented format. Use some known thing (richtext ?) and import
it into your application.

regards
	Frank






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

Date: Tue, 14 Apr 1998 15:49:47 +1000
From: Justin Wills <justin@nectar.com.au>
Subject: Re: Remove newline
Message-Id: <3532F8FB.EA751B6@nectar.com.au>

Robert C. Rogers wrote:

> Can someone help?
>
> I am trying to replace "|\n" with just "|", effectively removing
> the newline for those lines that end with a "|".  The code that
> I am attempting to use is as follows:
>
> #!/usr/bin/perl
> while (<STDIN>){
>    $tmp = <STDIN>;
>    $tmp =~ s/\|\n/\|/g;
>    print $tmp;
> }
>
> 'taint working.  What gives?  Thanks in advance.
>
> agator ===Z==z*<


try:

@file=<STDIN>
chomp @file;






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

Date: Tue, 14 Apr 1998 04:09:25 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Adam Klein <a_klein@ix.netcom.com>
Subject: Re: running perl at command line with arguments: script.cgi?text=text
Message-Id: <Pine.GSO.3.96.980413210805.13639U-100000@user2.teleport.com>

On Mon, 13 Apr 1998, Adam Klein wrote:

> I am trying to debug a script at the command line, and I was wondering
> if there was a way to have the argument entered at the command line as
> it does work when running the actual cgi application from the web page. 

Yes, you can emulate the Common Gateway Interface (CGI). Or, if you're
using CGI.pm or a similar module, that ability is built-in to the module.

If you decide to emulate the Common Gateway Interface and have troubles,
people in a newsgroup about CGI may be able to help you. Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 14 Apr 1998 04:43:39 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: running perl at command line with arguments: script.cgi?text=text
Message-Id: <6guphr$573$3@client2.news.psi.net>

Adam Klein (a_klein@ix.netcom.com) wrote on MDCLXXXVII September MCMXCIII
in <URL: news:6guiuq$kq9@dfw-ixnews5.ix.netcom.com>:
++ I am trying to debug a script at the command line, and I was wondering if
++ there was a way to have the argument entered at the command line as it does
++ work when running the actual cgi application from the web page.
++ 
++ For example the script looks like this:
++ 
++ www.../cgi-bin/script.cgi?testtext
++ 
++ how does it work at the command line:
++ 
++ perl script.cgi ????? <--- what do I put here?


Whatever you like - it all depends on how you deal with commandline
arguments. The CGI specification tells you how "testtext" is passed
to your program - and that's not but putting in on the command line.

If you want to test it out by putting things on the command line,
you have to write code to deal with that situation. And if you write
the code, you will know what to put where.



Abigail
-- 
perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-


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

Date: Tue, 14 Apr 1998 04:35:23 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: split problem
Message-Id: <ErDzF5.1sK@world.std.com>

scott <scott@rappahannock-web.com> writes:

>         ($one, $two, $three, $four, $five) = split (/\|/,$dbrows) || &Error;

A lot of people have pointed out the precedence error already, but
even if you fix that, is this code doing what you think it is?

You might want to feed it some intentionally misformed data files to
check.

The function split() does not return an empty list if it can't find
five fields. (Actually, except for some funky optimization features,
the split function doesn't even know how many delimiters it is
supposed to split on) Even if it can't find any delmiiters, it will
return the entire contents of its argument as one list element.

If any of the scalars in the list contain data, the assignment will
evaluate to a boolean true valuech means that Error() will not be
called.

Maybe you would be better off saying something like:

     ($one, $two, $three, $four, $five) = split /\|/,$dbrows;
     Error() unless defined $five;

By the way, does anyone thing that this is a bug?

print "empty list\n" unless @array = split /:/, '';
print "non-empty list\n" unless @array = split /:/, ' ';

I'd think that the should return a list with one zero length scalar,
not an empty list.
-- 
Andrew Langmead


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

Date: Mon, 13 Apr 1998 23:14:08 -0700
From: Denis Goddard <dgoddard@us.oracle.com>
Subject: Re: Tip: How to selectively quiet warnings
Message-Id: <3532FEB0.83DBDBCC@us.oracle.com>

Kevin Reid wrote:
> 
> If you want to quiet compile-time warnings, then:
> 
> BEGIN {$^W = 0}
> ...warning-producing code...
> BEGIN {$^W = 1}
> 

Hmmmm.... I am currently having a problem that this does not seem to
fix.
I'm sure I'm doing something lunkheaded, I know this must be a common
thing (though I see nothing obvious in the FAQ).

I'm doing a pattern-match and possible variable assignment like this:

#!/bin/perl5.004_004 -w
use strict; use diagnostics; use English;
# ... irrelevant code deleted ...
foreach ( @ary ) {
   /Created user "[^"]*" with password "[^"]*"/ && {
      $username = $1; $passwd = $2;
   }
}

Now, the wacky thing is, Perl is assuming that the square brackets are
exotic array ref constructors, not the pedestrian, regexp character
class
metacharacters that I am using them for:

"Useless use of scalar ref constructor in void context at my_prog line
5"

Okay, I can handle that, but here's the REAL issue:

#...
BEGIN{$WARNING=0}
foreach ( @ary ) {
   /Created user "[^"]*" with password "[^"]*"/ && {
      $username = $1; $passwd = $2;
   }
}

 ... Gives the *same* warning! Hey, what's with that?
 ... though it's definitely a compiler-time problem, I even tried:

#...
BEGIN{$WARNING=0}
local $WARNING = 0;
#...

which of course did no end of nothing to change the situation.

Okay, so what I'm asking is:
1. Am I doing the pattern-match-and-assignment is a screwy way, and
please
   show me the less screwy or more conventional way of doing it.
2. Is this a bug or a feature.
   That's not meant to be sarcastic, I state up front that I'm slow on
   the uptake sometimes and may have overlooked something. (Doh!)

Thanks,
-Denis


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

Date: Mon, 13 Apr 1998 21:09:45 -0700
From: Larry Rosler <lr@hpl.hp.com>
To: Michael Shavel <mshavel@erols.com>
Subject: Re: trying to use grep to give an exact match
Message-Id: <3532E189.E32A624A@hpl.hp.com>

Michael Shavel wrote:
> 
> Hi
> 
>  I'm trying to use grep to give me an exact match on a string.. not to match
> if the string is contained in another string. Example.. I would like this
> to give me back "cat" but it gives me back both "cat" and "tomcat"
> 
> Is there an option to grep I can use for an exact match?
> 
> Is there a perl pod someone could point me to for this answer please?
> 
> $c = "cat";
> 
> @string=("cat", "dog", "alligator", "tomcat");
> 
> @cats = grep(/$c/o, @string);
> 
> print "@cats\n";
> 
> 
> Thanks very much
> 
> Mike Shavel
> mshavel@erols.com

@cats = grep(/^$c$/o, @string);

would work, but the following is more obvious and more efficient
(and protects against special characters in $c):

@cats = grep($_ eq $c, @string);

The use of grep is inefficient if you know the number of matches will be
zero or one, because it searches the entire array in every case.  If you
want to know only if there is any match, try:

my $found = 0;
foreach (@string) { $found = 1, last if $_ eq $c }

For documentation, try perlsyn and perlop, but "Learning Perl" is
probably more accessible to start out.

Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com


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

Date: Tue, 14 Apr 1998 04:45:16 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: trying to use grep to give an exact match
Message-Id: <ErDzvH.6HL@world.std.com>

Ronald J Kimball <rjk@coos.dartmouth.edu> writes:

>grep(/^$c$/o, @string)

Shouldn't this be:

grep(/^\Q$c\E$/o, @string);
-- 
Andrew Langmead


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

Date: Tue, 14 Apr 1998 05:00:54 GMT
From: fil_nospam@login.net (Philip Gwyn)
Subject: Re: trying to use grep to give an exact match
Message-Id: <3532ed19.36632357@news.videotron.ca>

On Mon, 13 Apr 1998 22:10:35 -0400, mshavel@erols.com (Michael Shavel)
wrote:

>Hi
>
> I'm trying to use grep to give me an exact match on a string.. not to match
>if the string is contained in another string. Example.. I would like this 
>to give me back "cat" but it gives me back both "cat" and "tomcat"
>
>Is there an option to grep I can use for an exact match?
grep {$_ eq "string"} @array;

>Is there a perl pod someone could point me to for this answer please?
perlfunc, look at the definition of grep.

>
>$c = "cat";
>
>@string=("cat", "dog", "alligator", "tomcat");
>
>@cats = grep(/$c/o, @string);
@cats = grep {$_ eq $c}, @string;
>print "@cats\n";

-Philip


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

Date: Tue, 14 Apr 1998 05:03:54 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: "Andrew M. Langmead" <aml@world.std.com>
Subject: Re: trying to use grep to give an exact match
Message-Id: <Pine.GSO.3.96.980413220248.13639c-100000@user2.teleport.com>

On Tue, 14 Apr 1998, Andrew M. Langmead wrote:

> Ronald J Kimball <rjk@coos.dartmouth.edu> writes:
> 
> >grep(/^$c$/o, @string)
> 
> Shouldn't this be:
> 
> grep(/^\Q$c\E$/o, @string);

Shouldn't that be:

    @list = grep($_ eq $c, @string);

(I'm not just joking. They do two different things... :-)

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

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


Administrivia:

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

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