[6613] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 237 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Apr 5 23:07:27 1997

Date: Sat, 5 Apr 97 20:00:54 -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           Sat, 5 Apr 1997     Volume: 8 Number: 237

Today's topics:
     Re: @array as input symbol in <@array> (Nathan V. Patwardhan)
     [Perl HTML manual](perlfunc problem) <sanjay@cis.ohio-state.edu>
     Re: [Win32] "Error: parse exception" loading module (Ad <jburley@uci.edu>
     Re: [Win32] "Error: parse exception" loading module (Ad <williame@leisureplan.com>
     A beginer's Regular Expression problem <lwang2@gl.umbc.edu>
     Re: A beginer's Regular Expression problem (Ilya Zakharevich)
     Re: accessing sqlplus or oracle through perl (John D Groenveld)
     Re: ANWER (was: [Win32] "Error: parse exception" loadin <rothd@roth.netX>
     associative array elements question (Jon Nathan)
     CGI Server error <carlmm@well.com>
     Re: cgi <rootbeer@teleport.com>
     Re: Configuring Perl5.002 on OS2 (Craig A. Keefner)
     Re: Configuring Perl5.002 on OS2 (Ilya Zakharevich)
     conversion windows to unix <sales@amagicstore.com>
     Enhancing Perl grep <rootbeer@teleport.com>
     Re: Environment Variables <rootbeer@teleport.com>
     Re: Environment Variables (Tad McClellan)
     flock not implemented on Solaris 2.5 installation? <nancyv@tiac.net>
     Re: flock not implemented on Solaris 2.5 installation? <roderick@argon.org>
     flock() not implemented on Solaris 2.5.1? <nancyv@tiac.net>
     Re: flock() not implemented on Solaris 2.5.1? <eryq@enteract.com>
     Re: flock() not implemented on Solaris 2.5.1? <tibbs@hpc.uh.edu>
     Re: flock() not implemented on Solaris 2.5.1? <rootbeer@teleport.com>
     Re: fractional second timing <roderick@argon.org>
     getting \@ and \% arguments in prototyped subroutines ( <psrc@exmachina.com>
     Re: getting \@ and \% arguments in prototyped subroutin (David Alan Black)
     Re: guestbook (writing to the datafile) (Tim Gim Yee)
     Gurus Please Help with Array problem (Kevin Murphy)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 5 Apr 1997 16:59:07 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: @array as input symbol in <@array>
Message-Id: <5i60cr$4d7@fridge-nf0.shore.net>

Mark-Jason Dominus (mjd@plover.com) wrote:

: Someone recently sent me a code sample that included

: 	while (<@array>) {
: 	  print $_, "\n";
: 	}

Actually, I've seen this mentioned on this newsgroup a whole bunch of
times over the last three-four months.  Although I don't remember seeing
any subject headers like: "Help with $_" I do remember seeing people using
(and others abusing) $_; there was a short dialog about using it and abusing
it, and which is which.

It's also documented on page 100 of the blue Camel, not as an example, but
in the paragraph which reads something like: "it omitted, $var will be
replaced by $_ in foreach."  I found this under $_ in the index.

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: Sat, 05 Apr 1997 17:01:40 -0500
From: Sanjay Vohra <sanjay@cis.ohio-state.edu>
Subject: [Perl HTML manual](perlfunc problem)
Message-Id: <3346CBC4.20FF@cis.ohio-state.edu>

i downloaded a copy of the HTML documentation from the Perl Language
Home Page, unzipped and 'detarred' it

the individual function descriptions in perfunc directory seem to be
missing 

has anybody come across this problem? maybe i messed up somewhere, any 
help would be appreciated

thanks

sv


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

Date: Sat, 05 Apr 1997 08:46:11 -0800
From: Josh Burley <jburley@uci.edu>
Subject: Re: [Win32] "Error: parse exception" loading module (AdminMisc)?
Message-Id: <334681D3.205C@uci.edu>

I'm working with Ben on this problem, so I think I'll answer this one
since he hasn't yet...

Yea, everything is still in the correct name. I even made sure that the
cases matched. We threw the .pm file in perl/lib/win32 and the .pll file
in perl/lib/auto/win32/adminmisc ... It's really a strange problem. No
matter what we do, as soon as we put "use Win32::AdminMisc" or "require
Win32::AdminMisc" it gives us those errors... 

(and Roth isn't around to email! :)

-Josh

Nathan V. Patwardhan wrote:

> Are you sure that Win95 has maintained the correct case for the
> module; i.e. - AdminMisc might now be called adminmi~1, where Perl
> might be unhappy about it.  :-)


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

Date: 5 Apr 1997 18:12:42 GMT
From: "William Evans" <williame@leisureplan.com>
Subject: Re: [Win32] "Error: parse exception" loading module (AdminMisc)?
Message-Id: <01bc41ed$5df5dda0$04c019c4@bwele>

I am getting the same problem with the gd module from Dave Roth, but all
the other Win32 Modules I am using seem fine.

The error is 

E:\Downloads\perl\libstuff\win32gd>test.pl
Error: Parse exception

The version of perl is
This is perl, version 5.003_07
Perl for Win32 Build 303 - Built 14:27:31 Jan 29 1997

I don't know if my error is related in some way.
-- 
William Evans
e-mail: williame#leisureplan.com (s/#/\@/)

Nathan V. Patwardhan <nvp@shore.net> wrote in article
<5i43oj$9ss@fridge-nf0.shore.net>...
> Ben Mehling (bmehling@uci.edu) wrote:
> 
> : Thanks for the reply, however I am not sure that this is my problem.  I
> : can not even get the module to load - as I mentioned, the script parse
> : errors when trying to load the module.  I haven't even gotten it to
> : "compile" when I try to "use Win32::AdminMisc", but when I # that out
> : the script runs fine...
> 
> Are you sure that Win95 has maintained the correct case for the
> module; i.e. - AdminMisc might now be called adminmi~1, where Perl
> might be unhappy about it.  :-)
> 
> --
> Nathan V. Patwardhan
> nvp@shore.net
> 
> 


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

Date: Sat, 05 Apr 1997 21:53:29 -0500
From: "l wang; ENME" <lwang2@gl.umbc.edu>
Subject: A beginer's Regular Expression problem
Message-Id: <33471029.5AD8@gl.umbc.edu>

Hi experts:

	The following code is expected to output nothing, but strange enough it
outputed as 

>matchedAA
>

Why?



#!/usr/local/bin/perl
$_ = "AAA";
print "matched" if m/(\w+\s*){5}/;
print $1, "\n";


Thanks for the help!


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

Date: 6 Apr 1997 03:42:58 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: A beginer's Regular Expression problem
Message-Id: <5i7642$s2m$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to l wang; ENME
<lwang2@gl.umbc.edu>],
who wrote in article <33471029.5AD8@gl.umbc.edu>:
> Hi experts:
> 
> 	The following code is expected to output nothing, but strange enough it
> outputed as 
> 
> >matchedAA

No it does not.

Hope this helps,
Ilya


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

Date: 5 Apr 1997 21:32:06 -0500
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: accessing sqlplus or oracle through perl
Message-Id: <5i71v6$274$1@tholian.cse.psu.edu>

See http://www.rosat.mpe-garching.mpg.de/mailing-lists/PerlDB-Interest/
and http://www.coe.missouri.edu/~faq/lists/dbi.html

Happy Perl'ng,
John
groenvel@cse.psu.edu


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

Date: 5 Apr 1997 18:14:10 GMT
From: "Dave Roth" <rothd@roth.netX>
Subject: Re: ANWER (was: [Win32] "Error: parse exception" loading module (AdminMisc)?)
Message-Id: <01bc41ec$d0f118c0$5f906ec6@main2>



Josh Burley <jburley@uci.edu> wrote in article <334681D3.205C@uci.edu>...
> I'm working with Ben on this problem, so I think I'll answer this one
> since he hasn't yet...
> 
> Yea, everything is still in the correct name. I even made sure that the
> cases matched. We threw the .pm file in perl/lib/win32 and the .pll file
> in perl/lib/auto/win32/adminmisc ... It's really a strange problem. No
> matter what we do, as soon as we put "use Win32::AdminMisc" or "require
> Win32::AdminMisc" it gives us those errors... 
> 
> (and Roth isn't around to email! :)
> 
> -Josh
> 
> Nathan V. Patwardhan wrote:
> 
> > Are you sure that Win95 has maintained the correct case for the
> > module; i.e. - AdminMisc might now be called adminmi~1, where Perl
> > might be unhappy about it.  :-)
> 

The problem is that you are using a build of perl that the adminmisc
extension was not compiled for. 
If you run:
	perl -v
it will tell you what build of perl you have.
The adminmisc.zip archive contains two versions: one for builds 106-110 and
another for buld 303 (I think).
A new version is available for build 304 called Adminmisc_build_304.zip on
my ftp site.
dave
-- 
================================================================
Dave Roth                               ...glittering prizes and
Roth Consulting                     endless compromises, shatter
rothd@roth.net                         the illusion of integrity

 My email address is disguised to fool automailers. Remove the
                 trailing 'X' to send me email.
****************************************************************
Use of  this message or  email address  for commercial  purposes
(including "junk" mailings) is strictly prohibited and protected
under  current  international  copyright laws  and United States
Code, Title 47, Chapter 5, Subchapter II.



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

Date: 5 Apr 1997 08:55:44 GMT
From: jn0729a@cage.cas.american.edu (Jon Nathan)
Subject: associative array elements question
Message-Id: <5i542g$urp$1@paladin.american.edu>

hello

sorry for the easy question, but i can't find this out anywhere and have 
been trying for a while.  what i have is an associative array stored in a 
text file.  the perl stuff is a cgi script, and when the user follows a 
link, the QUERY_STRING is captured and put into a local variable, $abb.  
the assoc array sort of is like this...

%pic_to_show #name of array
$pic $desc   #picture is the first value, then it has an associated
	     #description

i want to check $abb against the assoc array (as if it were $pic) and 
then print out the $desc that goes with it.  what i am having problems 
with is how exactly to address the variable in the array.  using C logic 
and perl syntax, it would be print "$abb{$desc}, meaning the description 
that corresponds to the value $abb.  but this doesn't work.  any help 
directed to email would be greatly appreciated. 


 --
Jon Nathan
jon@blading.com
www.csis.american.edu/~jn0729a


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

Date: Fri, 04 Apr 1997 18:20:19 -0800
From: carlmm <carlmm@well.com>
Subject: CGI Server error
Message-Id: <3345B6E3.A8F@well.com>

Does anyone know what this error might be from:

[04/Apr/1997:18:14:42] failure: for host 206.80.16.53 trying to POST 
/cgi-bin/ad
dee.pl, cgi-parse-output reports: the CGI program 
/usr/local/wwwdocs/support.wel
l.net/cgi-bin/addee.pl did not produce a valid header (name without 
value: got l
ine "no write permission to ndbm file at emplib.pl line 71.")

Also...


This server has encountered an internal error which prevents it from 
fulfilling your request. The most
likely cause is a misconfiguration. Please ask the administrator to 
look for messages in the server's
error log.


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

Date: Sat, 5 Apr 1997 05:15:18 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Greg Foley <gf94ab@sandcastle.cosc.brocku.ca>
Subject: Re: cgi
Message-Id: <Pine.GSO.3.96.970405050916.2974K-100000@kelly.teleport.com>

On 3 Apr 1997, Greg Foley wrote:

Newsgroups: comp.lang.perl

No, you want comp.lang.perl.misc. We changed the name day before
yesterday, and you need to nag your newsadmin to fix it. (Just kidding.
Your newsadmin is _many_months_ behind the times on this one. Have him or
her read the frequent posting in news.announce.newgroups about bogus
newsgroup names.)

> Subject: cgi

Please check out the frequent posting in c.l.p.misc on good subject lines.

> open (FILEDES, ">>"."/usr/me/public_html/myfile");

> I can execute this program, and I don't get any errors.  

No, you mean that you don't get any error _messages_. You get errors just
fine. :-)

Try checking and reporting on errors, like this.

    open FILE, ">>$filename" or die "Can't append to '$filename': $!";

Remember that your scripts error messages will not usually be sent to the
browser, so check with your server's docs to find out where they will go.
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: 4 Apr 1997 14:01:01 -0700
From: keefner@primenet.com (Craig A. Keefner)
Subject: Re: Configuring Perl5.002 on OS2
Message-Id: <334508de.850533@news.primenet.com>

On 3 Apr 1997 22:32:48 GMT, asched1@medtronic.COM (Dan Ascheman)
wrote:

>Hi all,
> I am stuck in the middle of running my Configure script on OS2 which
>created my config,sh file.  The problem is, it says it can't find awk and
>tells me to check my path - I have awk in my path, I have awk in my current
>working dir., and I even tell the path in Configure where Awk is - What
>more do I have to do??
>

I never ran the config to get perl up on my os2. I just edited the
files and added paths where needed.  Awk was never needed.

Craig


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

Date: 5 Apr 1997 04:49:45 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Configuring Perl5.002 on OS2
Message-Id: <5i4ll9$ru$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Dan Ascheman
<asched1@medtronic.COM>],
who wrote in article <5i1b6g$s7$1@gazette.corp.medtronic.com>:
> Hi all,
>  I am stuck in the middle of running my Configure script on OS2 which
> created my config,sh file.  The problem is, it says it can't find awk and
> tells me to check my path - I have awk in my path, I have awk in my current
> working dir., and I even tell the path in Configure where Awk is - What
> more do I have to do??

If I remember correct, 5.002 may build out of the box (the earliest
binary distribution I have at my ftp dir is 5.002_01, so I cannot
check whether you needed any patches). Make sure you use the latest
pdksh.

Keep in mind that 5.004beta1 binary distribution is avalaible at all
the fine CPAN places.

Ilya


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

Date: Sat, 05 Apr 1997 14:42:13 -0800
From: A magic Store <sales@amagicstore.com>
Subject: conversion windows to unix
Message-Id: <3346D545.574D@amagicstore.com>

Does anybody know where can I find a program to convert windows text
into unix text (basically without the new-line caracter \n).
I'm having problem uploading my cgi script to my unix server.

Any help will be appreciated !

Max
max@amagicstore.com


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

Date: Sat, 5 Apr 1997 10:32:47 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: David Combs <dkcombs@netcom.com>
Subject: Enhancing Perl grep
Message-Id: <Pine.GSO.3.96.970405103009.18891A-100000@kelly.teleport.com>

On Sat, 5 Apr 1997, David Combs wrote:

> Nifty program is GNU GREP.  It provides an egrep that
> allows not only -w (word mode), 
> 
> but also the -A<n> and -B<n> options:
> 
>    (gnu) egrep -A2 -B3 regexp files...
> 
> will, for every line containing the regex, output not only
> that line, but 2 lines After it and the 3 lines Before it.

> AND, when there is overlap, IT DOES THE RIGHT THING (not
> trivial).
> 
> I find this facility SO useful -- maybe others would too --
> that MAYBE it should be added as option to the grep cmd
> in perl...

Maybe you could make a module which would do what you want, if you can
define it accurately. You might even be able to do this with map, if you
wrote it right. 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: Fri, 4 Apr 1997 17:01:00 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: John Allen XD/BZ 832 4812 <etljhan@etlxdmx.ericsson.se>
Subject: Re: Environment Variables
Message-Id: <Pine.GSO.3.96.970404165932.21773G-100000@kelly.teleport.com>

On 4 Apr 1997, John Allen XD/BZ 832 4812 wrote:

> Unfortunately, the set of environment variables passed to perl by the
> html script is rather sparse and does not include $HOME, $USER etc.

What would $HOME be, when the server is run by 'nobody'? If you want those
set, you can set them yourself, but you probably don't need them and
couldn't use them. 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: Fri, 4 Apr 1997 16:52:22 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Environment Variables
Message-Id: <6n04i5.qaq.ln@localhost>

John Allen XD/BZ 832 4812 (etljhan@etlxdmx.ericsson.se) wrote:

: I have a problem that must have been seen lots of times, so apologies if
: it has been asked before...

: I am trying to write a web based toolset using perl for the CGI scripts.
: Unfortunately, the set of environment variables passed to perl by the
                                                                 ^^^^^^
: html script is rather sparse and does not include $HOME, $USER etc.
  ^^^^^^^^^^^

HTML is not a script. It is a markup language.

The HTML (nor HTTP) does *not* pass _any_ environment variables 
to the perl script. The protocol passes them to the Operating System.
The Operating System (or brain dead program loader)  passes them
to the perl script.



: Is there any way to get at these variables?

Not if they are not there.  ;-)

Have your system administrator set up the account used to run
CGI scripts to have the other envars.


Or, simply set the ones you need within your perl script:

$ENV{HOME} = '/home/etljhan';


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


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

Date: Fri, 04 Apr 1997 20:52:12 -0500
From: Nancy Voorhis <nancyv@tiac.net>
Subject: flock not implemented on Solaris 2.5 installation?
Message-Id: <3345B04C.664D@tiac.net>

Can anyone help with why I get the message:
	flock() function not implemented

when running Perl (must I admin v5.001?) on my 'newishly' installed
Solaris 2.5.1 Ultra system?  

Perhaps I haven't sufficiently perused the Perl documentation but my
understanding from all the man pages, FAQ's, compilation notes, etc. is
that the builtin flock() function ought to work 
if I my system implements any one of the following (and it will try them
in this order): flock,  fcntl, lockf (see
perlfaq5/How_can_I_lock_a_file)

I can see that flock installed is *not* installed on the system (I
believe this is now found in the BSD compatibility package), but there
is an fcntl AND a lockf. If this is a 5.001 bug I guess I can upgrade :)
or I can install the BSD compatibility package but I am now more curious
than anything else about why the claimed-to-be-portable flock() is not
functioning in a seemingly portable fashion.

Thanks for any help in advance,
Nancy Voorhis

=========================
VoorTech Consulting
140 Mountain Avenue
Northwood, NH  03261
nancyv@tiac.net
=========================


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

Date: 5 Apr 1997 17:41:13 -0500
From: Roderick Schertler <roderick@argon.org>
To: nancyv@tiac.net
Subject: Re: flock not implemented on Solaris 2.5 installation?
Message-Id: <pzohbtgkpq.fsf@eeyore.ibcinc.com>

On Fri, 04 Apr 1997 20:52:12 -0500, Nancy Voorhis <nancyv@tiac.net> said:
> 
> [...] the builtin flock() function ought to work if I my system
> implements any one of the following (and it will try them in this
> order): flock, fcntl, lockf (see perlfaq5/How_can_I_lock_a_file)

You need a newer version of Perl.  The second 5.004 beta (5.003_98) will
be released soon, keep an eye on comp.lang.perl.announce.

-- 
Roderick Schertler
roderick@argon.org


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

Date: Fri, 04 Apr 1997 20:54:40 -0500
From: Nancy Voorhis <nancyv@tiac.net>
Subject: flock() not implemented on Solaris 2.5.1?
Message-Id: <3345B0E0.101B@tiac.net>

Can anyone help with why I get the message:
        flock() function not implemented

when running Perl (must I admin v5.001?) on my 'newishly' installed
Solaris 2.5.1 Ultra system?  

Perhaps I haven't sufficiently perused the Perl documentation but my
understanding from all the man pages, FAQ's, compilation notes, etc. is
that the builtin flock() function ought to work 
if I my system implements any one of the following (and it will try them
in this order): flock,  fcntl, lockf (see
perlfaq5/How_can_I_lock_a_file)

I can see that flock installed is *not* installed on the system (I
believe this is now found in the BSD compatibility package), but there
is an fcntl AND a lockf. If this is a 5.001 bug I guess I can upgrade :)
or I can install the BSD compatibility package but I am now more curious
than anything else about why the claimed-to-be-portable flock() is not
functioning in a seemingly portable fashion.

Thanks for any help in advance,
Nancy Voorhis

=========================
VoorTech Consulting
140 Mountain Avenue
Northwood, NH  03261
nancyv@tiac.net
=========================


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

Date: Fri, 04 Apr 1997 22:15:49 -0600
From: Eryq <eryq@enteract.com>
To: nancyv@tiac.net
Subject: Re: flock() not implemented on Solaris 2.5.1?
Message-Id: <3345D1F5.6FAE215C@enteract.com>

Nancy Voorhis wrote:

> Perhaps I haven't sufficiently perused the Perl documentation but my
> understanding from all the man pages, FAQ's, compilation notes, etc. is
> that the builtin flock() function ought to work
> if I my system implements any one of the following (and it will try them
> in this order): flock,  fcntl, lockf (see
> perlfaq5/How_can_I_lock_a_file)

No, you did right.  This was a cause of frustration to many folks for a 
while, largely because the perlfunc entry for flock() was inaccurate: 
it claimed to be emulated with fcntl() (which is in POSIX and is powerful 
enough to do the job), but in fact was being emulated with lockf() 
(which is not).  A quick look at pp_sys.c in the Perl source confirmed 
this, at least for 5.002.


> I can see that flock installed is *not* installed on the system (I
> believe this is now found in the BSD compatibility package), but there
> is an fcntl AND a lockf. If this is a 5.001 bug I guess I can upgrade :)
> or I can install the BSD compatibility package but I am now more curious
> than anything else about why the claimed-to-be-portable flock() is not
> functioning in a seemingly portable fashion.

I'd call it a 5.001 bug, but consider yourself lucky that you found out
about it up front: I had code using both shared and exclusive locks
that ran fine under Linux, but in some cases would barf on Solaris; 
it took forever for me to track the problem down to the fact that lockf() 
was being silently used as a replacement for the absent flock().

There may be an extension module somewhere out there which does the 
emulation properly, but if I were you I'd check to see whether or not
the last stable 5.003 release had this fix in there.  If you're
feeling adventuous, I think that 5.004 does.  

I would also recommend that you *not* try to make the fcntl() call from Perl
itself; to do so, I believe you'll have to pack() up a scalar with bytes
that are *highly* OS-dependent, and then portability (possibly even across 
OS upgrades!) goes out the window.   

Since 5.001 is a little hoary anyway, I would... 

	1. upgrade to a Perl that emulates with fcntl(), or
	2. upgrade anyway, and make sure it builds using the BSD library, or
	3. rebuild your 5.001 with the BSD library, or 
	4. find an extension module that emulates flock() with fcntl(), or
	   that calls the BSD flock(), or
	5. write an extension module that emulates flock() with fcntl(), or
	   that calls the BSD flock().
	
As usual, TMTOWTDI :-)
-- 
  ___  _ _ _   _  ___ _   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: 04 Apr 1997 23:34:19 -0600
From: Jason L Tibbitts III <tibbs@hpc.uh.edu>
Subject: Re: flock() not implemented on Solaris 2.5.1?
Message-Id: <ufaohbunick.fsf@sina.hpc.uh.edu>

>>>>> "E" == Eryq  <eryq@enteract.com> writes:

E> [...] but if I were you I'd check to see whether or not the last stable
E> 5.003 release had this fix in there.  If you're feeling adventuous, I
E> think that 5.004 does.

5.003 did not properly do flock on Solaris.  5.004 will.  5.004beta does,
and it works really well to boot.  If you need flock now, it's probably
easier just to get and install the beta than to try and cook up a
replacement.
-- 
      Jason L. Tibbitts III - tibbs@uh.edu - 713/743-8684 - 221SR1
System Manager:  University of Houston High Performance Computing Center
                1994 PC800 "Kuroneko"      DoD# 1723


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

Date: Sat, 5 Apr 1997 10:33:51 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Nancy Voorhis <nancyv@tiac.net>
Subject: Re: flock() not implemented on Solaris 2.5.1?
Message-Id: <Pine.GSO.3.96.970405103312.18891B-100000@kelly.teleport.com>

On Fri, 4 Apr 1997, Nancy Voorhis wrote:

> Can anyone help with why I get the message:
>         flock() function not implemented

> I can see that flock installed is *not* installed on the system (I
> believe this is now found in the BSD compatibility package), but there
> is an fcntl AND a lockf. If this is a 5.001 bug I guess I can upgrade :)

Sounds like it, but when you install a newer Perl you'll find out. :-)

-- 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: 4 Apr 1997 18:16:12 -0500
From: Roderick Schertler <roderick@argon.org>
To: Ethan Joffe <ethan@worldsite.net>
Subject: Re: fractional second timing
Message-Id: <pzafne4bz1.fsf@eeyore.ibcinc.com>

On Thu, 03 Apr 1997 04:17:54 -0800, Ethan Joffe <ethan@worldsite.net> said:
>
> Anyone know how to do sub-second timing in Perl on an SGI?
> I need actual time, not processor time ala 'times'.

Get Time::HiRes from CPAN.  If your system doesn't have gettimeofday(),
ualarm() and usleep() mail me for patches which will allow the functions
you do have to work (these patches will be included in the next
release).

-- 
Roderick Schertler
roderick@argon.org


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

Date: Fri, 04 Apr 1997 20:43:51 -0500
From: Paul S R Chisholm <psrc@exmachina.com>
Subject: getting \@ and \% arguments in prototyped subroutines (with answer)
Message-Id: <3345AE57.4C63@exmachina.com>

I take it (having read pp. 118-121 of the 1996 printing of PROGRAMMING
PERL) that I could write a subroutine:

sub push(\@@)  # first try
{
    my (@array, @list);
    # code goes here
}

The first argument is "an actual argument ... that absolutely must start
with that character." It's the list we're going to push elements onto.
The rest of the arguments are consumed by the unbackslashed at sign, and
are the things we're going to push onto the list. We can just use @_
after we've gotten the first argument.

Spending five minutes with the debugger (instead of sending a half-
baked message all over the Net), I discovered that the first argument to
mypush() is actually a reference to an array. That means my code can be:

sub mypush(\@@)  # second try
{
    my (@array, @list);
    @array = shift;
    @list = @_;  # the other arguments
    push @array, @list;
    scalar(@array);  # return
}

I orignally botched this by saying:
    @array = @{(shift)};
which means "take the nice reference you were given and copy the value,
loosing any chance of changing the argument."

This also could have been written:

sub myotherpush($@)
{
    my ($array_ref, @list);
    $array_ref = shift;
    @list = @_;  # the other arguments
    push @{$array_ref}, @list;
    scalar(@{$array_ref});  # return
}

if you don't mind calling it something like:

myotherpush \@array, @list;

(What, you were expecting a question? Please feel free to use the code
above as an example in whatever.)
--
Paul S. R. Chisholm, AirMedia, Inc. (formerly Ex Machina)
mailto:psrc@exmachina.com  http://www.exmachina.com/~psrc
I'm not speaking for the company, I'm just speaking my mind


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

Date: 5 Apr 1997 03:42:56 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: getting \@ and \% arguments in prototyped subroutines (with answer)
Message-Id: <5i4ho0$i89@pirate.shu.edu>

Hello -

Paul S R Chisholm <psrc@exmachina.com> writes:

>I take it (having read pp. 118-121 of the 1996 printing of PROGRAMMING
>PERL) that I could write a subroutine:

>sub push(\@@)  # first try
>{
>    my (@array, @list);
>    # code goes here
>}

>The first argument is "an actual argument ... that absolutely must start
>with that character." It's the list we're going to push elements onto.
>The rest of the arguments are consumed by the unbackslashed at sign, and
>are the things we're going to push onto the list. We can just use @_
>after we've gotten the first argument.

>Spending five minutes with the debugger (instead of sending a half-
>baked message all over the Net), I discovered that the first argument to
>mypush() is actually a reference to an array. That means my code can be:

>sub mypush(\@@)  # second try
>{
>    my (@array, @list);
>    @array = shift;

But now @array is an one-element list, that element being a reference
to an array....

>    @list = @_;  # the other arguments
>    push @array, @list;

Now @array also contains a copy of @list, but $array[0] is still a
reference.  You haven't dereferenced anything, so you haven't changed
the array which the reference references.

>    scalar(@array);  # return
>}

>I orignally botched this by saying:
>    @array = @{(shift)};
>which means "take the nice reference you were given and copy the value,
>loosing any chance of changing the argument."

You can still use that syntax as long as you don't just create a copy:

sub mypush(\@@) {
    push @{(shift)}, @_;
}

(This isn't exactly a reimplementation of push(), but I take it the idea
was more to see the prototyping at work.)

>This also could have been written:

>sub myotherpush($@)
>{
>    my ($array_ref, @list);
>    $array_ref = shift;
>    @list = @_;  # the other arguments
>    push @{$array_ref}, @list;
>    scalar(@{$array_ref});  # return
>}

>if you don't mind calling it something like:

>myotherpush \@array, @list;

Actually this subroutine would work with the *other* prototype, because
here you are putting the reference into a scalar instead of an
array, and dereferencing it.  (But as long as you're defining
mypush() in terms of push(), you might as well use the shorter
version above.)  

David Black
dblack@icarus.shu.edu


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

Date: Sat, 05 Apr 1997 02:37:03 GMT
From: tgy@chocobo.org (Tim Gim Yee)
Subject: Re: guestbook (writing to the datafile)
Message-Id: <3345b6eb.201913145@news.seanet.com>

On Thu, 03 Apr 1997 17:26:25 -0500, Brian Lorraine
<lorraine@ait.nrl.navy.mil> wrote:

>up the entire thing when you're trying to view it. As you can see I open
>up the file with a ">>" in front of it... Is there i way i can open this
>datafile so that this one script adds data to EXACTLY the end of the
>string (which is the last "&")? PLEEEASE tell me there is a way or it
>looks like i'm gonna' have to try mess around with the whole script
>again.. thanks a bunch,

I think you might be looking for seek:

open FH, "+<$file" or die "Couldn't open $file to read/write: $!";
seek FH, 0, 2 or die "Couldn't seek: $!"; # Go to end of file.


-- Tim Gim Yee             tgy@chocobo.org
http://www.dragonfire.net/~tgy/moogle.html
"Will hack perl for a moogle stuffy, kupo!"


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

Date: Sat, 05 Apr 1997 19:04:55 GMT
From: kjmurphy@pilot.njin.net (Kevin Murphy)
Subject: Gurus Please Help with Array problem
Message-Id: <33469ed8.324222@199.190.65.4>

I am trying to get perl to create an output from a given input.
The input is of the form:

  Northing    Easting   Elev. Name
 143683.940 325574.285  0.157 1001,ST TB 1+00
 143681.492 325575.371 -2.887 1002,BB 1+00
 143661.554 325583.451 -6.014 1003,CL 1+00
 143634.828 325597.329 -2.077 1004,BB 1+00
 143631.621 325596.991  0.335 1005,END TB 1+00
 143347.304 325293.010 -0.016 1006,ST TB 5+50
 143344.246 325292.233 -2.379 1007,BB 5+50
 143322.694 325292.374 -5.509 1008,CL 5+50
 143294.561 325293.539 -2.480 1009,BB 5+50
 143286.781 325296.475  0.705 1010,END TB 5+50
the output has to look like:
*sta	offset	elev	
1+00	-43.73	1.3	1	*begin line
1+00	-25.16	-3.9	0	*intermediate pnt
1+00	0	-6.3	0
1+00	19.32	-4.7	0
1+00	32.39	0.3	2	*end line

I think I can use split to break up the fields, but where I get into
trouble is with the array.  There might be an easier way, but for now
here is my thought process;

read all line into an array, indexed, 1 thru howerver many lines there
are
search each line for ST or CL or END
now I know the first section starts at line x, the CL is at line Y and
the end for this section is at line Z

now assign north and east of cl to some variables,
pass them to a subroutine that will calc each distance from the CL
using pathagorean theorem from to each shot, note the shots before CL
are negative offsets and after CL are positive,
pass the offset calcs back to array and add for each line


now repeat the process for each number of sections

and write data out in format required.

Any help would be appreciated
please post to group or email to
kjmurphy@pilot.njin.net
tia
kevin
ps will be working on this one all weekend


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

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

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