[6348] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 970 Volume: 7

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 18 23:17:22 1997

Date: Tue, 18 Feb 97 20:00:23 -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           Tue, 18 Feb 1997     Volume: 7 Number: 970

Today's topics:
     Re: $! Error Handling <rootbeer@teleport.com>
     Re: [Q] Perl in win3.11? <dean@tbone.biol.sc.edu>
     Any idea what's wrong w/ this script????? (Thomas Porter, Ph.D.)
     Re: Any idea what's wrong w/ this script????? <eryq@enteract.com>
     Breaking an @ down to individual fields <fissio@fission.com>
     Re: Compile DBI <Tim.Bunce@ig.co.uk>
     Re: Compiled Perl (Mike Stok)
     Re: debugging perl & html (Jot Powers)
     Re: debugging perl & html <hall@imall.com>
     Re: Deleting files in perl (Nathan V. Patwardhan)
     Re: doh! Strange socket problems... (Mike Stok)
     Re: flock() Function Question <jesse@ginger.sig.bsh.com>
     Re: Interesting problem. <ray@westlake.com>
     Re: java.io.File.separator equivalent? <eryq@enteract.com>
     Re: Login Script ? (Tad McClellan)
     Matt's Counter Archive <Shadow@r56h108.res.gatech.edu>
     Re: OK I know that I am a newbie But I need HELP!! <merlyn@stonehenge.com>
     Re: OK I know that I am a newbie But I need HELP!! (Tad McClellan)
     Re: on the fly graphs (David Whitmarsh)
     Overloading perl object methods, Howto ? (Lee Van Dyke)
     Password script? <sshaffer@otginc.com>
     Re: PERL / OLE (Don Reid)
     perl 5.0 install problem <matylonj@ccmail.orst.edu>
     Problems with -l (Peter Scott)
     Re: PROGRAM: how to check for nice/valid email address (Jon Drukman)
     Re: Q: how best to share a hash between packages (Mike Stok)
     Re: reduce length <rootbeer@teleport.com>
     Re: regexp's in XEmacs vs. Perl <merlyn@stonehenge.com>
     Re: Searching for Perl-supported Linux database (Remove .nospam to e-mail me)
     Re: Set operations (union, intersection, etc...) <merlyn@stonehenge.com>
     Re: transliteration library <annehillebrand@worldnet.att.net>
     Re: Why can i run Perl in Linux? <seay@absyss.fr>
     Re: Why can i run Perl in Linux? <jander@jander.com>
     Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)

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

Date: Tue, 18 Feb 1997 14:01:57 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Geoff Halliwell <geoffrey.halliwell@Sun.COM>
Subject: Re: $! Error Handling
Message-Id: <Pine.GSO.3.95q.970218135735.23287S-100000@julie.teleport.com>

On Fri, 14 Feb 1997, Geoff Halliwell wrote:

> How do you capture $! in a numeric context when opening a file? 

It sounds as if you want to save it to process it later. That's fine, if
you know what you're doing. :-)

    $saved_error = $!;		# Capture error result

If you want to be sure that you have a number (instead of the string
value) before you, say, interpolate that value into a string, simply treat
it as a number, like this:

    $saved_error = 0 + $!;	# Capture error number

Some folks recoil in horror at adding zero. "Doesn't that slow down
execution by doing a useless addition?" they ask. No, the compiler is
clever enough to optimize that away. Cool, huh?

-- 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: 18 Feb 1997 18:27:55 -0500
From: Dean Pentcheff <dean@tbone.biol.sc.edu>
Subject: Re: [Q] Perl in win3.11?
Message-Id: <m1g1ytsnic.fsf@nauplius.psc.sc.edu>

ric@discoveryinternational.com (Ric Harwood) writes:
> I am just making my first foray into the joys of Perl.
> 
> Judging from the lack of posts perhaps it is herecy to run perl under
> windoze3.11, but as I have not yet moved up to NT it is what I am
> trying to do. [For construction purposes. When complete the program
> will run on a connected linux box.]
 ...
> -- 
> "Big whorls have little whorls that feed on their velocity, 
> and little whorls have lesser whorls and so on to viscosity."
>                                           -- L.F.Richardson

[As a biofluidmechanician, I heartily applaud your signature...]

Following is a repost of a posting I've reposted from a posting I
reposted from a posting of some time ago.  The key recommendation I'd
make is to make sure you get a Perl 5, not a Perl 4.  Perl 4 is
thoroughly obsolete and is not supported by any of the Perl Luminaries
in the Perl newsgroups.  

Besides, Perl 5 is more fun.

-Dean
-- 
N. Dean Pentcheff   <pentcheff@acm.org>   WWW: http://tbone.biol.sc.edu/~dean/
Biological Sciences, Univ. of South Carolina, Columbia SC 29208 (803-777-3936)
PGP ID=768/22A1A015 Keyprint=2D 53 87 53 72 4A F2 83  A0 BF CB C0 D1 0E 76 C0 
Get PGP keys and information with the command: "finger dean@tbone.biol.sc.edu"

==================================================================

I recently went through the exercise of hunting for a DOS/Win Perl,
needing to write a Perl program that would run on Unix, DOS 5, and
Windows 95/NT, and be distributable (along with Perl) with a minimum
of fuss.  

I settled on Ilya Zakharevich's OS/2 port of Perl.  Yup.  It will run
on DOS and Windows systems.  It's a very full Perl port that is
aggressively maintained and kept up to date.

You'll need to tinker slightly.  Following is an outline of a recipe
that worked for me.

Grab the port from CPAN.  Start at <URL:http://www.perl.com/perl> and
look for "Software", then "Alien Ports", then "CPAN/ports", and follow
links until you get to OS/2 ports, and then the "ilyaz" directory.
Once there, look for the most recent version in a directory that looks
something like "5.003.05" (of course, that number will change as
versions get updated).  Within that is a set of zip files.  Get these
files:

                perl_aou.zip
                perl_mlb.zip
                perl_pod.zip
                perl_ste.zip
                perl_utl.zip
                plREADME.zip

Make sure you have a decent unzip utility on DOS/Win.  One that works
is Info-Zip's, which you can grab from the "arcers" directory of the
MSDOS section of the Simtel archives at oak.oakland.edu
(<URL:http://oak.oakland.edu/pub/simtelnet/msdos/arcers/unz520x.exe>).
That file will unzip into multiple files, including a good DOS unzip
program.  The reason you need a good one is that you need to unzip
into a tree, and you need to properly truncate long filenames -- that
unzipper seems to do the job properly.

OK, now that you've got the code and an unzipper, do the following to
create a Perl hierarchy (the following manipulation gets done from a
DOS window, if you're under Windows):

        cd \
        mkdir perl
        mkdir perl\bin
        mkdir perl\lib
        mkdir perl\lib\pod

Now unpack the zip files into appropriate directories.  To do that,
change directories to the target directory first, then from there,
unzip the archive files as follows:

        perl
                plREADME.zip
        perl\bin
                perl_aou.zip
                perl_utl.zip
        perl\lib
                perl_mlb.zip
                perl_ste.zip
        perl\lib\pod
                perl_pod.zip

Put the following in your autoexec.bat (carefully noting the slash
directions in the text that follows):

        set path=...your...existing...path...;c:\perl\bin
        set perllib_prefix=f:/perllib c:/perl

(I assume your perl destination is drive "c:", otherwise modify the
"c:"s above appropriately, but don't change the "f:").

Now, based on addresses in Ilya's documentation, go out and grab the
latest versions of the "emxrt" package and the "rsx" package.  Unpack
them under a temporary directory.  Copy the following files to
c:\perl\bin:

        from the emx package:
                emx.exe      [VCPI DOS extender for DOS]
                emxfpemu     [coprocessor emulator for 386sx machines]
                emxbind.exe  [emx executable load-format twiddling program]
                emxl.exe     [emx stub loader module]
        from the rsx package:
                rsx.exe      [DPMI DOS extender for Windows]

Now drop out into DOS if you're running under Windows (not a DOS
shell: if you're in Windows, kill Windows and drop to plain DOS).

Go to the c:\perl\bin directory and use emxbind to extract the a.out
module from perl_.exe, something like:

        emx emxbind.exe -x perl_.exe perl.out

Use emxbind to bind the a.out module with the emxl.exe stub:

        emx emxbind.exe emxl.exe perl.out perl.exe

Assuming that worked, you can now delete the following files:

        emxbind.exe
        emxl.exe
        perl.out
        perl_.exe
        perl5_00.exe

If you're really twitchy about a startup warning message under
Windows, you can use a hex editor or other binary editor to edit the
file "rsx.exe" so that it will not complain about the emx version
you're using.  In the file "rsx.exe", search for the string
"emx_version".  You'll find the emx version number in reverse,
something like: "emx_version=b9.0" (which really refers to emx version
number 0.9b).  Change the version number/letter to fit the emxrt
version you downloaded (in my case, recently, I changed "b9.0" to
"c9.0", which defines me as really twitchy I suppose).  Save the new
rsx.exe (must be in the filename "rsx.exe").  Then the loadtime
warning about emx versions will shut up.

Reboot your machine to let the c:\autoexec.bat changes take effect.


What have you achieved by this?  The OS/2 version will run using
either the emx.exe DOS extender (using the VCPI protocol, suitable for
"naked" DOS) or the rsx.exe extender (using the DPMI protocol,
compatible with Windows 3.x, 95 (and NT?)).  The rigamarole with
emxbind pulled out the core executable and rebound it with a stub
loader that will automatically and transparently find and use the
emx.exe extender in plain DOS, and the rsx.exe extender under Windows
(as long as they're in a directory on the PATH).  Setting the
emxlib_prefix variable properly sets Perl's @INC list of where to
search for Perl libraries.

The "utility" programs in \perl\bin are set up as OS/2 "cmd" files.
You'll need to trim off the top few lines that get them to execute
under the OS/2 command interpreter.  There are magical incantations
you can do to turn them into automatically executing DOS batch files
(which I don't know), or you can create a batch file for each of them
(in the same directory) that looks something like the following (for
an example "utility.cmd" file):

@perl -S utility.cmd %1 %2 %3 %4 %5 %6 %7 %8 %9

in the file "\perl\bin\utility.bat".


And that's that!



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

Date: Wed, 19 Feb 1997 01:48:15 GMT
From: tporter@dtool.com (Thomas Porter, Ph.D.)
Subject: Any idea what's wrong w/ this script?????
Message-Id: <330c5bd2.5081759@news.one.net>


Trying to make a distributor locator script.  User enters from a
<select> drop-down.  Returns a page w/ distributor location.

Am I going about this the right way???  Sort of new to perl reg
expressions...

Thanks for any ideas...

#!/usr/bin/perl

# $RCSfile: changes,v $$Revision: 4.1 $$Date: 92/08/07 17:20:08 $
#CF & TP  

#Input String.
$in = $ENV{'QUERY_STRING'};

#Convert plus's to spaces.
$in[0] =~ s/\+/ /g;

# Split into key and value.  
($key, $val) = split(/=/,$in[0],2); # splits on the first =.

# Convert %XX from hex numbers to alphanumeric
$key =~ s/%(..)/pack("c",hex(0))/ge;
$val =~ s/%(..)/pack("c",hex(0))/ge;

# Associate key and value
$in{$key} .= "\0" if (defined($in{$key})); # \0 is the multiple
separator
$in{$key} .= $val;

#Begin select against database

open (inFILE, "dealer.src");
while (<$inFile>) {
@fields = ();
$findValue = $in{$key};
$findValue = uc ($findValue);
$checkField = 1;
while (<inFILE>) {
   chop;
   @fields = (@fields, split /:/, uc($_));
}

$count = scalar(@fields);

for ($i = $checkField-1; $i<=$count; $i=$i+4) {
   if (@fields[$i] eq $findValue) {
      print "@fields[$i],$findValue \n";
      break;
   }
   else {
#      print "Match not Found\n";
   }
}


# At this time:
# @fields[$i] == City
# @fields[$i+1] == Dealer
# @fields[$i+2] == Dealer's Address
# @fields[$i+3] == Dealer's Phone

#print "@fields[$i], @fields[$i+1], @fields[$i+2], @fields[$i+3]\n";

#Output results to browser

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

print<<"print_tag";
<html>
<head>
<title>LOCATOR</title>
</head>
<BODY BGCOLOR="#ffffff" >


 ...html

<FORM ACTION="../cgi-bin/locator.cgi"  METHOD="get">

</FORM>
</BODY>
</HTML>

print_tag

1; #return true



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

Date: Tue, 18 Feb 1997 20:47:57 -0600
From: Eryq <eryq@enteract.com>
To: tporter@dtool.com
Subject: Re: Any idea what's wrong w/ this script?????
Message-Id: <330A69DD.27D654A3@enteract.com>

Thomas Porter, Ph.D. wrote:
> 
> Trying to make a distributor locator script.  User enters from a
> <select> drop-down.  Returns a page w/ distributor location.
> 
> Am I going about this the right way???  Sort of new to perl reg
> expressions...

The right way would be to use CGI.pm or CGI_Lite.pm, instead 
of doing all the hard stuff yourself.  :-)

Good luck,
-- 
  ___  _ _ _   _  ___ _   Eryq (eryq@enteract.com)
 / _ \| '_| | | |/ _ ' /  Hughes STX, NASA/Goddard Space Flight Cntr.
|  __/| | | |_| | |_| |   http://www.mcs.net/~eryq
 \___||_|  \__, |\__, |__
           |___/    |___/ Make $$$ easy! Just hit shift, then 444!


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

Date: Tue, 18 Feb 1997 18:57:16 +0000
From: "fissio" <fissio@fission.com>
Subject: Breaking an @ down to individual fields
Message-Id: <fissio-1802971857160001@annex101.ridgecrest.ca.us>

I am using Selena's Database Search 2.0 which searches a pipe delimited data
file and returns is to the
user.  Right now the script spits out the data in a straight line of text
which doesn't look good in the browser.

What I would like to do is breakdown the "@row" and print out each field
indivdually so that I can add
html to each field.  The html will be different for some fields otherwise I
would just add html to the "search_results line.  Here is the area in
question:

----------------------------------------------------------------------
foreach $field (@row)
              {
         
              $search_results .= "<TR><TD>$field</TD></TR>";
              
              
            }
            $search_results .= "</TR>";
 ----------------------------------------------------------------------     
     

Any help would be appreciated on how to break this down to individual
fields.

Shane Vaughn
svaughn@rotors.com


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

Date: Wed, 19 Feb 1997 03:08:20 GMT
From: Tim Bunce <Tim.Bunce@ig.co.uk>
Subject: Re: Compile DBI
Message-Id: <E5ty1x.AqA@ig.co.uk>

In article <01bc133e$1d32cd60$7d64a8c0@OliverB.intern.online.neurotec.de>,
Oliver Belikan <ob@online.neurotec.de> wrote:
> HP-UX 10.10, ORACLE 7.3.2.1.0, PERL 5.003
> 
> by compiling DBI.c i receive error 1646 (illegal pointer combination) on
> line 966. 
> Whats the Problem ? 

The README explains how to report problems in a way that means I
get to read them at once rather than several weeks later.

Meanwhile, upgrade your DBI.

Tim.



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

Date: 19 Feb 1997 00:43:47 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Compiled Perl
Message-Id: <5edic3$6fr@news-central.tiac.net>

In article <VA.000000e0.13063c8c@trjp>,
Robert J Pankratz  <robert.pankratz@plexus.com> wrote:
>A long time ago I read about a hack that created a pre-tokenized 
>perl image that was similar to compiling a C program. We have
>a large web based perl application that gets call thousands of
>time a day and would like to avoid having it tokenized on every
>call. Could someone post the trick for doing this.

One trick you might like to use is the mod_perl module for the apache web
server which can stash an interpreted subroutine in memory and call it
without reloading & recompiling it after the initial compilation.  Check
out http://www.osf.org/~dougm/apache and http://www.apache.org

The module lets you do more than just run scripts, it allows you access to
the guts of apache from perl.

Hope this helps,

Mike


-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: 19 Feb 1997 00:25:15 GMT
From: jot.feb97@tmp.medtronic.com (Jot Powers)
Subject: Re: debugging perl & html
Message-Id: <5edh9b$1vo@gazette.medtronic.com>

In article <cuttE5tA4E.5vM@netcom.com>, cutt@netcom.com (Paul S. Cutt) writes:
>I wonder what people are using to debug perl scripts when called from an 
>html page ? I know about perl debugger but this is run from the command 
>line. If my html page calls my perl script how can I get the debugger at 
>that point to execute so I can continue debugging ?

We use Lincoln Stein's CGI module, which allows us to do debugging off the
command line and pass the parameters in like it was being called by a 
browser.

(In conjunction with that, we watch the log files of the server and see
why it is dying).

HTH

Jot "Only presidents, editors, and people with tapeworms have the right to
use the editorial 'we.' "  Powers  :)

-- 
Jot Powers  jot.feb97@tmp.medtronic.com
Unix System Administrator, Medtronic Micro-Rel
"Subtlety is the art of saying what you think and getting out of the way
before it is understood."




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

Date: Tue, 18 Feb 1997 16:28:38 -0700
From: Kelly Hall <hall@imall.com>
Subject: Re: debugging perl & html
Message-Id: <Pine.WNT.3.95.970218162524.152C-100000@boho.imall.com>

On Tue, 18 Feb 1997, Paul S. Cutt wrote:

> I wonder what people are using to debug perl scripts when called from an 
> html page ? I know about perl debugger but this is run from the command 
> line. If my html page calls my perl script how can I get the debugger at 
> that point to execute so I can continue debugging ?

I've got two ways I do it; one is lightweight and the other is
heavyweight.  Choose whichever suits your purpose.

a) print tons of debugging info to STDERR, which shows up in my httpd
server's error log; or, open up your own logging file and dump debug data
there.  This reminds me of code development in my early batch-processing
days.  Icky.

b) the interface you get from a CGI script is just a bunch of name/value
pairs.  So comment out your POST/GET header and load these values from the
command line or prompt for input, and then use the perl debugger from
there.  When your perl runs OK, switch back to the CGI-based invocation.

Hope this help,
Kelly
--
Kelly Hall               Lead Programmer
hall@imall.com         (rhymes with 'head')



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

Date: 18 Feb 1997 16:42:07 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Deleting files in perl
Message-Id: <5ecm4v$3q9@fridge-nf0.shore.net>

Boris Zemlyak (borisz@lsil.com) wrote:

: use:
: system("rm $file");
: but I don't want to use system for such trivial
: task.

Right.  You should look into using unlink() which is described in
Perl books, and the documentation included with your Perl distribution.
Good luck!

--
Nathan V. Patwardhan
nvp@shore.net
"What is your favorite color?
Blue ... I mean yellow ... aieeeee!
	--From the Holy Grail"


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

Date: 19 Feb 1997 00:52:05 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: doh! Strange socket problems...
Message-Id: <5edirl$71g@news-central.tiac.net>

In article <3309CD33.1A6E@brookes.ac.uk>,
Andrew J. Stewart <93272008@brookes.ac.uk> wrote:

>The FAQ says that to solve the Solaris "Protocol not supported" error, I
>should add:
>
>use Socket; 
>
>to my script, which I've done. However, I'm _still_ getting the same
>error. Does anyone know what could be causing this? I suspect that
>prehaps my env needs tweaking - but how?

You don't need to tweak your environment aprat from going over the .pl
library looking for hard coded constants.

Socket provides functions which return the right value for various
constants which used to be hard wired, for example in the "old" chat2.pl
library there's a section like this:

  else {
          # XXX hardwired $PF_INET, $SOCK_STREAM, 'tcp'
          # but who the heck would change these anyway? (:-)
          $pf_inet = 2;
          $sock_stream = 1;
          $tcp_proto = 6;
  }

Firing up perl 5.xxx in the debugger using perl -de 1 I can say:

  DB<1> use Socket

  DB<2> print PF_INET
2
  DB<3> print SOCK_STREAM
1
  DB<4> print join ', ', getprotobyname 'tcp'
tcp, TCP, 6


>Here's my script:
>
>#!/usr/bin/perl -w
>
>use Socket;
>
>require 'lchat.pl';

Look for a socket call in lchat.pl with the "wrong" constants coded into
it.

Hope this helps,

Mike


-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: 18 Feb 1997 21:50:15 -0500
From: Jesse Glick <jesse@ginger.sig.bsh.com>
Subject: Re: flock() Function Question
Message-Id: <4o7mk5mrvc.fsf@ginger.sig.bsh.com>


You're not running NFS are you? Just the first thing you should ask...

-- 
Jesse "Da Juice" Glick
mailto:jglick@sig.bsh.com
617-867-1017


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

Date: Tue, 18 Feb 1997 11:45:48 -0500
From: Ray Cromwell <ray@westlake.com>
To: Mazda Hewitt <Mazda.Hewitt@bbsrc.ac.uk>
Subject: Re: Interesting problem.
Message-Id: <3309DCBC.2EA8@westlake.com>

Mazda Hewitt wrote:
(problem of untangling a graph/flowchart so that there are no crossing
lines, or ugly stuff)

This sounds suspiciously like an NP-complete problem I saw before, in
which case, there's no perfect solution, but there probably is a
good one which will fail sometimes and look horribly bad for
some input.

-Ray


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

Date: Tue, 18 Feb 1997 13:58:56 -0600
From: Eryq <eryq@enteract.com>
Subject: Re: java.io.File.separator equivalent?
Message-Id: <330A0A00.399E9004@enteract.com>

Jeff Bauer wrote:
> 
> Apologies if this issue is addressed in the Perl FAQ or Camel book,
> but I didn't find it whilst skimming ...
> 
> In the interest of retaining environment neutrality, are there Perl5
> equivalents to Java's static  File.separator and File.pathSeparator
> variables?

Maybe.  What do they do?

-- 
  ___  _ _ _   _  ___ _   Eryq (eryq@enteract.com)
 / _ \| '_| | | |/ _ ' /  Hughes STX, NASA/Goddard Space Flight Cntr.
|  __/| | | |_| | |_| |   http://www.mcs.net/~eryq
 \___||_|  \__, |\__, |__
           |___/    |___/ Make $$$ easy! Just hit shift, then 444!


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

Date: Tue, 18 Feb 1997 17:39:35 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Login Script ?
Message-Id: <njede5.qr3.ln@localhost>

Shadow (Shadow@r56h108.res.gatech.edu) wrote:
: How do I use a cgi with htaccess to allow user registration, and validation

How you find out stuff about CGI is to ask in the CGI newsgroup!

comp.infosystems.www.authoring.cgi


Perl != CGI


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


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

Date: 18 Feb 1997 23:30:34 GMT
From: "Shadow" <Shadow@r56h108.res.gatech.edu>
Subject: Matt's Counter Archive
Message-Id: <01bc1524$c27cdc60$0f02000a@shadow>

I downloaded and configured http://www.worldwidemart.com 's Counter Cgi
program, and fly too ! And when I execute it in Telnet
it zaps the makings of a gif if you were to open one up in an editor, but
on The web when I go to my site to try to use it, it doesn't show.
 
-- 
shadow@full-moon.com 
http://128.61.56.108/~shadow/


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

Date: 18 Feb 1997 17:58:20 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: tadmc@flash.net (Tad McClellan)
Subject: Re: OK I know that I am a newbie But I need HELP!!
Message-Id: <8chgj91uj7.fsf@gadget.cscaper.com>

>>>>> "Tad" == Tad McClellan <tadmc@flash.net> writes:

Tad> Are you a cunning AI program for analysing cunning AI programs?

Tad> When will the recursion stop...

What?  Asking me to solve the halting problem now? :-)

Tad> (maybe when a lowly, uncunning, human, program interpreter such as myself
Tad>  butts in to the thread?)

Perhaps.

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 559 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Tue, 18 Feb 1997 11:13:03 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: OK I know that I am a newbie But I need HELP!!
Message-Id: <vunce5.ha2.ln@localhost>

Randal Schwartz (merlyn@stonehenge.com) wrote:
: >>>>> "Nathan" == Nathan V Patwardhan <nvp@shore.net> writes:

: Nathan> Mike Stok (mike@stok.co.uk) wrote:
: Nathan> : Are you a cunning AI program let loose by someone at MIT?

: Nathan> SYNTAX ERROR ON LINE 10.  :-)

: I presume you meant 10 binary.  Not 10 decimal. :-)


Are you a cunning AI program for analysing cunning AI programs?

When will the recursion stop...


(maybe when a lowly, uncunning, human, program interpreter such as myself
 butts in to the thread?)


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


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

Date: Tue, 18 Feb 1997 22:46:12 GMT
From: david.whitmarsh@dial.pipex.com (David Whitmarsh)
Subject: Re: on the fly graphs
Message-Id: <3309ae05.3579516@news.dial.pipex.com>

Martien Verbruggen <mgjv@comdyn.com.au> wrote:

Matt, and others,
>
>I actually already have a more or less working module that does this,
>tentatively called GIFgraph.pm, based on GD. I was planning on releasing
>it to the perl community, in exchange for all the help I got there, as
>soon as it was in a bit more representable form.
>


I, too would be interested in this package, though I'm not in any
great hurry.



David


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

Date: 18 Feb 1997 16:51:46 GMT
From: lee@fiji.procom.com (Lee Van Dyke)
Subject: Overloading perl object methods, Howto ?
Message-Id: <5ecmn2$ns3@news1.ni.net>

Can't find any info/examples on howto overload perl object methods
except for math functions. (I'll probably find it after I post :) )

Initially I would like to overload a method based on the number of
arguments, of which I can probably figure out.

However if there is any other info/examples except on overloading math
functions, please let me know.



TIA,


-- 
Lee Van Dyke            Senior Software Eng.    714-852-1000(voice)    
Procom Technology Inc.  lee@.procom.com         714-261-8572 (fax)
2181 Dupont Dr.         
Irvine, Ca 92715, USA   http://www.procom.com           


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

Date: Tue, 18 Feb 1997 11:55:16 +0000
From: Steve Shaffer <sshaffer@otginc.com>
Subject: Password script?
Message-Id: <330998A4.15DD@otginc.com>

I'm looking for a very secure password script to limit access to my
page, and all that I've found thus far seem a little open to attack( at
least that's what the authors say)  I'm working on a unix based system
now but I may be going to an NT server soon.....
Any hints as to where I could look?
											Thanks
													Steve Shaffer


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

Date: 19 Feb 1997 01:02:40 GMT
From: donr@cv.hp.com (Don Reid)
Subject: Re: PERL / OLE
Message-Id: <5edjfg$co9@hpcvca.cv.hp.com>

Brian Shepard (brian@shepmark.com) wrote:
: Does Perl come with OLE set up? or are there OLE extensions? 

: Where would I find the OLE extensions and is their a web site with info
: pertaining to this?

Win32 perl (www.activeware.com) has OLE built in.  See the documentation.


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

Date: Tue, 18 Feb 1997 19:15:02 -0800
From: John Matylonek <matylonj@ccmail.orst.edu>
Subject: perl 5.0 install problem
Message-Id: <330A7036.68F0@ccmail.orst.edu>

I've tried  

     sh Configure -des -Prefix=/gopher-nfs/perl/ -Uusenm

to create the config.sh file on my BSDI 486 machine

When the config.sh is created the Configure script warns
me about running as root with dot in path.

When I run "make" it gives 

pp_sys.c2602: warning: type mismatch with previous decl /usr/include/
dirent.h:101: warning: previous external decl of 'telldir' pp_sys.c:2602
: warning: local declartion of of 'telldir' doesn't match global one

and then hangs up on:

ranlib: libperl.a: Inappropriate file type or format

Is there anything I can do to remedy this within my newbie abilities?

I'd like to just find the binaries and load it directly.

John Matylonek
matylonj@ccmail.orst.edu


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

Date: 18 Feb 1997 19:27:37 GMT
From: pjscott@euclid.jpl.nasa.gov (Peter Scott)
Subject: Problems with -l
Message-Id: <5ecvr9$1hk@netline-fddi.jpl.nasa.gov>

I'm confused.  Maybe I don't understand the ramifications of -l.
Running the following script:

#!/usr/local/bin/perl -wnl
if (/,/)  {
    print "foo";
} else {
    print "bar";
}

produces:

euclid% echo "cat,dog" | /tmp/foo
bar,bar,euclid% 

Running it under the debugger gives:

Bad free() ignored at /usr/ets/lib/perl5/perl5db.pl line 890.
        DB::save called at /usr/ets/lib/perl5/perl5db.pl line 272
        DB::DB called at /tmp/foo line 0
Cmain::(/tmp/foo:0):    BEGIN { require 'perl5db.pl' };LINE: while (<>) {chomp;
  DB<1> n
main::(/tmp/foo:3):     if (/,/)  {
  DB<1> n
main::(/tmp/foo:4):         print "foo";
  DB<1> n
foo
euclid%

I give up.  Can someone make sense of this for me please?

Perl identity:
This is perl, version 5.003 with EMBED
        built under sunos at Oct  4 1996 10:44:46
        + suidperl security patch

-- 
This is news.  This is your      |  Peter Scott, NASA/JPL/Caltech
brain on news.  Any questions?   |  (Peter.J.Scott@jpl.nasa.gov)

Disclaimer:  These comments are the personal opinions of the author, and 
have not been adopted, authorized, ratified, or approved by JPL.


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

Date: 19 Feb 1997 01:28:45 GMT
From: jsd@cyborganic.com (Jon Drukman)
Subject: Re: PROGRAM: how to check for nice/valid email address
Message-Id: <5edl0d$1sg@its.hooked.net>

: To save you the trouble: you can't.  There is no way to check for the
: validity of an email address except by sending the mail and seeing if
: it gets there.  No way.

true, but there are many good reasons for wanting to at least make a
simple pass at the email address to insure that it's valid.

addresses like "luser@.domain.net" are not valid, but we get jokers
entering them every day on our web site.

my first thought on encountering this was to say "well, we'll just
email out a confirmation email and if we get it back then we go ahead
and process the request."  i was explicitly told NOT to do this by the
higher-ups.  i dunno what their thinking is, they just didn't want it
to work that way.  yeah, i know, i should get a better job or stage a
hunger protest until they change their mind...  oh well.

--jon


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

Date: 19 Feb 1997 01:03:03 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Q: how best to share a hash between packages
Message-Id: <5edjg7$81k@news-central.tiac.net>

In article <w10zpx29ckd.fsf@wombat.staff.ichange.com>,
nelson  <nmljn@wombat.staff.ichange.com> wrote:

>   sub func1 {
>       my($local_hash_ref) = shift;
>       my($local_hash) = %{ $local_hash_ref };
>       # Code
>   }
>
>   my(%globalhash) = {"one",1,"two",2};
>   func1(\%globalhash);

Possibly you meant something like:

  sub func1 {
    my $localHashRef = shift;
    my %localHash = %$localHashRef;

    # code
  }

  my %globalHash = (one => 1, two => 2);	# list initialiser
  my $globalHashRef = {one => 1, two => 2};	# {} anon hash constructor

  func1 \%globalHash;
  func1 $globalHashRef;

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: Tue, 18 Feb 1997 14:12:41 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Joseph June <jjune@midway.uchicago.edu>
Subject: Re: reduce length
Message-Id: <Pine.GSO.3.95q.970218141048.23287T-100000@julie.teleport.com>

On Tue, 18 Feb 1997, Joseph June wrote:

> how do i reduce how many digits a variable will display... 

> i thought truncate was the way to do it...
> 
> truncate(some variable, 6)
> 
> but doesn't seems to be working...

Eek! This is as good a reason as any I've seen to read the documentation
for a new function before you try using it. :-)  See perlfunc(1) for
sprintf and truncate. You may also want to see what your system
documentation has on sprintf. 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: 18 Feb 1997 20:25:18 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Regis McEwen <regism@bedford.progress.com>
Subject: Re: regexp's in XEmacs vs. Perl
Message-Id: <8c914l8okh.fsf@gadget.cscaper.com>

>>>>> "Regis" == Regis McEwen <regism@bedford.progress.com> writes:

Regis> Randal Schwartz <merlyn@stonehenge.com> writes:
>> >>>>> "C" == C Matthew Curtin <cmcurtin@research.megasoft.com> writes:

Regis> [...]

>> Now if I could just figure out how to handle "talk", I'd never even
>> leave my emacs for the entire session!

Regis> 	Then try ETalk by Eric Ludlam:

Regis> 		ftp.ultranet.com:/pub/zappo/etalk-0.11.a7.tar.gz


No.  I didn't want to know this.  I *really* didn't want to know this. :-)

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: 19 Feb 1997 02:16:33 GMT
From: showalte@shentel.net.nospam (Remove .nospam to e-mail me)
Subject: Re: Searching for Perl-supported Linux database
Message-Id: <slrn5gkok1.2b8.root@krioni.shentel.net>

In article <33079D5E.17160D8A@ixlabs.com>, Chris Schoenfeld wrote:
>I'm in the market for a database with the following features:
>
>1. Native Linux and Spac Solaris support (i.e. share binary db's).
>2. A thoroughly tested Perl 5 module interface.
>3. Speedy, for CGI work.
>4. Either commercial or well-supported PD.
>5. Native file/record locking.

You could check out mySQL.  It's based on mSQL, but has more features.  You
can get a Perl module that works with it, and it also has a 32-bit ODBC
interface available.  The URL is http://www.tcx.se if you want to take a
look at it.

--------------------
Brian R. Showalter
showalte@shentel.net.nospam (Remove .nospam to e-mail me)



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

Date: 18 Feb 1997 18:07:43 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Michael George Schwern <stupid+@andrew.cmu.edu>
Subject: Re: Set operations (union, intersection, etc...)
Message-Id: <8cened1u3k.fsf@gadget.cscaper.com>

>>>>> "Michael" == Michael George Schwern <stupid+@andrew.cmu.edu> writes:

Michael> Is it just me, or are there no functions for set operations
Michael> in Perl?  Just for something simple, like finding the
Michael> intersection or union of two sets (ie. lists).  I couldn't
Michael> find anything in CPAN either.  Am I missing something?

Michael> Anyhow, in the Perl tradition, I wrote my own... but I'd like
Michael> to know if I'm wasting my time before I go through the
Michael> trouble of spiffing it up, and packaging it, a'nat.  (like
Michael> noticing Text::ParseWords after writting my own parser.)

Hmm.  Let's see....

gadget>> perl -MCPAN -eshell
Signal handler set.

cpan shell -- CPAN exploration and modules installation (v1.21)
Readline support enabled

cpan> wq set intersection
Searching for 'set intersection'
query returnes 39 hits, 10 hits follow
 1 5.848 Set::IntegerRange - Sets of Integers Easy manipulation of sets of integers (arbitrary intervals) 
 2 5.827 Set::IntegerRange - Sets of Integers Easy manipulation of sets of integers (arbitrary intervals) 
 3 5.827 Set::IntegerRange - Sets of Integers Easy manipulation of sets of integers (arbitrary intervals) 
 4 5.704 Math::MatrixBool - Matrix of Booleans Easy manipulation of matrices of booleans (Boolean Algebra) 
 5 5.362 Set::IntegerFast - Sets of Integers Easy and efficient manipulation of sets of integers (intervals from zero to some positive integer) 
 6 5.268 Set::IntegerFast - Sets of Integers Easy and efficient manipulation of sets of integers (intervals from zero to some positive integer) 
 7 5.268 Set::IntegerFast - Sets of Integers Easy and efficient manipulation of sets of integers (intervals from zero to some positive integer) 
 8 5.127 Set::Scalar - the basic set operations for Perl scalar/reference data 
 9 4.401 Math::MatrixReal - Matrix of Reals Implements the data type "matrix of reals" (and consequently also "vector of reals") 
10 4.401 Date::DateCalc - Date Calculations in compliance with ISO/R 2015-1971 and DIN 1355 standards 
Type 'wr <number>' or 'wd <number>' to examine the results

cpan> i Set::Scalar
Module id = Set::Scalar
    DESCRIPTION  Set of scalars (inc references)
    CPAN_USERID  JHI (Jarkko Hietaniemi)
    CPAN_FILE    JHI/Set-Scalar-0_003.tar.gz
    DSLI_STATUS  adpO (alpha,developer,perl,object-oriented)
    INST_FILE    (not installed)

cpan> i Set::IntegerFast
Module id = Set::IntegerFast
    DESCRIPTION  Set of integers (algorithmical computations)
    CPAN_USERID  STBEY (Steffen Beyer)
    CPAN_VERSION 3.0
    CPAN_FILE    STBEY/Set-IntegerFast-3.2.tar.gz
    DSLI_STATUS  RdcO (released,developer,C,object-oriented)
    MANPAGE      Set::IntegerFast - Sets of Integers Easy and efficient manipulation of sets of integers (intervals from zero to some positive integer)
    INST_FILE    /home/merlyn/lib/perl5/site_perl/Set/IntegerFast.pm
    INST_VERSION 3.0

cpan> 

Moral: get CPAN.pm and install it.  Then ask it to install CPAN::WAIT.
Then restart CPAN.pm.

Life will be *much* simpler after that.  Thanks guys, for some wonderful
work out there.

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 559 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Tue, 18 Feb 1997 22:21:48 -0500
From: Anne Hilllebrand <annehillebrand@worldnet.att.net>
Subject: Re: transliteration library
Message-Id: <330A71CC.EAA@worldnet.att.net>

Stijn van Dongen wrote:
> 
> Hi,
> 
>         Recently I have written a perl 5 library, which for example
>  allows one to search for different transliterations corresponding with
>  the same source string.
>  ______________________________________________
>  There is no interface, only some documentation. If you want to
> experiment
>  with it, you have to invest time and *know perl 5*. If you want to have
>  very specific tools, you have to build them yourself. However, the
>  basic parsing tools (and more) have all been written.
> 
>  In principle one can define both the source alphabet and the target
>  alphabet to be any collections of strings. For each source morpheme
>  and for each transliteration system, one or several rewrite rules
> mapping
>  the source morpheme to a target morpheme may be defined. A rewrite rule
>  is labeled with the system or systems from which it is derived.
>  Example for cyrillic-latin transliteration:
> 
> # 27 character:
> 
>         ':s' => {       Eng => { 1 => 'shch'},
>                         Fr  => { 1 => 'chtch'},
>                         Ger => { 1 => 'schtsch'},
>                         Hol => { 1 => 'sjtsj'},
>         }
> 
> # 6 character:
> 
>         e =>    {       Eng => { 1 => 'e', 2 => 'ye' },
>                         Fr  => { 1 => 'e',},
>                         Ger => { 1 => 'je', 2 => 'e' },
>                         Hol => { 1 => 'je', 2 => 'e', 3 => 'jo' },
>         }
> 
> # suffix:
> 
>         'i-n-$' => {    Sufx  => { 1 => 'ine', 2 => 'ien'}
>         },
> 
>  When supplied with a list of source strings in source notation
>  and a list of target strings, it is possible to search for relations:
> 
> [l-o-b-a-x-;e-v-s-k-i-j]                # source string
>         [l|o|b|a|x|;e|v|s|k|i-j-$]      # source parse
>                 [Lobachevski]           # target string, parse omitted
> here.
>                 [Lobachevsky]
>         [l|o|b|a|x|;e|v|s|k|i|j]
>                 [Lobachevskii]
>                 [Lobachevskij]
> [x-i-n-;c-i-n]
>         [x|i|n|;c|i-n-$]
>                 [Chintchine]
>                 [Khinchine]
>                 [Khintchine]
>         [x|i|n|;c|i|n]
>                 [Chin\v{c}in]
>                 [Chintchin]
>                 [Chintschin]
>                 [Hin\v{c}in]
>                 [Hincin]
>                 [Khinchin]
>                 [Khintchin]
> 
>  It is also possible to list the language scores with a given
> source-target
>  pair, based on weights associated with the source morphemes which have
> to be
>  supplied by the user:
>         chebyshev
>                 Eng     9
>                 Fr      3
>                 Hol     3
>                 Ger     1
>         tchebycheff
>                 Fr      9
>                 Eng     1
>                 Ger     1
>                 Hol     1
>         tschebyschef
>                 Ger     7
>                 Spell   2
>                 Eng     1
>                 Fr      1
>                 Hol     1
>         tchebyshev
>                 Eng     6
>                 Fr      6
>                 Hol     3
>                 Ger     1
>         tschebychef
>                 Fr      4
>                 Ger     4
>                 Spell   2
>                 Eng     1
>                 Hol     1
> 
>  If you are interested, you can follow up on this (but do not
>  cross-post), mail me at stijnvd@cwi.nl, or grab a tarred bundle of
>  files from http://www.cwi.nl/ftp/stijnvd/, file TRANSLITERATION.tar.uu
> 
>         Kind regards,
> 
>                 Stijn van Dongen

Wul, buddy - here in thuh South we'd be apt to say you muss have a lotta
time onyer hans to be doin sumpthin like that! Gudluck!


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

Date: Tue, 18 Feb 1997 17:53:28 +0000
From: Douglas SEAY <seay@absyss.fr>
To: ryan@www.puli.com.tw
Subject: Re: Why can i run Perl in Linux?
Message-Id: <3309EC98.2167@absyss.fr>

ryan wrote:
> 
> Hi:
>         I miss a trouble about My Perl Program can't run in linux.
> I must place Perl command before my Perl Program ex: Perl myprogram.pl.
> I Can't derictly run myprogram.pl.I alreadly add a prfix symbol "#!"in
> the header of my perl progarm.How can I do for this problem?
> 
>                                                         Ryan Huang
>                                                         Taiwan Puli

"#!" just says the next characters will be the path
of the interpreter.  you should have something like

#!/usr/bin/perl		<<-- RH 4.0 uses this
#!/usr/local/bin/perl
#!/opt/bin/perl

or whatever happens to be the absolute path to your
perl executable.  in addition, your script needs to
be readable and executeable (chmod u+rx my_script)
and your perl binary should be executable.

If this isn't enough, post again with the complete
error message that you get when you try to launch
your script.

-- doug seay
seay@absyss.fr


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

Date: 18 Feb 1997 09:44:23 -0500
From: Jim Anderson <jander@jander.com>
Subject: Re: Why can i run Perl in Linux?
Message-Id: <914m6uns.fsf@jander.com>

ryan <ryan@www.puli.com.tw> writes:

> 
> Hi:
> 	I miss a trouble about My Perl Program can't run in linux.
> I must place Perl command before my Perl Program ex: Perl myprogram.pl.
> I Can't derictly run myprogram.pl.I alreadly add a prfix symbol "#!"in
> the header of my perl progarm.How can I do for this problem?

First you nee to know where perl resides on your system.  Issue this
command:

	which perl

That should give you the correct pathname.

Suppose, for example, that 'which perl' returns '/usr/bin/perl'. Then
make the following the first line in your script:

#!/usr/bin/perl

-- 
Jim Anderson			jander@jander.com
PGP Public Key Fingerprint:	0A 1C BB 0A 65 E4 0F CD
				4C 40 B1 0A 9A 32 68 44


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

Date: 8 Jan 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Jan 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.

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 V7 Issue 970
*************************************

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