[6544] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 170 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 24 19:07:55 1997

Date: Mon, 24 Mar 97 16:01:39 -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           Mon, 24 Mar 1997     Volume: 8 Number: 170

Today's topics:
     Perl training in Australia? (Gary Ashton-Jones)
     Posting to Newsgroups from Perl Script (Marc Dworkin)
     Request: Perl  Compiler for Win95 <sarmas@ing.puc.cl>
     Re: Request: Perl  Compiler for Win95 (Nathan V. Patwardhan)
     Serializing Stateless Requests for File Access <gabriele@clotho.com>
     SIG{'CHLD'} problem with perl5.005_28 on Solaris 2.5 (Wendy Lin)
     sleep dumps core on SunOS-Solaris combo (Colin Kuskie)
     Sorting using SPRITE cguevara@velu.com
     Re: Taking parameters from scrollboxes and then display (Craig A. Keefner)
     Re: term 'regular expressions' considered undesirable (Rahul Dhesi)
     Re: term 'regular expressions' considered undesirable (Bennett Todd)
     Re: Unix and ease of use  (WAS: Who makes more ...) (Mats Forssblad)
     Re: What's a good Perl book? <blongwor@student.umass.edu>
     XSUBS and *GLOBS <shindle@genuity.net>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 24 Mar 1997 13:51:41 +1100
From: garyaj@geko.com.au (Gary Ashton-Jones)
Subject: Perl training in Australia?
Message-Id: <garyaj-2403971351410001@dialup1098.sydney.geko.net.au>

Does anyone know of anyone teaching Perl in Australia to commercial
organisations?


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

Date: 24 Mar 1997 19:38:11 GMT
From: marcus@force.stwing.upenn.edu (Marc Dworkin)
Subject: Posting to Newsgroups from Perl Script
Message-Id: <5h6l73$5iv@netnews.upenn.edu>



(How) Can I post to a Newsgroup from a Perl script?

marc


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

Date: Mon, 24 Mar 1997 17:37:35 -0400
From: Juan Sebastian Armas Maturana <sarmas@ing.puc.cl>
Subject: Request: Perl  Compiler for Win95
Message-Id: <3336F41E.77C4@ing.puc.cl>

Hello:

 I've recently installed Perl for Win32, V 5.003. It has worked OK
in Win95 (on the first try) with some UNIX binaries as source files 
for a .pl file (that was also written in UNIX). I can only say: cool!

 Next, I downloaded the Perl Compiler Kit, Version alpha3, so I could
generate a DOS (under Win95) executable from my .pl file. I've already
RTFM of the compiler installation...to no avail. I'm not able to (ahem)
compile the Perl's compiler, because perl cannot properly generate a
makefile for the compiler (using a makefile.pl included with the Kit)...

 ...so I'm stuck.

 I can _still_ use the .pl file OK (it does work, taking ages to),
but I'll need to port it to a PC that won't have Perl installed (ever).

 Does anybody know of an _already_ compiled compiler for Perl@Win95??

 Had anybody the same problem I'm having?

 Any suggestions/hints/helps/links are welcome.

 Thanks in advance, 

				Juan Sebastian Armas Maturana	
                                   Ingeniero de Proyectos
  				    ComCor - DICTUC S.A.
				     sarmas@ing.puc.cl


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

Date: 24 Mar 1997 22:38:38 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Request: Perl  Compiler for Win95
Message-Id: <5h6vpe$dj@fridge-nf0.shore.net>

Juan Sebastian Armas Maturana (sarmas@ing.puc.cl) wrote:

:  Next, I downloaded the Perl Compiler Kit, Version alpha3, so I could
: generate a DOS (under Win95) executable from my .pl file. I've already
: RTFM of the compiler installation...to no avail. I'm not able to (ahem)
[snip]

Unfortunately, you're stuck for the moment (using this method), because 
Activeware's Perl doesn't support makemaker.  Future versions of Perl (like
Perl 5.004) will support Win32 builds.

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: Mon, 24 Mar 1997 11:57:15 -0600
From: Gabriele R Fariello - 608-576-8660 <gabriele@clotho.com>
Subject: Serializing Stateless Requests for File Access
Message-Id: <3336BFC7.78D2BBB0@clotho.com>

I was hoping to find out if any one out there knew of or had developed a
reliable way to serialize requests for file access in a stateless
environment. Let me explain:

I have a CGI application for multiple technologists supporting over
70,000 end-users. The technologists need to be able to edit files by
requesting the file via HTTP protocol and make changes to those file via
the POST method. The PID for each request is different, but the UserName
of the technologist remains constant.

It seems that I cannot rely on flock or other file locking methods that
I am aware of because the lock goes away when the requesting process
dies (and it does not serialize requests). 

It also seems like I cannot assume that between the time that a process
checks to see if a lock-file exists and the time that it writes out to
the lock-file, that some other process has not done the same because
checking and writing _always_ take enough time for another process to
have checked before this process and have written after it has checked
but before we have written. The result if that both processes think they
have the go-ahead.

Is there a way in Perl to open a file for writing if and only if it does
not exist in one system call?

I would be MOST interested in getting a mechanism to actually serialize
the requests such that file access is granted on a
first-come-first-serve basis as opposed to a competative and ramdom
assignment which uses the whichever-process-happens-to-get-the-
lock-first when it frees up method.

If this is confusing, it's because I'm not writing code, and I no longer
know how to write in English ;) But I would be happy to try and clarify.
Likewise, feel free to tell me that I'm off my rocker, but please tell
me why.

-- 
Gabriele R. Fariello  | Clotho Internet Consulting
gabriele@clotho.com   | 33 University Square No. 251
(608)-576-8660        | Madison, WI  53715


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

Date: 24 Mar 97 11:22:25 EST
From: af5@quest.cc.purdue.edu (Wendy Lin)
Subject: SIG{'CHLD'} problem with perl5.005_28 on Solaris 2.5
Message-Id: <5h6ac1$q54@mozo.cc.purdue.edu>

I built a version for AIX systems and have not had problems.  But when
the following script ran on Solaris, children became <defunct>.

First the script:

	#!/usr/local/bin/perl -w
	 
	$SIG{'CHLD'} = 'IGNORE';
	 
	# Things work if I have my own signal handler!
	#$SIG{'CHLD'} = \&myHandler;
	 
	print "I am the parent with pid $$\n";
	if(!fork()) {
	  print "I am child #1 with pid $$\n";
	  print "Child #1 Exiting\n";
	  exit;
	}
	if(!fork()) {
	  print "I am child #2 with pid $$\n";
	  print "Child #2 Exiting\n";
	  exit;
	}
	print "\nWaiting 1 Second...\n";
	sleep(2);
	print "Running `ps -g $$'\n\n";
	system("ps -g $$");
	print "\n";
	 
	 
	sub myHandler
	{
	  wait;
	}

Now the output:

	I am the parent with pid 6730
	I am child #1 with pid 6731
	Child #1 Exiting
	I am child #2 with pid 6732
	Child #2 Exiting
	 
	Waiting 1 Second...
	Running `ps -g 6730'
	 
	   PID TTY      TIME CMD
	  6733 pts/1    0:00 ps
	  6731          0:00 <defunct>
	  6732          0:00 <defunct>
	  6730 pts/1    0:00 perl
	 
Can anyone help with this?

Thanks,
Wendy Lin
-------------
Purdue University Computing Center
af5@purdue.edu
http://www-rcd.cc.purdue.edu/~af5/


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

Date: 24 Mar 1997 09:24:35 -0800
From: colink@latticesemi.com (Colin Kuskie)
Subject: sleep dumps core on SunOS-Solaris combo
Message-Id: <5h6dcj$ong@defiant.latticesemi.com>

Greetings, all!
Here at Lattice we've recently upgraded all of our machines to Solaris
(which had the nice side benefit of getting me a new Ultra :)
However, since there are still machines around running SunOS,
all software has to be compiled under SunOS, and the Ultra's
will run it in 'compatibility mode', except for this one-liner
in perl:

perl5 -e 'sleep 1;'

This causes a core dump.

Here's the scoop:
perl, version 5.002
compiled on a SS20 running SunOS 4.1.3_U1 1 sun4m
I believe that cc was used to compile perl.

Thanks for your help,
Colin Kuskie
colink@latticesemi.com



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

Date: Mon, 24 Mar 1997 16:21:21 -0600
From: cguevara@velu.com
To: pguevara@velu.com
Subject: Sorting using SPRITE
Message-Id: <859241590.32615@dejanews.com>

We are trying to use SPRITE to create databases that can be accessed
via the WEB....

We do need however to have the results of queries sorted by particular
fields in the data.  We have downloaded the info for SPRITE, but can't
find anywhere where it says we can do order by or sort by statements...

Is this feature not implemented????  Is there an easy way to sort
out the data, specially considering that the output may be several
rows containing many columns????

ANY HELP WILL BE GREATLY APPRECIATED!

THANKS...BYE!

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


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

Date: 24 Mar 1997 07:11:01 -0700
From: keefner@primenet.com (Craig A. Keefner)
Subject: Re: Taking parameters from scrollboxes and then displaying a particular html file
Message-Id: <3336358b.3111243@news.primenet.com>

On Sun, 23 Mar 1997 20:41:25 GMT, shyde@poboxes.com (Simon Hyde (aka
Jeckyll)) wrote:

>On 22 Mar 1997 08:17:01 -0700, keefner@primenet.com (Craig A. Keefner)
>wrote:
>
>>I want to take input parameters from 2 select boxes and then
>>if/an pazrameters equal something, then display a certain
>>html file.
>>

that was real close Simon. thanks very much.
I still am struggling to get it to perform;
I took the if param1 eq && param2 eq and reduced it to just
one select to try and jump to an external url and failed
miserably.


Craig


use CGI;
$q = new CGI;
if ($q->param()){
	unless(defined($q->param('param1')) &&
defined($q->param('param2'))){
		print $q->header(-status=>'500 Internal Server
Error');
		print $q->start_html('Internal Server Error'),
$q->h1('Internal Server Error');
		print "One of the required fields was not filled out,
please correct the form below and re-submit:";
		print $q->p;
	}else{
		while (<DATA>){
			next if /^\s*$/;
			chomp;
			($param1, $param2, $url) = split(/\t+/);
            if($param1 eq '3'){
				print $q->redirect($url);
				exit;
			}
		}
		print $q->header, $q->start_html('Error'),
$q->h1('Error - Field combination not found');
		print "Please fill out the form below and re-submit
with different values:", $q->p;
	}
}else{
	print $q->header, $q->start_html('Submit Boxes');
	print $q->h1('Submit Boxes'), $q->hr, "Please fill out and
submit this form:", $q->p;
}
while (<DATA>){
	next if /^\s*$/;
	($param1, $param2, $url) = split(/\t+/, $_);
	$FIRST{$param1} = 1;
	$SECOND{$param2} = 1;
}
print $q->start_form;
print $q->h3('CPAN Site: ' . $q->popup_menu(-name=>'param1',
-values=>['1','2','3'],[sort(keys(%FIRST))]));
print $q->h3('CPAN Area: ' . $q->popup_menu(-name=>'param2',
-values=>['4','5','6','1'],[sort(keys(%SECOND))]));
print $q->submit(-value=>'Go There'), $q->end_form;
print $q->end_html;
__END__


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

Date: 24 Mar 1997 18:23:04 GMT
From: c.c.eiftj@33.usenet.us.com (Rahul Dhesi)
Subject: Re: term 'regular expressions' considered undesirable
Message-Id: <5h6gq8$g4l@samba.rahul.net>

>   /^a.*?b.*?c/  # non-greedy, no backtracking, fast, regular expression

To see why /^a.*?b.*?c/ does not require backtracking, implement it as a
finite state machine, as described below.  Begin in state 'start'.  The
state machine scans its input and makes a state transition on each input
character.  Once we have seen an input character and made a state
transition we never need to examine that character again.  Hence no
backtracking.  EOF represents the end of the input stream:

   start: if input is 'b' go to state 'sawb' else if input is EOF
          go to state 'fail' else go to (aka remain in) state 'start'.
   sawb:  if input is 'c' go to state 'done' else if input is EOF
   	  go to state 'fail' else go to state 'sawb'.
   done:  declare a match.
   fail:  declare failure.

Note that 'does not require backtracking' means 'at least one
implementation does not require backtracking'.
-- 
Rahul Dhesi <dhesi@spams.r.us.com>
a2i communications, a quality ISP with sophisticated anti-junkmail features
** message body scan immune to fake headers ***   see http://www.rahul.net/
>>> "please ignore Dhesi" -- Mark Crispin <mrc@CAC.Washington.EDU> <<<


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

Date: Mon, 24 Mar 1997 20:52:49 GMT
From: bet@nospam.interactive.net (Bennett Todd)
Subject: Re: term 'regular expressions' considered undesirable
Message-Id: <slrn5jdqd1.6vh.bet@onyx.interactive.net>

On 24 Mar 1997 18:23:04 GMT, Rahul Dhesi <c.c.eiftj@33.usenet.us.com> wrote:
>To see why /^a.*?b.*?c/ does not require backtracking, implement it as a
>finite state machine, as described below.

>   start: if input is 'b' go to state 'sawb' else if input is EOF
>          go to state 'fail' else go to (aka remain in) state 'start'.
>   sawb:  if input is 'c' go to state 'done' else if input is EOF
>   	  go to state 'fail' else go to state 'sawb'.
>   done:  declare a match.
>   fail:  declare failure.

Unless I'm missing something, you need another state; perhaps rename "start"
to "sawa" and add

    start: if input is 'a' go to state 'sawa' else if input is EOF
           go to state 'fail' else go to (aka remain in) state 'start'.

-Bennett


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

Date: Mon, 24 Mar 1997 22:39:14 GMT
From: froz@algonet.se (Mats Forssblad)
Subject: Re: Unix and ease of use  (WAS: Who makes more ...)
Message-Id: <5h7009$21@epimetheus.algonet.se>

rw26@acf2.nyu.edu (Randy Wright) wrote:
>much more like the model of Microsoft. Linux is not controlled.
>It cannot be made unprofitable. It is built BY its market and
>it becomes whatever that market wants it to be as the market
>decides what it wants.
Sure. Wait for MsLinux :-)



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

Date: Mon, 24 Mar 1997 16:52:08 -0500
From: Brett Longworth <blongwor@student.umass.edu>
Subject: Re: What's a good Perl book?
Message-Id: <3336F784.24A5@student.umass.edu>

slacker@dixonillinois.com wrote:
> Here's a real newbie answer, from a guy that came straight out of
> Dos/Win with no prior programming experience.
>  Find a good book on UNIX.
>  Every Perl book I've seen (including the camel and llamma books) take
> for granted you've mastered UNIX. A good part of the explanations go
> like this, "The ? works just like the UNIX ? function." with a little
> non-unix explanation following.
>  A decent Unix book for beginners is UNIX Made Easy by Muster, ISBN
> 0-07-882173-8
> 
> Then the llamma book although the first chapter is a doosy until you
> figure out what it's referring to in the later chapters.
> 
> This of course does not apply to all the people who already know UNIX
> but if you are coming from a different platform you'll go a lot
> farther a lot faster with the UNIX book just there for the reference.
> 
> Greg McKean
> Just another Slacker
> slacker@dixonillinois.com

I would absolutely agree.  I've been diving headfirst into perl, and
UNIX, shells, and vi as a result.  Once one of any of these starts to
make sense, they all do.  Once you get comfortable with unix basics, get
something like UNIX in a Nutshell from O'reily- it's probably the best
9.95 you'll spend if you work with unix alot.

-Brett


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

Date: Mon, 24 Mar 1997 13:30:34 -0700
From: Steve Hindle <shindle@genuity.net>
Subject: XSUBS and *GLOBS
Message-Id: <3336E46A.6729@genuity.net>

Hi All,

   I have been wondering how to assign a existing FD to a (existing ??)
Filehandle within a XSUB ??  

  For instance: I have a XSUB that uses sendmsg to receive FD's from
another process and I would like to call it :
    
          $result = rcv_fd( SOCK_FH, RECV_FH);
  
  BUT I get a FD back from recvmsg..Also, I currently have to call it 
with the FD of SOCK_FH.  All this Fileno() and open("<&..") stuff is 
annoying, so I would like the XSUB to get the FD of SOCK_FH from perl.
And since I get a FD, I would like to point RECV_FH at it without duping
it.

Any Help would be appreciated !!
Steve


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

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

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