[6566] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 191 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Mar 27 13:13:53 1997

Date: Thu, 27 Mar 97 10:00:25 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 27 Mar 1997     Volume: 8 Number: 191

Today's topics:
     Re: [Q] Newbie problem with system() call <rootbeer@teleport.com>
     Bidirectional communication <ftm@math.ucr.edu>
     Re: CGI Perl: How to get FORM name?? (Michael Fuhr)
     Re: CGI Perl: How to get FORM name?? (Brian L. Matthews)
     Compilation problem on sco box <jfemister@acm.org>
     Re: Correct usage of UMASK <rootbeer@teleport.com>
     Re: Coverting Objects to packed strings.. how? <tchrist@mox.perl.com>
     Re: DES implementation <rootbeer@teleport.com>
     File Locking <rdschramm@scripps.com>
     Re: Free web-server (Jason Bodnar)
     Re: getting year from localtime <rootbeer@teleport.com>
     Help - Calling C functions from Perl (Win32) <Chris_Hill@mentorg.com>
     Re: Little beginers question <rdschramm@scripps.com>
     LWP:UserAgent hangs at runtime on NT <balkwill@viennasys.com>
     Re: MD5/LWP <rootbeer@teleport.com>
     Need help with basic database manipulation bartels@a1.western.tec.wi.us
     Re: Newbie asks how do I format a numeric output? <flg@vhojd.skovde.se>
     Re: ODBC package problem <joneil@is.ssd.k12.wa.us>
     Re: Operating System Variable? <tchrist@mox.perl.com>
     Parsing file problem ab20@tntvax.ntrs.com
     Re: Perl, Delphi, Linux, Windows, and databases (VB5E?) mpeppler@mbay.net
     perl5 for sgi irix4.0.5?? db@sgx.neep.wisc.edu
     pre-Alpha copies of IO::Scalar/IO::ScalarArray availabl <eryq@enteract.com>
     Re: q (Jason Bodnar)
     Re: Smarter indexing algorythm <seay@absyss.fr>
     Software602, Inc. <jmorgan@software602.com>
     Re: Suid set - System calls <rootbeer@teleport.com>
     Re: Symlink Directories (Nathan V. Patwardhan)
     Re: Symlink Directories <rootbeer@teleport.com>
     Re: trivial perl question from an ignoramus (Tad McClellan)
     Re: Unix and ease of use  (WAS: Who makes more ...) (Kaz Kylheku)
     Re: Unpacking .gz file <rootbeer@teleport.com>
     Using an "@" in a perl format <jqw4@psu.edu>
     Re: Using an "@" in a perl format (Eric Bohlman)
     Re: Using an "@" in a perl format (Jon Bell)
     Re: Using an "@" in a perl format (Eric Bohlman)
     Re: Who makes more $$ - Windows vs. Unix programmers? <jimcor@corder.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Thu, 27 Mar 1997 09:00:28 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: brian.howell@symbios.com
Subject: Re: [Q] Newbie problem with system() call
Message-Id: <Pine.GSO.3.96.970327085837.13866L-100000@kelly.teleport.com>

On Wed, 26 Mar 1997 brian.howell@symbios.com wrote:

> 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.

If you're on a Unix system, your system calls must contain Unix commands. 
Or am I misunderstanding you? 

-- 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 09:46:48 -0800
From: Fred Metcalf <ftm@math.ucr.edu>
Subject: Bidirectional communication
Message-Id: <33396108.3EC6@math.ucr.edu>

As an occasional Perl user, I have now run into the "Bidirectional
Communication" problem (p. 344 of the 2nd ed. - Programming
Perl).

I would like to pass the value of a variable to an external
filter and have the output land in another variable.  There
are two solutions suggested in PP: IPC::Open2 and Comm.pl.
Neither of these works - IPC because of a hangup, and Comm.pl
because of a lack of pseudo-ttys (I would like the code to
be mostly machine-independent).  At the moment I'm just using
a temporary file, which is not an "elegant" solution.

If anyone has a better solution to this, I'd appreciate
hearing about it.

What is really required, it seems to me, is an extension of
the open command to:

open IN_HANDLE, "| filter ... |", OUT_HANDLE

An example of this would be to format a chunk of text using
"fmt" as a filter.

Thanks in advance for any help.

Fred Metcalf


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

Date: 27 Mar 1997 09:32:18 -0700
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: CGI Perl: How to get FORM name??
Message-Id: <5he7ei$c1h@nova.dimensional.com>

    [ cc to author ]
jete@dgs.dgsys.com (Jete Software Inc.) writes:

>I apoligize if this is more of an CGI question than perl.
>
>In the HTML code:
>
>	<FORM NAME="name" ACTION="action" METHOD="POST">
>
>How can I later access this form name ?? Is it available as an environmental
>variable??

What variant of HTML are you using?  The HTML 3.2 Reference
Specification[1] defines only ACTION, METHOD, and ENCTYPE.

[1] http://www.w3.org/pub/WWW/TR/REC-html32.html#form

-- 
Michael Fuhr
http://www.dimensional.com/~mfuhr/


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

Date: 27 Mar 1997 09:28:09 -0800
From: blm@halcyon.com (Brian L. Matthews)
Subject: Re: CGI Perl: How to get FORM name??
Message-Id: <5hean9$hla$1@halcyon.com>

In article <5hbiqo$qdf@DGS.dgsys.com>,
Jete Software Inc. <jete@dgs.dgsys.com> wrote:
|I apoligize if this is more of an CGI question than perl.

It actually has nothing to do with perl. And you wouldn't have to
apologize if you'd posted to the right group in the first place.

|	<FORM NAME="name" ACTION="action" METHOD="POST">

Being NAME isn't a valid attribute of the FORM tag, there probably
isn't any way to get it. See http://www.w3.org for more info and
try reposting in one of the comp.infosystems.www.* newsgroups.

Brian
-- 
Brian L. Matthews				Illustration Works, Inc.
	For top quality, stock commercial illustration, visit:
		  http://www.halcyon.com/artstock


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

Date: 27 Mar 1997 15:19:35 GMT
From: "Jim Femister" <jfemister@acm.org>
Subject: Compilation problem on sco box
Message-Id: <01bc3ac2$7880baa0$401eaacc@jfemister.enter.net>

I am getting the following output when trying to make perl5.003 for SCO:

        cc  -L/usr/local/lib -o miniperl miniperlmain.o libperl.a -ldbm.nfs
-lin
tl -lsocket -lnsl_s -lndbm -lld -lm -lc -lPW -lx
undefined                       first referenced
 symbol                             in file
Perl_chsize                         libperl.a
ld fatal: Symbol referencing errors. No output written to miniperl
*** Error code 13           

Things seem to run smoothly until this attempt to compile "miniperl".
Any suggestions?

Thanks,
Jim

jfemister@acm.org



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

Date: Thu, 27 Mar 1997 09:05:14 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Geoffrey Hebert <soccer@microserve.net>
Subject: Re: Correct usage of UMASK
Message-Id: <Pine.GSO.3.96.970327090400.13866M-100000@kelly.teleport.com>

On Thu, 27 Mar 1997, Geoffrey Hebert wrote:

> I do an umask 000;
> Before an open for write in a cgi script operating from the web.
> 
> Should I immediately do an umask 022?
> 
> Or forget it, as it is reset when leaving my script.

Your process can't change the parent process's umask, so there's no need
to reset it. (Of course, if your process is going to do something more, it
may need to be set differently within the process. But that's a whole
other thing.) 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: 27 Mar 1997 15:06:20 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Coverting Objects to packed strings.. how?
Message-Id: <5he2dc$pqd$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    sean@ugcs.caltech.edu (M. Sean Bennett) writes:
: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?

>From the FAQ:

Q: How do I keep persistent data across program calls?

    For some specific applications, you can use one of the DBM
    modules. See the AnyDBM_File manpage. More generically, you should
    consult the FreezeThaw, Storable, or Class::Eroot modules from CPAN.

Q: How do I print out or copy a recursive data structure?

    The Data::Dumper module on CPAN is nice for printing out data
    structures, and FreezeThaw for copying them. For example:

	use FreezeThaw qw(freeze thaw);
	$new = thaw freeze $old;

    Where $old can be (a reference to) any kind of data structure you'd
    like. It will be deeply copied.

I suspect that any of these would work for you.

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

"If Dennis Ritchie were the man who developed Modula-2 then C would be long forgotten."
    --Tarjei Jensen


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

Date: Thu, 27 Mar 1997 08:54:10 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Peter Cox <pcox@unix2.megsinet.net>
Subject: Re: DES implementation
Message-Id: <Pine.GSO.3.96.970327085337.13866K-100000@kelly.teleport.com>

On 26 Mar 1997, Peter Cox wrote:

> I'm looking for an implementation of DES in perl5. 

Have you looked on CPAN? Hope this helps!

    http://www.perl.org/CPAN/
    http://www.perl.com/CPAN/

-- 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 15:09:09 GMT
From: "Rich Schramm" <rdschramm@scripps.com>
Subject: File Locking
Message-Id: <01bc3ab8$f4457f40$3d8865ce@cnpc142>

Hello,

I am concerned about blocked processes attempting to write to my file after
I unlock it but before I close it.

For example, I open the file, lock the filehandle exclusive, write to the
file, unlock the filehandle, then close the file.

Is it possible that blocked processes will either do an open on the file
immediately after I unlock it but before it is closed?  And what will keep
two or more blocked processes from doing opens before any of them have time
to do a lock?

Is there anyway to tell the open function to lock exclusive and the close
function to unlock?  Do I have to worry about this at all if I lock and
unlock immediately after the open and before the close?

Thanks,

Rich
rdschramm@scripps.com


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

Date: Thu, 27 Mar 1997 15:54:15 GMT
From: jason@cimedia.com (Jason Bodnar)
Subject: Re: Free web-server
Message-Id: <333a980b.259473267@news.onr.com>

shyde@poboxes.com (Simon Hyde (aka Jeckyll)) wrote:

>On 26 Mar 1997 12:43:29 GMT, oaf@vingmed.no (Ole Asbjorn Fadum) wrote:
>
>>
>>-- 
>>
>>As a long term perl user on UNIX, I've started the move toward
>>Windows. I'm very pleased that perl is available on the PC, and
>>I've a project where I'm going to make some CGI programming on
>>the PC.
>>
>>I would like to have a tip of free available web server, which
>>run Windows95, and easily could interface to perl CGI.
>>
>>Any suggestion??
>>
>
>I've found fnord (http://shampoo.res.wpi.edu/fnord) to be pretty good.
>You might want to try OmniHTTPD
>(http://www.fas.harvard.edu/~glau/httpd/) although IMHO this isn't as
>good as fnord yet.

Isn't there a port of NCSA httpd to Win95? If so, that should work
just fine.


-- 
Jason C. Bodnar
jasonb@onr.com
Internet Programmer
Cox Interactive Media


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

Date: Thu, 27 Mar 1997 08:51:32 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Alex Mak <amak@ernie.eecs.uic.edu>
Subject: Re: getting year from localtime
Message-Id: <Pine.GSO.3.96.970327084904.13866I-100000@kelly.teleport.com>

On Wed, 26 Mar 1997, Alex Mak wrote:

> I am interested in getting the year in localtime.

Can you tell us in what way the documentation for localtime was unable to
give you this answer? Thanks!

-- 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: Thu, 27 Mar 1997 15:42:44 +0000
From: Chris Hill <Chris_Hill@mentorg.com>
Subject: Help - Calling C functions from Perl (Win32)
Message-Id: <333A9574.6961@mentorg.com>

I have been trying to put together a small example which 
shows how to call C code from perl.  On unix this was no
problem - just follow the documentation...  

on WinNT I am using the ActiveWare 5.003 port.  It just doesn't seem
to have any of the necessary pieces... other than some
win32 specific documentation on how to do it.  Agghhhhhhh

Can anyone point me in the right direction?

:) Chris.


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

Date: 27 Mar 1997 14:56:24 GMT
From: "Rich Schramm" <rdschramm@scripps.com>
Subject: Re: Little beginers question
Message-Id: <01bc3ab7$2c57f7c0$3d8865ce@cnpc142>

I didn't see a reply yet so:

> 
> How can I retrieve the current directory where I am ('chdir' is only use
to
> change it ?)

Use the readdir() function.  You will have to do an opendir to get a
filehandle for the directory.

> How can I know the number of elements in a table. I try $len=@array but
it
> don't seems to work well.

$#array is a variable that tells you how many elements are in the @array

> With the regular expression $body=~/xxx/ we can know if the expression
xxx
> is contained in $body, how can I know the number of times, and the
location
> to retrieve a part of the string ?

Use the index function. 

You can look up these functions in a perl manual (if you don't have one,
you should get one).  You can also check out http://www.perl.com/perl/ for
links to online documentation.

Regards,

Rich


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

Date: Thu, 27 Mar 1997 11:21:07 -0500
From: Jim Balkwill <balkwill@viennasys.com>
Subject: LWP:UserAgent hangs at runtime on NT
Message-Id: <333A9E73.2BC8@viennasys.com>

The following code fails with the error "Error: runtime exception" in
the LWP::IO::write call to select() at line 74:

  my $ua = new LWP::UserAgent(use_alarm => 0);
  my $req = new HTTP::Request('GET', 'http://www.intel.com/');
  my $rsp = $ua->request($req);  #fails here

I am using:
	ActiveWare Perl 5003, build 303
	CPAN module libwww 5.07

Note: I was unable to make libwww. To work around resulting lack of the
auto load files, I removed the __END__'s from the necessary modules.
Then I found that alarm() is not supported in this version of perl so I
commented out the alarm() calls and created my user agent with use_alarm
set to false.
-- 
Jim Balkwill
mailto:balkwill@viennasys.com
phone://613-599-3600x4576
fax://613-591-9973

-- 
Jim Balkwill
mailto:balkwill@viennasys.com
phone://613-599-3600x4576
fax://613-591-9973


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

Date: Thu, 27 Mar 1997 08:53:02 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Zaheed Haque <zaheed.haque@ein.ericsson.se>
Subject: Re: MD5/LWP
Message-Id: <Pine.GSO.3.96.970327085228.13866J-100000@kelly.teleport.com>

On Wed, 26 Mar 1997, Zaheed Haque wrote:

> Sorry for this beginners questions.. I was wondering If anyone
> one would be kind enough to tell me where can I download The 
> following CPAN Perl libraries for Windows NT..

Have you tried CPAN? :-)

    http://www.perl.com/CPAN/

-- 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: Thu, 27 Mar 97 09:08:33 +600
From: bartels@a1.western.tec.wi.us
Subject: Need help with basic database manipulation
Message-Id: <5he2hk$soa@defcon.western.tec.wi.us>
Keywords: dbm

I have the following bit of script. ("scriptlet"?) I don't understand all the
things I need to do to do some simple database manipulation.

Anyway, the "if" command is always returning false. What I want to do is
simple, look in the database file, and see if the proper record is there, if it
is, then assign the value to the variable. If not, create a record. Next, test
if the value is too high. If it is, do some more stuff.

Can anybody help? I'm sure I'm just not doing some testing correctly.


        # Test Data Record
        $numkey = $User . "_num";
        $datekey = $User . "_date";
        dbmopen(%DATAFILE,"/usr/local/records/database",644);
        if (defined $DATAFILE{$numkey}) {
                $num_records = $DATAFILE{$numkey};
                print "num records is defined.\n";
                }
        else    {
                print "num records is not defined.\n";
                $num_records = 0;
                $DATAFILE{$numkey} = 0;
                $DATAFILE{$datekey} = $date;
        }
        if ($num_records > 5) {
                print "num records is greater than 5.\n";
                $DATAFILE{$numkey} = $num_records + 1;
                $DATAFILE{$datekey} = $date;
        }
        dbmclose(%DATAFILE);



Thanks in advance,

Lyndon F. Bartels
bartels@a1.western.tec.wi.us


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

Date: 27 Mar 97 16:57:40 GMT
From: "Fredrik Lindberg" <flg@vhojd.skovde.se>
Subject: Re: Newbie asks how do I format a numeric output?
Message-Id: <01bc3acf$fce468c0$e20f10c2@odens.di.vhojd.skovde.se>

> >Russ <russ@hevacomp.demon.co.uk> wrote 
> I'm sure the solution to this is very simple but I can't find out how to
> format the result of a calculation.   I using a perl script to multiply
say
> 7.99 by 2 and I am getting a result of  15.980000000000000426.   How can
I
> limit this to 2 decimal places?

With the printf or sprintf function. 

Together with a "format string" you tell (s)printf how to format
the output. 

E g:

printf("Value is %10.2f\n", $MyValue);

The character % signals the beginning of a format.
The number 10 says we need 10 character position in width
 .2 says that we want 2 decimals (still within the 10 character
width).
f says its a floating value

After the format string we need to supply every value
specified through a formatspecifier in the format string. In my
example there were only one (%10.2f) so I only have one
variable after the string. 

Did that make any sense?

Here are some more examples:

# Print blank padded strings (20 and 40 characters wide)
# Longer strings are _not_ truncated

printf("%20s %40s\n", $Name, $Email);

# Print integers, first one left justified, 30 chars wide
printf ("%-30d", $Points);

# This one right justified 30 chars wide
printf("%30d", $Points);

# Print floating point number with 3 decimals
printf("%.3f", $Floating);

hope this helps

/Fredrik



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

Date: Thu, 27 Mar 1997 07:51:09 -0800
From: Jerome O'Neil <joneil@is.ssd.k12.wa.us>
To: billc@tibinc.com
Subject: Re: ODBC package problem
Message-Id: <333A976D.3119@is.ssd.k12.wa.us>

Bill Cowan repeated:
> 
> In addition, be sure to check the result status for $Data = new
> Win32::ODBC... 
After I said:
> > Your $Data object isn't being initialized for some reason or another.

Which is essentialy the same thing.  Thanks for the verification.  We
knew the status of the new call because Donovan told us:

> > > I get the error:
> > >
> > > Can't call method "Catalog" without a package or object reference at
> > > line 3.

The package or object reference that isn't there is the $Data scalar
that he tried to reference in

> > ($qualifier, $owner, $name, $type) = $Data->Catalog("", "", "%","'TABLE'");, 

so we knew it failed.

> and use Win32::ODBC::Error() to display any database
> error messages.

This would require a my($error) = $Data->Error();,  and as we previously
discussed, $Data isn't there.

As it turns out, the problem was a missing semi-colon in the ODBC
connect string, I beleive.

Ahhh... the joys of debugging...

Jerome


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

Date: 27 Mar 1997 15:00:17 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Operating System Variable?
Message-Id: <5he221$oer$2@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    deb@marinbridge.com writes:
:I've looked through the Camel book but couldn't find it. A co-worker
:told me to use $^O or $OSNAME but that didn't work.

Why didn't $^O work?

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

    I dunno, I dream in Perl sometimes...
                    --Larry Wall in  <8538@jpl-devvax.JPL.NASA.GOV>


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

Date: Thu, 27 Mar 97 17:34:00 GMT
From: ab20@tntvax.ntrs.com
Subject: Parsing file problem
Message-Id: <1997Mar27.112742.6271@news.ntrs.com>

I have a file with the following record:

|1997-02-13 00:00:00:000|N|NULL |NULL   |XYZ |NULL|JKL   |NULL      |123 

My output should look like this:

|1997-02-13 00:00:00:000|N|||XYZ ||JKL   ||123 

Basically I'm just stripping the word "NULL" and any trailing spaces before 
the next delimiter "|".  Is there a way using awk or perl to accomplish this?


thanks in advance.... 


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

Date: Thu, 27 Mar 1997 11:51:13 -0600
From: mpeppler@mbay.net
Subject: Re: Perl, Delphi, Linux, Windows, and databases (VB5E?)
Message-Id: <859484635.3016@dejanews.com>

In article <3339D40F.2307@tibinc.com>,
  billc@tibinc.com wrote:
>
> 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.

Sybase does have a version of Client Library available for Linux, as
freeware.

>
> 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.

Sybperl has been ported to NT (see ftp://ftp.name.net/pub/sybperl or
http://www.mbay.net/~mpeppler)

Michael

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


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

Date: 27 Mar 1997 17:33:34 GMT
From: db@sgx.neep.wisc.edu
Subject: perl5 for sgi irix4.0.5??
Message-Id: <DB.97Mar27113334@sgx.neep.wisc.edu>

I don't have compilers on my Indigo irix 4.0.5 machine.

Does anyone have an inst-able (or tardist) version of perl5
they could point me to??


thanks,

dennis


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

Date: 27 Mar 1997 15:28:00 GMT
From: Eryq <eryq@enteract.com>
Subject: pre-Alpha copies of IO::Scalar/IO::ScalarArray available
Message-Id: <5he3m0$fgb$1@nadine.teleport.com>

These are proposed modules to allow you to perform standard
IO::Handle operations on scalars (IO::Scalar) and arrays of
scalars (IO::ScalarArray).  That is, you can print to them,
read from them, use getline/getlines, seek/tell, etc. 

Current implementations are bare minimum, and missing some
functionality: at this point, I'm looking for comments.
Especially comments of the form "pleeeeeeeeeease release this
code to the CPAN"...    :-} 

Docs at:
   http://www.enteract.com/~eryq/CPAN/IO-stringy/docs/IO/Scalar.pm.html

Distribution at:
   http://www.enteract.com/~eryq/CPAN/IO-stringy/

Test code at the bottom of each module.  
Knock yourselves out.

-- 
  ___  _ _ _   _  ___ _   Eryq (eryq@enteract.com)
 / _ \| '_| | | |/ _ ' /  Hughes STX, NASA/Goddard Space Flight Cntr.
|  __/| | | |_| | |_| |   http://www.enteract.com/~eryq
 \___||_|  \__, |\__, |___/\  Visit STREETWISE, Chicago's newspaper by/
           |___/    |______/ of the homeless: http://www.streetwise.org




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

Date: Thu, 27 Mar 1997 15:55:19 GMT
From: jason@cimedia.com (Jason Bodnar)
Subject: Re: q
Message-Id: <333a9858.259550691@news.onr.com>

jtbell@presby.edu (Jon Bell) wrote:

> Tom Phoenix  <rootbeer@teleport.com> wrote:
>>On 26 Mar 1997, Anthony Mulligan wrote:
>>
>>> Subject: q
>>
>>a
>
>y?

o, u ...



-- 
Jason C. Bodnar
jasonb@onr.com
Internet Programmer
Cox Interactive Media


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

Date: Thu, 27 Mar 1997 16:06:39 +0000
From: Douglas Seay <seay@absyss.fr>
To: david@cnation.com
Subject: Re: Smarter indexing algorythm
Message-Id: <333A9B0F.5EA8@absyss.fr>

David Alan Pisoni wrote:
> 
> 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?

Try pre-initializing your list to six close ZIPs (assume that
adjacent numbers are close, it isn't perfect, but it could
be worse) and keeping your list sorted.  This way you won't need
that innermost loop (not the one your label Inner Loop, the
for loop) because you can simply compare with the last element
to find the current "most distant" ZIP.  When you find one
that is closer than the furthest, use "$list[5] = $testzip;"
and then sort @list.

You also might be able to cut your search set down by only
comparing seeing if $zip is close to $testzip and the reverse
($testzip close to $zip).  This would mean that you would
only have "next if ($testzip <= $zip);", which cuts down
on iterations of the outer loop.  But this would mean that
you'd make a subroutine, and the extra cost of not inlining
might offset the savings of the smaller loop (use benchmark).

Break out your copy of the camel and look into optimzations.
Pay special attention to things like eval() and launching
child processes.  Do little things that add up like moving
my() outside of loops to the next outer layer (when possible).

Buy a faster computer/install more memory/install more cache.
Make sure that your perl was compiled with optimzations.


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

Date: 27 Mar 1997 15:24:46 GMT
From: "Justin Morgan" <jmorgan@software602.com>
Subject: Software602, Inc.
Message-Id: <01bc3a43$171679a0$7c36c4c2@soft602.software602.com>


602proINTERNET, automated LAN access to the INTERNET, software allows Local

Area Network to connect simultaneously to the Internet through just ONE 
modem dial-up or dedicated, with Firewall, WWW and E-Mail Clients. 

http://www.software602.com




602proINTERNET is a communication software package for full connection to 
the Internet using dial-up or leased line. If you are a small business
owner 
or an IS manager in a small to medium sized company, you have just found
the 
software you need. 602proINTERNET allows a number of computers to access
the 
Internet through one account. The product includes SMTP/MIME e-mail with 
clients for Windows 3.1x, Windows95 and WEB clients for Windows 3.1x and 
Windows95. 32-bits Mail602 INTERNET Server provides fast, high-quality 
delivery of your messages. Firewall SOCKS solves the security of your 
network. 602proINTERNET offers the possibility of using online access to
the 
Internet for all users in your network simultaneously for the price of 
connecting a single PC. 
 

What can 602proINTERNET do?

"SURF" the NET from any workstation on the network! 
The user of each workstation on the network has access to WWW pages of any 
WEB site on the Internet. All users on the network can "surf" on the 
Internet simultaneously. 

Electronic mail for each network user! 
602proINTERNET includes SMTP/MIME e-mail with the option to send and
receive 
attached files for any user on the network, regardless whether he is using 
Windows 3.1x or Windows95. E-mail has many ways of administrating the
users' 
rights. Every user of your network has his own Internet address (i.e. 
"user@yourcompany.com").

Security! 
Our firewall SOCKS solves the security of your network against access 
byunauthorized personnel. At the same time you may define access to WWW to 
selected users on your network. Security is solved directly at the IP
packet 
level and this is why it is reliable. 
  
Only one IP address is all that you need! 
You save your money! Your full connection to the Internet using 
602proINTERNET requires only one IP address for the whole network. You will

connect your whole network to the Internet for the price of connecting a 
single computer. 
  
Available for Dial-up and leased line connections, too! 
The software package 602proINTERNET is great for Dial-up as well as for 
leased line connections. No more expensive telephone lines! 

 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Software602, Inc.                                  Justin Morgan
6821 Southpoint Drive, N #113                       Director of
Jacksonville, Fl 32216                          Information Technology


tel:(904)296-7700                              justin@software602.com
fax:(904)296-9392                           http://www.software602.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


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

Date: Thu, 27 Mar 1997 08:46:57 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Sandro Poltera <poltera@bluewin.ch>
Subject: Re: Suid set - System calls
Message-Id: <Pine.GSO.3.96.970327084631.13866H-100000@kelly.teleport.com>

On Wed, 26 Mar 1997, Sandro Poltera wrote:

> I set the suid of my perlscript:
> 
> -rwsrwxr-x   1 root     other      12527 Mar 26 10:27 hosttool.pl*
> 
> Now it seems, that systemcalls (system()) do no longer work.
> The same with the mkdir-function of perl. Is there something
> I do wrong. Or are these limitations because of the suid?

Have you seen perlsec(1)? 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: 27 Mar 1997 15:32:54 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Symlink Directories
Message-Id: <5he3v6$8j6@fridge-nf0.shore.net>

Fred Adorno (fadorno@mail.gte.net) wrote:
: Can someone please show me how to symlink between two directories and
: keep the link from showing the hidden files?

What hidden files?  Last time I checked, Unix didn't have any.  :-)
If you're referring to the . and .. directories, when reading the
directory, you could use a next if to skip these entries.

Is this what you were asking for?

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: Thu, 27 Mar 1997 09:08:58 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Fred Adorno <fadorno@mail.gte.net>
Subject: Re: Symlink Directories
Message-Id: <Pine.GSO.3.96.970327090541.13866N-100000@kelly.teleport.com>

On Wed, 26 Mar 1997, Fred Adorno wrote:

> Can someone please show me how to symlink between two directories and
> keep the link from showing the hidden files?

You can make a symlink with the symlink function, documented in
perlfunc(1). (If that documentaion is insufficient, please let us know.)

As far as I know, there's nothing that makes files "hidden" in Unix
systems, but (by convention) shells and some utilities like 'ls' will
ignore files and directories whose names begin with a period. Of course,
if you do 'ls -l symlink-to-dir', it's up to your ls to include or omit
those items. 

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: Thu, 27 Mar 1997 10:02:31 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: trivial perl question from an ignoramus
Message-Id: <nm5eh5.e74.ln@localhost>

Fredrik Lindberg (flg@vhojd.skovde.se) wrote:
: Robert R. Tucci wrote:
: >
: > 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?
: > 
: >> snap <<

: > sub check
: > {
: >         $i=0;
: >         foreach $i (0 .. $#){
:                            ^^

: This is wrong, it should read $#_ instead, since the array name you want 
                                                   ^^^^^^^^^^^^^^^^^^^^^^^
: to find the last index for is $_
                             ^^^^^

That is the name of a scalar, not an array.

You meant to say @_ there...


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


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

Date: 27 Mar 1997 17:04:58 GMT
From: kaz@vision.crest.nt.com (Kaz Kylheku)
Subject: Re: Unix and ease of use  (WAS: Who makes more ...)
Message-Id: <5he9bq$ocg@bcrkh13.bnr.ca>

In article <01bc3a04$51baad40$87ee6fce@timpent.a-sis.com>,
Tim Behrendsen <tim@a-sis.com> wrote:
>Steve Mading <madings@earth.execpc.com> wrote in article
><5haigq$gtn$1@earth.execpc.com>...
>> Tim Behrendsen (tim@a-sis.com) wrote:
>> 
>> : Perhaps, but the best programmers I know put forth their best
>> : effort on whatever project they work on, because they have pride
>> : in their work.  And it's much more ethical to do your best work
>> : when you are being paid for it.
>> 
>> Like what I was saying here.  But I have yet to work for a company
>> that actually lets me have pride in my work.  The general idea
>> has always been "Shut up and do it this way, even if it's wrong.".
>> I can't take pride in my work in an environment like that, because
>> for the most part it isn't *my* work.  I end up being just a
>> glorified secretary for the analyst who hasn't programmed in over
>> five years but thinks he knows how to design a modern system.
>
>Then don't work there.
>
>Remember: The Sistine Chapel was a commissioned project.  Should
>Michelangelo have done inferior work because he was getting paid
>for it?

He most likely did do inferior work. But then again, he was a pretty unique
individual who was most likely able to make recommendations and demands,
the fullfillment of which enabled him to do better work. In the software
business, you would have to be the equivalent of a Michelangelo to be
able to do the same.

I'm a big fan of baroque music. One thing that is interesting is that some of
the most boring and banal music from that period consists of those works which
were commissioned.  The most interesting and valuable pieces are almost
invariably the ones that were done out of the composer's own motivation. They
are particularly ones written for solo instruments or small ensembles---music
made for musicians not for the entertainment of the bourgeois.


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

Date: Thu, 27 Mar 1997 09:12:10 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: sundance@pacbell.net
Subject: Re: Unpacking .gz file
Message-Id: <Pine.GSO.3.96.970327091130.13866O-100000@kelly.teleport.com>

On Wed, 26 Mar 1997 sundance@pacbell.net wrote:

> Does anybody here know how to unpack a .gz file under UNIX?

Yes, and if this were a Unix newsgroup (instead of a Perl newsgroup) I'd
gladly tell you to use gunzip. :-)

-- 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: Thu, 27 Mar 1997 09:59:58 -0500
From: Jim West <jqw4@psu.edu>
Subject: Using an "@" in a perl format
Message-Id: <333A8B6E.5A1A@psu.edu>

Does anyone know how to put a literal "@" into a perl format block? 
I've created a document footer that contains an internet e-mail address,
but perl seems to thinks the "@" in the address is actually the
beginning of a fieldholder and gives me an error.  Here's how I got
around the problem, but is there a cleaner way of doing this?

Thanks in advance!

Jim

format DOC_FOOTER = 
For more information contact
<A HREF="mailto:registrar@psu.edu">REGISTRAR@PSU.EDU</A><BR>
"@", "@"
</CENTER><HR></BODY></HTML>
 .


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

Date: Thu, 27 Mar 1997 16:18:45 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Using an "@" in a perl format
Message-Id: <ebohlmanE7pMn9.24s@netcom.com>

Jim West (jqw4@psu.edu) wrote:
: beginning of a fieldholder and gives me an error.  Here's how I got
: around the problem, but is there a cleaner way of doing this?

: format DOC_FOOTER = 
: For more information contact
: <A HREF="mailto:registrar@psu.edu">REGISTRAR@PSU.EDU</A><BR>
: "@", "@"
: </CENTER><HR></BODY></HTML>
: .

That's the standard way of doing it, as described on page 125 of the 
Camel book.



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

Date: Thu, 27 Mar 1997 16:25:00 GMT
From: jtbell@presby.edu (Jon Bell)
Subject: Re: Using an "@" in a perl format
Message-Id: <E7pMxp.77B@presby.edu>

 Jim West  <jqw4@psu.edu> wrote:
>Does anyone know how to put a literal "@" into a perl format block? 

Precede it with a backslash, e.g. jtbell\@presby.edu.

-- 
Jon Bell <jtbell@presby.edu>                        Presbyterian College
Dept. of Physics and Computer Science        Clinton, South Carolina USA
[for beginner's Usenet info, see http://web.presby.edu/~jtbell/usenet/ ]


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

Date: Thu, 27 Mar 1997 16:46:23 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Using an "@" in a perl format
Message-Id: <ebohlmanE7pnxB.46F@netcom.com>

Jon Bell (jtbell@presby.edu) wrote:
:  Jim West  <jqw4@psu.edu> wrote:
: >Does anyone know how to put a literal "@" into a perl format block? 

: Precede it with a backslash, e.g. jtbell\@presby.edu.

That won't work; backslashes don't have any special meaning in a format.  
Your example will come out as "jtbell\ presby.edu."



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

Date: Thu, 27 Mar 1997 10:22:01 -0500
From: "James D. Corder" <jimcor@corder.com>
Subject: Re: Who makes more $$ - Windows vs. Unix programmers?
Message-Id: <333A9099.5364@corder.com>

USUARIO wrote:
> 
> In article <1387.7010T977T2070@canit.se>, Iggy Drougge <optimus@canit.se> wrote:
> >John Lockwood (johnl@calweb.com) skrev:
> >>"Terje A. Bergesen" <terjeber@eunet.spm-protect.no> wrote:
> >
> >>>> Unix appeals more to me and is more advanced technically, but I am
> >>>> afraid that it is losing the market share to Windows 95.
> >
> >>Unix is more advanced technically?  That's interesting.  The last time
> >>I installed a modem on Windows NT the OS found it for me.  The last
> >>time I tried it on Unix I read about the nine files one had to edit,
> >>then gave up.

	As Personal Computers gain the desk tops employers can
pay employees less...

	However, UNIX is gaining and controling the the Server enviroment.
TSO and AS400 is losing that one.  Personal Computers never had it. 
Case
in point:

	I want to run a 2TB database with 2,000 simultaneous users and
reload the operating system durring business hours without takeing the
system down,... Yes UNIX Can, No Personal Computers can't:-)

	Now for the plug and pray cards of the Personal computers...
I have purchased a modem, soundblaster card, and a snappy... none
of them work. The Support people's suggestion was to erase and reload
the operating system... Get a life.

	boot -r

	What a nice command:-)

-- 
James D. Corder			When should you tell your wife
jimcor@corder.com		you love her?
http://post369.columbus.oh.us	Before someone else does!


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

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

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