[6561] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 186 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 26 22:07:14 1997

Date: Wed, 26 Mar 97 19:00:28 -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           Wed, 26 Mar 1997     Volume: 8 Number: 186

Today's topics:
     Re: ?Sort for all O/S's <tchrist@mox.perl.com>
     [Q] Newbie problem with system() call brian.howell@symbios.com
     Re: A Call for Clarity (Schwartzian Transform Considere (I R A Aggie)
     Re: case sensitivity [followups to a.r.computers, of co (Russell Schulz)
     Re: Component scripting (was: ANNOUNCE: OpTcl v1.0b2) (Bob Dougherty)
     Coverting Objects to packed strings.. how? (M. Sean Bennett)
     Re: Coverting Objects to packed strings.. how? <rootbeer@teleport.com>
     Functions and operators <rootbeer@teleport.com>
     Get a week number from a file (John Jiang)
     Re: Get a week number from a file (Nathan V. Patwardhan)
     Hanging CGI perl scripts (NT) <lewisrh@akcity.govt.nz>
     Help - Perl scripts cannot find cgi-lib.pl (Kevin Spicer)
     how to print the content of an html file? <roehnelt@csulb.edu>
     Re: how to print the content of an html file? <eric@nettown.com>
     Re: how2 run perl on win 3.11 system?? <billc@tibinc.com>
     Re: making links on the fly (William Byrd)
     Re: Need help CGI scripting HTML forms to email <rootbeer@teleport.com>
     NewbieQ: flow control while in while loop <blongwor@student.umass.edu>
     Re: ODBC package problem <billc@tibinc.com>
     Re: On-line web page editor:  Changing the directory a  <tchrist@mox.perl.com>
     Operators vs functions (was Re: On-line web page editor (Abigail)
     perl for.... <Rod_MacLean@ibm.net>
     Re: perl for.... <eric@nettown.com>
     Re: Perl, Delphi, Linux, Windows, and databases (VB5E?) <mikaelo@NO_SPAMsisstock.com>
     Re: Perl, Delphi, Linux, Windows, and databases (VB5E?) <billc@tibinc.com>
     Re: q <rootbeer@teleport.com>
     Re: regular expression for check lower case <tchrist@mox.perl.com>
     s/// fails because of embedded ()'s <ragoff@sandia.gov>
     Smarter indexing algorythm (David Alan Pisoni)
     Re: text to HTML <lauriem@cstr.ed.ac.uk>
     Re: trivial perl question from an ignoramus (Tad McClellan)
     Re: trivial perl question from an ignoramus <eric@nettown.com>
     Re: Unix and ease of use  (WAS: Who makes more ...) (Joel Garry)
     Re: What's a good Perl book? (I R A Aggie)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 26 Mar 1997 22:03:26 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: ?Sort for all O/S's
Message-Id: <5hc6fe$bsu$2@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    soccer@microserve.net (Geoffrey Hebert) writes:
:Because I want this to run anywhere perl code exists, how do I code a
:machine/OS independent sort?

You don't.   The Unix sort is very clever.  You do not wish
to try to recreate it in Perl.  Force your stoopid vendor to 
supply you with decent tools.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
On Monday mornings I am dedicated to the proposition that all men are
created jerks.
                --H. Allen Smith, "Let the Crabgrass Grow"


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

Date: Wed, 26 Mar 1997 19:41:18 -0600
From: brian.howell@symbios.com
To: brian.howell@symbios.com
Subject: [Q] Newbie problem with system() call
Message-Id: <859426341.7340@dejanews.com>

Hi all,

Can someone please help me out?  I'm having problems with system() calls.
When I use a system call with a unix command I don't have any problems,
but the minute I call a non-unix script or program the call does not work.
Is this just a problem I need to work out myself or is there another built
in function I need to use?

Thanks to all that help,
brianh

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Tue, 25 Mar 1997 10:04:59 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: A Call for Clarity (Schwartzian Transform Considered Scary)
Message-Id: <fl_aggie-ya02408000R2503971004590001@news.fsu.edu>

In article <5h7fhc$8nr@news-central.tiac.net>, mike@stok.co.uk wrote:

+ one of the entertaining things about the effects of any kind of rigourous
+ (in a classical sense) "scientific" education is just how far smart people
+ are prepared to stretch the notions of "reasonable" and "obvious."

How does that go? "A problem is hard until you do it, then its trivial."
One just has to remember that not everyone has "done it", and that it
may not be "trivial".

James

-- 
Consulting Minster for Consultants, DNRC

To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>


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

Date: Wed, 26 Mar 1997 09:52:27 -0700
From: Russell_Schulz@locutus.ofB.ORG (Russell Schulz)
Subject: Re: case sensitivity [followups to a.r.computers, of course]
Message-Id: <19970326.095227.4w7.rnr.w164w_-_@locutus.ofB.ORG>

mirage@tsil.net writes:

> Is there anyway to keep Perl, Java, JavaScript, etc from being 
> case sensitive?

realistically, no.

> Is there any actual use of case sensitivity

sure, but no good ones that I've seen.  of course, you may LIKE having
declarations like `String string;', but I personally think it's a Bad
Thing to do to yourself and your code maintainers.

> or is this yet another unfortunate instance of the carry-over of one of
> C's worst language features?

yes.  many old things are oriented towards computer ease (where q and
Q are different bit patterns, so they're not the same) instead of
human ease (where q and Q are clearly both `the letter queue').

> I don't know about others but I find mixed case greatly improves 
> script readability.

then use it.  but be very, very careful.  someone has already pointed
out that perl is helpless if you have something like:

  $index=1;
  if ($index<3)
  {
    $Index++;
    warn "using $Index now...\n";
  }

because both `index' and `Index' are referred to more than once.
-- 
Russell_Schulz@locutus.ofB.ORG  Shad 86c


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

Date: 26 Mar 1997 20:48:16 -0500
From: bobd@cyberenet.net (Bob Dougherty)
Subject: Re: Component scripting (was: ANNOUNCE: OpTcl v1.0b2)
Message-Id: <5hcjl0$f7@ux1.cyberenet.net>

In article <5hbelm$qrp@Starbase.NeoSoft.COM>,
Cameron Laird <claird@Starbase.NeoSoft.COM> wrote:
>I'm surprised there's been no reaction in c.l.p.m--at least
>none that I can find--to Jon Udell's provocative
>	Udell, Jon
>	1997	"Perl's Future", Byte, volume
>		22, number 4, pages 121-124
[snip]
>This article presents a profound challenge to The Keepers of
>Perl and the Perl community at large.  It's going to take hard
[snip]

Just my rash opinion, but I thought the article should have been titled,
"Perl's Future in the world of distributed objects, NT web servers 
and Windows web clients"

 ... which may be The Future as Mr. Udell sees it, but that's his
prerogative as a pundit.

[newsgroups trimmed to comp.lang.perl.misc]

-- 
-- 
Bob Dougherty                        bobd@cyberenet.net


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

Date: 26 Mar 1997 22:10:12 GMT
From: sean@ugcs.caltech.edu (M. Sean Bennett)
Subject: Coverting Objects to packed strings.. how?
Message-Id: <5hc6s4$ga6@gap.cco.caltech.edu>

I need to take an instance of an object (and its current data) and pack it
into a string for storage.

The string needs to be ASCII clean.

How do I do this - which module can I use?

Feel free to e-mail me if this is a trivial one.. I will try and
browse the group - work allowing.

	Yours, Sean




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

Date: Wed, 26 Mar 1997 17:56:40 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "M. Sean Bennett" <sean@ugcs.caltech.edu>
Subject: Re: Coverting Objects to packed strings.. how?
Message-Id: <Pine.GSO.3.96.970326175443.1174Q-100000@kelly.teleport.com>

On 26 Mar 1997, M. Sean Bennett wrote:

> I need to take an instance of an object (and its current data) and pack
> it into a string for storage. 

Well, you could use the pack function, but you'll have to be careful that
you can reconstruct and bless the object as needed. There are also some
modules on CPAN for saving and restoring Perl data.

> The string needs to be ASCII clean.

What does that mean? No high bits and no null bytes?

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Wed, 26 Mar 1997 17:52:07 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Tom Christiansen <tchrist@mox.perl.com>
Subject: Functions and operators
Message-Id: <Pine.GSO.3.96.970326173730.1174P-100000@kelly.teleport.com>

On 26 Mar 1997, Tom Christiansen wrote, correcting me:

> No, Tom: perlfunc has functions, perlop has operators.  (Ok, I know we
> put -X in perlfunc.  Nonetheless...) 

> I realize you can blur the distinction, but that serves only to confuse
> people. 

Agreed. Many of us are easily confused about the differences between
operators and functions. But I see what you mean, most things in perlfunc
are functions, to my mind.

> Don't call print or chomp operators.  Call them functions.

Okay...

> Things like "eq" and "++" are operators.  

Okay...

> And "<STDIN>" is not an operator at all.  At most, it's an operation,
> where "<>" is the circumfix operator and STDIN its operand. 

So, it's neither a function nor an operator? Hmmm... From what you say,
I'd be tempted to analogize that <*.c> is an operation as well, but isn't
glob("*.c") a function? Not that I'm disagreeing with you; I'm just trying
to wrap my brain around all this. 

Is there a way to tell functions from non-functions and operators from
non-operators? Are there some things which are both functions and
operators? And isn't this a messy can of worms? :-) 

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: 26 Mar 1997 23:10:09 GMT
From: jiangj@bnr.ca (John Jiang)
Subject: Get a week number from a file
Message-Id: <5hcach$i8g@crchh327.rich.bnr.ca>

Hello,

	How can I get a week number of the time when a file is
created. The week number would be something like what we got from
shell "date -u +%W". Thanks.

--
 ______________________________________________
|XXXX^____.  _.    ^XXXX| John  Jiang	       |
|XXX  \__ | | |      XXX| NORTEL, Richardson   |
|XX     | |_| |__.    XX|......................|
|X    __| |..\ \ |     X|     972-684-8344     |
|X____\___/__/_/_|_____X|__jiangj@nortel.com___|


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

Date: 27 Mar 1997 01:00:09 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Get a week number from a file
Message-Id: <5hcgqp$pta@fridge-nf0.shore.net>

John Jiang (jiangj@bnr.ca) wrote:

: 	How can I get a week number of the time when a file is
: created. The week number would be something like what we got from
: shell "date -u +%W". Thanks.

You can't get the creation date of a file, but you can get last-modified,
date, etc., which are explained in perlfunc.pod in the section dealing
with stat().

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: Wed, 26 Mar 1997 22:53:14 GMT
From: Rhys Lewis <lewisrh@akcity.govt.nz>
Subject: Hanging CGI perl scripts (NT)
Message-Id: <3339A8DA.471B@akcity.govt.nz>

I am having trouble with CGI perl scripts not terminating on an 
NT server.  If you let the script below run it takes around 35 
seconds to complete and the cmd.exe & perl.exe processes 
dissappear happily.  If you stop loading the page before it 
finishes the perl.exe and cmd.exe live on (using up very little 
processor time but obviously not desirable) until you kill them.

If you take out the commented line the script runs for its 35 
seconds and then dissappears, which leaves me wondering if it 
has something to do with file and process handles once the 
browser is no longer accepting input.

I am using the NT port of PERL on Win NT 3.51.

Rhys Lewis
lewisrh@akcity.govt.nz



$|=1;
print "Content-type: text/html\n\n";

$counter =0;
while ($counter < 1000) {
	for ($i=0;$i<9999;$i++) {
		$dummy = 234.32432 * 234234.234;
	}
	$counter++;

open (IN, "test.txt");
$counterf = <IN>;  # this line is the problem
close IN;

	print "$counterf \n";
}


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

Date: 26 Mar 1997 23:00:50 GMT
From: kspicer@music.transy.edu (Kevin Spicer)
Subject: Help - Perl scripts cannot find cgi-lib.pl
Message-Id: <5hc9r2$n58@service3.uky.edu>


OK...this seems like a rather basic problem, but my Perl scripts cannot seem to find
my cgi-lib.pl file, even though it's in the same directory as the scripts
themselves. I wrote a simple "Hello world" script, included below:

# begin

print "Content-type: text/html\n\n";

require "cgi-lib.pl";

print "Hello world.";

# end

* When I double-click on this in Windows Explorer, it runs.
* It runs from the command line.
* It runs on my Linux system.
* When I comment out the "require "cgi-lib.pl";", it runs when accessed through the 
web too. But for some reason, when I try to access it through the web with that 
"require" line included, it tells me "Document contains no data."

I know that I don't need cgi-bin.pl to run this program, but I do need it to run
others, all of which give me the same thing when "require" is not commented out: 
"Document contains no data." I am running Netscape's Fasttrack server on Win 95; .pl 
is associated with Perl. I have run this successfully on OmniWEB. Is perhaps 
cgi-bin.pl not being "seen" by Fasttrack?

Any help would be appreciated.

Kevin Spicer
kspicer@music.transy.edu
http://spicer-k.transy.edu




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

Date: Wed, 26 Mar 1997 16:35:49 -0800
From: Sean Roehnelt <roehnelt@csulb.edu>
Subject: how to print the content of an html file?
Message-Id: <3339C0E5.409A1685@csulb.edu>

With a script I open a .html file, and make a substitution for each
image. Now I want to print out the entire file like:

open(HTML_FILE, $html_file);

##My substitutions happen here##

print <HTML_FILE>;

but it seems when I do this perl does not like all the quotes, and
slashes in the html file...

any suggestions?

sean

-- 
------------------------------------------------------------------------
Sean Roehnelt mailto:roehnelt@csulb.edu http://www.uces.csulb.edu/~seanr
------------------------------------------------------------------------


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

Date: Wed, 26 Mar 1997 19:36:44 +0000
From: Eric Poindexter <eric@nettown.com>
To: Sean Roehnelt <roehnelt@csulb.edu>
Subject: Re: how to print the content of an html file?
Message-Id: <33397ACC.24DA62E6@nettown.com>

Sean Roehnelt wrote:
> 
> With a script I open a .html file, and make a substitution for each
> image. Now I want to print out the entire file like:
> 
> open(HTML_FILE, $html_file);
> 
> ##My substitutions happen here##
> 
> print <HTML_FILE>;
> 
> but it seems when I do this perl does not like all the quotes, and
> slashes in the html file...
> 
> any suggestions?
> 
> sean
> 
> --
> ------------------------------------------------------------------------
> Sean Roehnelt mailto:roehnelt@csulb.edu http://www.uces.csulb.edu/~seanr
> ------------------------------------------------------------------------

1. Get http://nettown.com/perl/site_perl/alans_Util.pm

2. Make sure that alans_Util.pm is in your path
Your "perl path" is what's in @INC. Do a

%perl -e '$" = "\n"; print "@INC\n"';

If the last entry is '.' you can just put alans_Util.pm in your current
directory.

3. Use like this:
use alans_Util;
$util = new alans_Util;

@f = $util->fget ($html_file)

process @f;

$util->fput ($html_file, @fnew);


I have included alans_Util.pm here...

package alans_Util;
# http://nettown.com/perl/site_perl/alans_Util.pm
# by A. Eric Poindexter
# <poindexter@nettown.com>
# @970113
# this contains...
# $file or @file = fget $fileName (file get)
# fput $fileName, @contents (file put)
# fappend $fileName, @contents (file append)
# @dir = dget $dir (directory get, with no .hidden files, sorted)

sub new {
  my $type = shift;
  my $self = {};

  return bless $self, $type;
}

sub fget {
  my $self = shift;
  my $fname = shift;

  my $IRSwas = $/;
  undef $/;

  open F, $fname or print "!opening to read >$fname<...$!\n" and return;
  my $f = <F>;
  close F;

  $/ = $IRSwas;

  if (wantarray) {
    return split /^/, $f;
  }
  else {
    return $f;
  }
}

sub fput {
  my $self = shift;
  my $fname = shift;

  open F, ">$fname" or print "!opening to write >$fname<...$!\n" and
return;
  print F @_;
  close F;

  return 1;
}

sub fappend {
  my $self = shift;
  my $fname = shift;


  open F, ">>$fname" or print "!opening to append >$fname<...$!\n" and 
    return;
  print F @_;
  close F;

  return 1;
}

sub dget {
  my $self = shift;
  my $dir = shift;

  opendir D, $dir or print "!opening dir >$dir<...$!\n" and return;
  my @d = readdir D;
  close D;

  @d = grep !/^\./, @d;
  @d = sort @d;

  return @d;
}
 
1
# end of package alans_Util

--
Eric
<mailto:eric@nettown.com>
[http://nettown.com/perl/]
have a good day! (yes, Poindexter is Really my name :-)


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

Date: Wed, 26 Mar 1997 20:16:12 -0500
From: Bill Cowan <billc@tibinc.com>
To: rubinm@aztec.asu.edu
Subject: Re: how2 run perl on win 3.11 system??
Message-Id: <3339CA5C.244E@tibinc.com>

marc wrote:
> 
> I'd like to develop perl app on my windows 3.1/486 machine.  Would be
> most grateful for instructions on how to get started.

See http://www.perl.com/CPAN/ports/ for different downloads for your PC
and O.S.

-- Bill
-----------------------------------------------------------------------
Bill Cowan <billc@tibinc.com>    Voice:919-490-0034   Fax:919-490-0143
Tiburon, Inc./3333 Durham-Chapel Hill Blvd Suite E-100/Durham, NC 27707


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

Date: Thu, 27 Mar 1997 04:40:45 GMT
From: wcb4@erols.com (William Byrd)
Subject: Re: making links on the fly
Message-Id: <5hcj7p$247@boursy.news.erols.com>

On Tue, 25 Mar 1997 12:53:48 +1100, Martien Verbruggen
<mgjv@comdyn.com.au> wrote:

>William Byrd wrote:
>> experienced with HTML and the forms needed for links, but what I am
>
>HTML?
>
>What about CGI? Have you read the CGI specs? or even the FAQ? Have you
>asked on one of the groups devoted to CGI?
>
>
>> This caused server configuration error to be returned.
>
>Does it run from the command line? Did you think of returning a Content
>type before starting to print stuff to output?
>
>*sigh*
>
>Have I seen this 

Perhaps you have not seen it before. I did that. I was gettign the
error anyway. I worked from the command line, and if you read the
message, the probelm had nothin do do with content type.

The FAQ (and I was unaware at the time that there was one) was mailed
to me when I posted this. The post was in error. I want to thank you
EVER SO MUCH for being an arrogant anot and being SO CONDESENDING to
someone who had what turned out to be a ligitimate PERL question, just
in a CGI application. It involved excaped characters in a string
variable, but thanks for proving that ARROGANT people come in the
cyberspace variety too. Perhaps I will come back tothis newsgroup,
when I learn more PERL, but it is blatantly obvious from this messgae
and a few private ones I got, that most of you don't care about
helping someone with PERL if it is for the web. Too bad, for us
perhaps, but also for you. There are a lot of folks on this newsgroup
who seem to really have a lot of answers that can be applied to both
CGI/WEB applications for Perl and non web usage, but such arrogance
will probably keep many of us from asking them. 

I don't know about you folks, but I learned PASCAL, ADA, FORTAN,
BASIC, ASSEMBLY for VAX, DCL, DOS batch commands, COBOL and a few
other minor command and scripting language primarily from asking those
who had been using it for a while and from looking at the works of
others, even if they did not exactly do what I wanted. I personally
still try to allow others the opportunity to learn from my experience
by making much of the stuff I write open to others to examine. I do my
best not to be condescending or arrogant simply because that is how I
learned, by asking and looking,and if not for those who had already
learned, I would never have learned much of what I did. It is
comforting to know that I am, perhaps unique in the world of
programming in that aspect. I guess it sets me apart.

wcb4@erols.com




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

Date: Wed, 26 Mar 1997 17:34:30 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Sheldon Rampton <sheldon@execpc.com>
Subject: Re: Need help CGI scripting HTML forms to email
Message-Id: <Pine.GSO.3.96.970326173332.1174O-100000@kelly.teleport.com>

On Tue, 25 Mar 1997, Sheldon Rampton wrote:

> I can't figure out how to make Perl send email.

Usually you call sendmail, or its equivalent on your system.
Alternatively, you might use a module. Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Wed, 26 Mar 1997 20:34:05 -0500
From: Brett Longworth <blongwor@student.umass.edu>
Subject: NewbieQ: flow control while in while loop
Message-Id: <3339CE81.CC9@student.umass.edu>

Hello,

Sorry about the confusing subject line, I couldn't think of a better way
to explain my problem quickly.

I know this is a simple one, but I can't seem to find the answer
anywhere.  While using a while loop to grab stuff I want from a text
file, I'd like to try to grab a line that may or may not occur between
two matches of a regex a few lines apart.   If it is there, it should be
associated with the regex a few lines before it, if it's not, it
shouldn't be.

Bleah, that previous paragraph is longer than my problem.  Right now,
I'm trying to append the "in-between" line to the same variable that
contains the first line, and then sort it all out later.  If anyone
understood my poor explanation of what I'm trying to do, a push in the
right direction or suggestion of a good consruct to get this done would
be great.

Thanks!!!
-Brett


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

Date: Wed, 26 Mar 1997 20:37:24 -0500
From: Bill Cowan <billc@tibinc.com>
To: Jerome O'Neil <joneil@is.ssd.k12.wa.us>
Subject: Re: ODBC package problem
Message-Id: <3339CF54.276A@tibinc.com>

In addition, be sure to check the result status for $Data = new
Win32::ODBC... and use Win32::ODBC::Error() to display any database
error messages.

Bill

Jerome O'Neil wrote:
> 
> Donovan Janus wrote:
> 
> > use Win32::ODBC;
> > $Data = new Win32::ODBC("DSN=DeZaak;UID=MyName;PWD=MyPassWord");
> > ($qualifier, $owner, $name, $type) = $Data->Catalog("", "", "%",
> > "'TABLE'");
> > $Data->Close();
> >
> > I get the error:
> >
> > Can't call method "Catalog" without a package or object reference at
> > line 3.
> 
> Your $Data object isn't being initialized for some reason or another.
> Check and make sure your DSN, UID, and PWD are all correct.  An easier
> way to do it (since you are using NT) is to define your database as a
> System DSN with the NT ODBC32 applett.  That way you get to use the much
> easier
> $Data = new Win32::ODBC("NT_System_DSN_name") and let the NT ODBC
> functions take care of the details.
> 
> Your permissions may vary.
> 
> Jerome

-----------------------------------------------------------------------
Bill Cowan <billc@tibinc.com>    Voice:919-490-0034   Fax:919-490-0143
Tiburon, Inc./3333 Durham-Chapel Hill Blvd Suite E-100/Durham, NC 27707


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

Date: 26 Mar 1997 22:02:00 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: On-line web page editor:  Changing the directory a file is written to?
Message-Id: <5hc6co$bsu$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    abigail@ny.fnx.com writes:
:Uhm, but what is the difference between functions and operators, other
:than that functions usually contain just letters and preceed their
:arguments, while operators mostly contain punctuation symbols and are
:often found mingled between the operands?

You're right.  And in a certain somewhat perverse sense, perl doesn't
have functions, only operators.  Telling people to use the open operator
or the getpnam operarator really throws folks who think of them as
functions.  It's hard to blame them.  And not using parens at all requires
that people remember which things are prototypes to take 0, 1, or
many arguments, which is even worse.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

*bp++ = i;      /* now go back to screaming loop */
    --Larry Wall, from perl/sv.c in the v5.0 perl distribution


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

Date: Thu, 27 Mar 1997 00:53:51 GMT
From: abigail@ny.fnx.com (Abigail)
Subject: Operators vs functions (was Re: On-line web page editor:  Changing the directory a file is written to?)
Message-Id: <E7oFtr.8C7@nonexistent.com>

On 26 Mar 1997 22:02:00 GMT, Tom Christiansen wrote in comp.lang.perl.misc:
++  [courtesy cc of this posting sent to cited author via email]
++ 
++ In comp.lang.perl.misc, 
++     abigail@ny.fnx.com writes:
++ :Uhm, but what is the difference between functions and operators, other
++ :than that functions usually contain just letters and preceed their
++ :arguments, while operators mostly contain punctuation symbols and are
++ :often found mingled between the operands?
++ 
++ You're right.  And in a certain somewhat perverse sense, perl doesn't
++ have functions, only operators.  Telling people to use the open operator
++ or the getpnam operarator really throws folks who think of them as
++ functions.  It's hard to blame them.  And not using parens at all requires
++ that people remember which things are prototypes to take 0, 1, or
++ many arguments, which is even worse.
++ 

Oh, I am not suggesting we should call everything operator or function.
But your postings got me confused.

Jeffrey writes "An operator can understand more about itself and its
operands than a function can know about how it is called or about how
its arguments are provided." on page 159 of Mastering Regular
Expressions. I don't know what he means by that (I don't think he talks
about a specific tool or implementation, but about operators and
functions in general).



Abigail



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

Date: Wed, 26 Mar 1997 20:00:19 -0500
From: Rod MacLean <Rod_MacLean@ibm.net>
Subject: perl for....
Message-Id: <3339C6A3.446B@ibm.net>

Can someone point me to where I can download the perl interpreter
for SunOS & Solaris.
Thanks,
Rod MacLean


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

Date: Wed, 26 Mar 1997 20:12:40 +0000
From: Eric Poindexter <eric@nettown.com>
To: Rod MacLean <Rod_MacLean@ibm.net>
Subject: Re: perl for....
Message-Id: <33398338.1109DE64@nettown.com>

Rod MacLean wrote:
> 
> Can someone point me to where I can download the perl interpreter
> for SunOS & Solaris.
> Thanks,
> Rod MacLean

Yes.
The latest version of perl, perl5.003_94 (perl5.004BETA), is at
http://nettown.com/perl/src/perl/
also under this directory is the source unzipped and pod2html files.
These are searchable from http://nettown.comm/Search.cgi
The pod2html (doc) files are also under
http://nettown.com/perl/doc/

The place I untar is /usr/local/src. Perl is a very smart self
installer, so it will tell you what else you need. (perl is written in
c).

start at
http://nettown.com/perl/src/perl/perl5.003_94/README
http://nettown.com/perl/src/perl/perl5.003_94/INSTALL

The Comprehensive Perl Archive Network is your complete source.
http://www.perl.com/CPAN

--
Eric
<mailto:eric@nettown.com>
[http://nettown.com/perl/]
have a good day! (yes, Poindexter is Really my name :-)


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

Date: 26 Mar 1997 22:18:09 GMT
From: "Mikael Ostensson" <mikaelo@NO_SPAMsisstock.com>
Subject: Re: Perl, Delphi, Linux, Windows, and databases (VB5E?)
Message-Id: <01bc3a34$6a599f20$50fb47ce@mikaelo.sisstock.com>

You may want to check out mysql (www.tcx.se).
I developing a web-site in perl using that database and it has a ODBC32
driver.

Mikael Ostensson
mikaelo - @ - sisstock.com
work for a spam-free world...

Chris Schoenfeld <chris@ixlabs.com> wrote in article
<333829ED.4650@ixlabs.com>...
> ARGH!
> 
> We are having trouble scaling some of our work.
> We have been doing Perl/CGI/database work with DB_File/Berkeley DB.
> Now I want to do some Client/Server work with Delphi.
> I want a new database which will support both.
> 
> Delphi wants to use Oracle, Sybase, Informix, or Interbase.
> From what I understand, Perl has modules for some/all of these in
> various stages of robustness.
> NONE of these databases support Linux - GRRRR!!!
> 
> I need a database I can run on Linux, Windows 95, Windows NT, and
> Solaris, that has excellent Linux Perl support and excellent Windows C/S
> RAD tool support. I am willing to switch to VB5 enterprise if that will
> help.
> 
> I'm starting to beleive there is no such animal. I will probably have to
> find a Linux/Solaris database with ODBC (blechh).
> 
> I started to evaluate Velocis, which seemed like a good choice - but
> their Perl module was comprised of a windows DLL! arg!
> 
> It would be great if Sybase would just port to Linux. Then we could
> start off with SQL Anywhere and scale up development on both platforms.
> 
> -- 
> Chris Schoenfeld
> IX Development Laboratories   
> Santa Rosa, California
> (707)-543-8030 Ext. 12
> 


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

Date: Wed, 26 Mar 1997 20:57:35 -0500
From: Bill Cowan <billc@tibinc.com>
To: Mikael Ostensson <mikaelo@spam-free-sisstock.com>
Subject: Re: Perl, Delphi, Linux, Windows, and databases (VB5E?)
Message-Id: <3339D40F.2307@tibinc.com>

Please remember to separate client and server for your database.  You
could have *client* access from Linux (your Web server?) to a database
server running on NT or another Unix box. 

At one point, I thought Sybase Open Client (i.e. client side components)
was available on Linux; maybe I am wrong. You might want to check more
into this. 

Sybperl on Unix has been used awhile and is quite complete. But no
Sybperl on NT; ODBC/Perl would be route for Sybase access.  I should
know I went down this road recently.

FYI: Pricing for Sybase SQL Server on NT is much better than it used to
be and includes GUI DBA tool. New "Professional" package include CASE
tool.

Bill

Mikael Ostensson wrote:
> 
> You may want to check out mysql (www.tcx.se).
> I developing a web-site in perl using that database and it has a ODBC32
> driver.
> 
> Mikael Ostensson
> mikaelo - @ - sisstock.com
> work for a spam-free world...
> 
> Chris Schoenfeld <chris@ixlabs.com> wrote in article
> <333829ED.4650@ixlabs.com>...
> > ARGH!
> >
> > We are having trouble scaling some of our work.
> > We have been doing Perl/CGI/database work with DB_File/Berkeley DB.
> > Now I want to do some Client/Server work with Delphi.
> > I want a new database which will support both.
> >
> > Delphi wants to use Oracle, Sybase, Informix, or Interbase.
> > From what I understand, Perl has modules for some/all of these in
> > various stages of robustness.
> > NONE of these databases support Linux - GRRRR!!!
> >
> > I need a database I can run on Linux, Windows 95, Windows NT, and
> > Solaris, that has excellent Linux Perl support and excellent Windows C/S
> > RAD tool support. I am willing to switch to VB5 enterprise if that will
> > help.
> >
> > I'm starting to beleive there is no such animal. I will probably have to
> > find a Linux/Solaris database with ODBC (blechh).
> >
> > I started to evaluate Velocis, which seemed like a good choice - but
> > their Perl module was comprised of a windows DLL! arg!
> >
> > It would be great if Sybase would just port to Linux. 



> >Then we could
> > start off with SQL Anywhere and scale up development on both platforms.
> >
> > --
> > Chris Schoenfeld
> > IX Development Laboratories
> > Santa Rosa, California
> > (707)-543-8030 Ext. 12
> >

-- Bill
-----------------------------------------------------------------------
Bill Cowan <billc@tibinc.com>    Voice:919-490-0034   Fax:919-490-0143
Tiburon, Inc./3333 Durham-Chapel Hill Blvd Suite E-100/Durham, NC 27707


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

Date: Wed, 26 Mar 1997 17:57:08 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Anthony Mulligan <avm@best.com>
Subject: Re: q
Message-Id: <Pine.GSO.3.96.970326175654.1174R-100000@kelly.teleport.com>

On 26 Mar 1997, Anthony Mulligan wrote:

> Subject: q

a

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: 27 Mar 1997 00:25:06 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: regular expression for check lower case
Message-Id: <5hcep2$i92$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    Douglas Seay <seay@absyss.fr> writes:
:	$var !~ m/[A-Z]/ 
:	$var =~ m/^[a-z]$/

That doesn't work in all cases, especially on the Continent.  
What about words like Reni or Frangois?

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com


150 years ago everybody was a Christian Scientist.   --dmr


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

Date: Wed, 26 Mar 1997 08:14:24 -0700
From: Robert Goff <ragoff@sandia.gov>
Subject: s/// fails because of embedded ()'s
Message-Id: <33393D50.C68@sandia.gov>

I was pulling my hair out over this one.

Regard the following code:

# for each url with a false LINKACT, remove the a tag
foreach $url (keys %LINK) {
    if (!$LINKACT{$url}) {
        $tmp .= ',' if $debug;
        $index_buffer =~ s/$LINK{$url}/$LINKTITLE{$url}/s;
    }
    elsif ($debug) {
        $tmp .= '!';
        $index_buffer =~ s/$LINKTITLE{$url}/$LINKTITLE{$url}
\[$ROLES{$url}]/s;
    }
}

The substitution in the top if condition was failing, even when I was
sure that it shouldn't.  I spent hours verifying that $LINK{$url} did
indeed exist in $index_buffer and that the script was actually executing
the substitution line.

It turns out that $LINK{$url} contained embedded parens.  When I escaped
the parens, the substitution succeeded.  I haven't seen anything in the
man pages or the Camel book to explain this - can someone tell me why,
and what else I have to escape?

Is it because the parens are grouping operators?  Will I also have to
escape []?
-- 
=================================================
Robert Goff             email: ragoff@sandia.gov
Sandia National Labs    Phone: (505)284-3639


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

Date: Wed, 26 Mar 1997 15:57:47 -0800
From: david@cnation.com (David Alan Pisoni)
Subject: Smarter indexing algorythm
Message-Id: <david-2603971557470001@prokofiev.cnation.com>

Hello,

I recently wrote a program that takes a database of zip codes with their
geographic coordinates and creates an index database listing each zip code
and the six closest zip codes.  The trouble is, it looks like it might
take as long as ten days to run!  I was wondering if anyone had any ideas
how I could tighten the algorythm so that it would not take as long.  Here
is my process (in perly English):

Outer Loop : foreach $zip (all zip codes) {
     Inner Loop : foreach $testzip (all zip codes in current state AND
bordering states of $zip) {
          next if ($testzip == $zip);
          $prox = distance between $zip and $testzip (in miles, if you care)
          for ($pos=0;$pos<=5;$pos++)  {
               if ($prox < distance between $pos closest zip and $zip
(already cached) { splice $testzip into list at $pos; pop list; last; }
          } # END for loop
     } # END inner loop
     Store list of 6 closest zip codes in index database
} # END outer loop

The reason this algorythm is so slow is that for each zip code it tests
the distance between itself and EVERY zip code in it's home state, and all
the states bordering.  I could not come up with a better solution to this
problem, though I put a lot of thought into it.  The algorythm could be
slightly tightened if each zip code placed itself in the proximity list of
all the zip codes on it's list, but the difference would probably only be
slight.  The real bottleneck is the long list of comparisons.

Can anyone think of a more expedient methodology for this process?

Thank you for your help,
David Pisoni, System Administrator
CyberNation, LLC -- Web Design for the Next Milennium
david@cnation.com - http://www.cnation.com/
310/656-3450  -  310/656-3453 (fax)


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

Date: Wed, 26 Mar 1997 16:42:58 +0000
From: Laurence Molloy <lauriem@cstr.ed.ac.uk>
Subject: Re: text to HTML
Message-Id: <33395212.4CAA@cstr.ed.ac.uk>

Lewis Taylor wrote:
> 
> I am currently writing a primative text to HTML routine. I want to
> replace all instances of double carriage return (\n\n) with a paragraph
> tag. But this :
> 
> $big_string =~ s/\n\n/<P>/g;
> 
> does'nt seem to do anything. I have also tried the two \n's in a
> variable to no avail. Other printable chars in place of \n\n work. Can
> someone please help?
> 

Perl has a special variable $* which you can set to 1 if you wish to 
<quote>do multiline matching within a string</unquote>. However, I can
never get it to match more than 1 "\n". Can someone explain to me
exactly what "$*=1" can and cannot do?

Alternatively, how about s/^$/<P>/g?

The ^ equates to line start
and $ equates to line end

thus, ^$ implies an empty line (same as \n\n).

I've tested the above substitution command and it seems to do the job
you require.

hope this helps,
Laurence.

-- 
 ____________________________________________________________
                                                             
  Laurence Molloy				             
  Centre for Speech Technology Research	                     
  University of Edinburgh                                    
  Level D					             
  80 South Bridge		Tel.  +44 131 650 6357      
  Edinburgh.  EH1 1HN		Fax.  +44 131 650 6351      
  Scotland, UK.			Email lauriem@cstr.ed.ac.uk 
 ____________________________________________________________


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

Date: Wed, 26 Mar 1997 17:07:38 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: trivial perl question from an ignoramus
Message-Id: <q7ach5.e56.ln@localhost>

Robert R. Tucci (tucci@ar-tiste.com) wrote:
: Hi,
:  
: I'm trying to write a cgi in perl. Problem is, the amount of perl I know
: could all be written on a postage stamp, with room to spare.

: I found a simple perl subroutine on the web that is supposed to add prefix
: zeros to integers< 10. Unfortunately, it doesn't work. Could someone
                                        ^^^^^^^^^^^^^^^

There is a perfectly useless bit of information.

What does "doesn't work" mean?

dumps core
hangs, never returns
syntax error message
outputs nothing
outputs stuff but it is not the right stuff
prints a bunch of garbage (like a binary)
some other kind of error message
 ...




: please tell me why?

please tell us what it does when you try it !!!


: This is what I'm doing:

: ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
: $true_mon = $mon + 1;
: &check($year, $true_mon, $mday, $hour, $min, $sec);


Q: And where do the results from the &check() routine go?

A: in the bit bucket...

You need to capture the output into a variable, or print it out,
or do _something_ with it...



: $x_inv_number = "$year$true_mon$mday$hour$min$sec";
: #===============================================================
: #Purpose of next sub: Add a 0 before any numbers < 10.

: sub check
: {         
:         $i=0;
          ^^

this should be my()ed, or you may stomp on other variables
who just happened to be named $i

my($i) = 0;


:         foreach $i (0 .. $#){
                           ^^

The -w switch (that ALL perl programmers should use, *especially*
new perl programmers) complains about this anachronism...


:                 if($_[$i]<10){
:                         $_[$i]="0$_[$i]";
:                 }
:         }
:         @_;
: }


------------------------------------
#! /usr/bin/perl -w
#                ^^    ALWAYS let perl help you find your bugs...

($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
$true_mon = $mon + 1;


# print each element of the array returned from &check(),
# separated by spaces

$x_inv_number = join ' ', &check($year, $true_mon, $mday, $hour, $min, $sec);

print "$x_inv_number\n";


sub check
{
   my($i);

        for  ($i=0; $i<@_; $i++) {         # for each element in @_ array
                if($_[$i]<10){             # if less than ten
                        $_[$i]="0$_[$i]";  # add a leading zero
                }
        }
        @_;      # return some stuff
}
------------------------------------

--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: Wed, 26 Mar 1997 19:12:09 +0000
From: Eric Poindexter <eric@nettown.com>
To: "Robert R. Tucci" <tucci@ar-tiste.com>
Subject: Re: trivial perl question from an ignoramus
Message-Id: <33397509.21AE4D3@nettown.com>

Robert R. Tucci wrote:
> 
> Hi,
> 
> I'm trying to write a cgi in perl. Problem is, the amount of perl I know
> could all be written on a postage stamp, with room to spare.
> 
> I found a simple perl subroutine on the web that is supposed to add prefix
> zeros to integers< 10. Unfortunately, it doesn't work. Could someone
> please tell me why?
> 
> This is what I'm doing:
> 
> ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
> $true_mon = $mon + 1;
> &check($year, $true_mon, $mday, $hour, $min, $sec);
> $x_inv_number = "$year$true_mon$mday$hour$min$sec";

Use sprintf, i.e.

$x_inv_number = sprintf '%4%02%02%02%02%02',  $year, $true_mon, $mday,
$hour, $min, $sec;

Check out man sprintf (if in unix) for more information.
This is a major C function that perl inherited.
--
Eric
<mailto:eric@nettown.com>
[http://nettown.com/perl/]
have a good day! (yes, Poindexter is Really my name :-)


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

Date: Wed, 26 Mar 1997 22:26:29 GMT
From: joelga@rossinc.com (Joel Garry)
Subject: Re: Unix and ease of use  (WAS: Who makes more ...)
Message-Id: <1997Mar26.222629.19875@rossinc.com>

In article <333837BE.699B@calfp.co.uk> Nick Leaton <nickle@calfp.co.uk> writes:
>Peter Seebach wrote:
> 
>> Linux developers can release something they know to be buggy, and have
>> thousands of people help them work out the bugs.
>
>Isn't that the same way the Microsoft works? ;-)

No, the thousands don't help them work out the bugs, they just pay money and
sit quietly thinking it's something they did wrong.

>
>-- 
>
>Nick


-- 
Joel Garry               joelga@rossinc.com               Compuserve 70661,1534
These are my opinions, not necessarily those of Ross Systems, Inc.   <> <>
%DCL-W-SOFTONEDGEDONTPUSH, Software On Edge - Don't Push.            \ V /
panic: ifree: freeing free inodes...                                   O


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

Date: Tue, 25 Mar 1997 10:02:10 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: What's a good Perl book?
Message-Id: <fl_aggie-ya02408000R2503971002110001@news.fsu.edu>

In article <33371D10.23E40A50@storm.sparks.nv.us>, Greg Spencer
<WSpencer@storm.sparks.nv.us> wrote:

+ I have 2 suggestions for future reprints:
+ 
+ 1.) A quick referance

There's one in CPAN...or you can purchase a "real" copy from O'Reilly.

+ 2.) On page 92 you list a number of "Assignment Operators"
+         but some of them are never mentioned again in the
+         text.

Some of those are rather esoteric, so I'm not surprised they're not
mentioned again. But what's so difficult about:

$var1 OP= $var2; being the same as: $var1 = $var1 OP $var2; ??

At that point, you just need to look up the OPerator.

James

-- 
Consulting Minster for Consultants, DNRC

To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>


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

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

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