[6310] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 932 Volume: 7

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 12 05:07:32 1997

Date: Wed, 12 Feb 97 02:00:24 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 12 Feb 1997     Volume: 7 Number: 932

Today's topics:
     Re: 4-arg select() and buffered I/O question (Peter Bierman)
     ANNOUNCE: Graph.pm v0.9 graphing module <mkruse@shamu.netexpress.net>
     Avoiding *massive number of pattern matches (Douglas Burbury)
     Re: Avoiding *massive number of pattern matches (Dave Thomas)
     Re: Avoiding *massive number of pattern matches <dbenhur@emarket.com>
     Re: Can't die from failed open <tchrist@mox.perl.com>
     CGI Script <rockhead@camalott.com>
     Re: Code refs not first class? <tchrist@mox.perl.com>
     Help for a perl program (small and simple) (JACKO1)
     HELP: Pattern Matching Problem <geert.nijs@fys.kuleuven.ac.be>
     Re: HELP: Pattern Matching Problem <tomi.tuominen@tele.inet.fi>
     Re: How to Determine operating system type? (Tad McClellan)
     Re: How to handle a "@" (not "\@") in a string ? <baku@india.ti.com>
     Re: How to tell if Perl is run in debug mode (Ilya Zakharevich)
     Novell Netware Web Server 2.50 <chankct@hkstar.com>
     Re: on the fly graphs (Karl Glazebrook)
     Re: optimization of binary data operations. (Jim Showalter)
     Re: order of FREETMPS and LEAVE <sriram@sirius.com>
     Re: order of FREETMPS and LEAVE (Ilya Zakharevich)
     Re: Parsing several texts to generate a single index te (Tad McClellan)
     Pattern matching and regular expression <fadorno@mail.gte.net>
     Re: Perl on SunOS 4.1.3 (Casper H.S. Dik - Network Security Engineer)
     Re: Perl rand() function on solaris SPARC (Ilya Zakharevich)
     Re: Problem with -dw & use strict (Ilya Zakharevich)
     Programming CGI with Novell Web Server 2.50 <chankct@hkstar.com>
     Re: Sourcing files from my perl script (Tad McClellan)
     Re: USING <SELECT MULTIPLE> WITH PERL FORMS <e8726057@student.tuwien.ac.at>
     Re: Where is PerlTk discussed on Usenet (Tad McClellan)
     Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)

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

Date: Wed, 12 Feb 1997 01:29:00 -0800
From: bierman@apple.com (Peter Bierman)
Subject: Re: 4-arg select() and buffered I/O question
Message-Id: <bierman-1202970129000001@bierpe3.apple.com>

> There are two cases where select and the buffered input operators fall
> over each other.
> 
> 1. An incomplete line is sent to the process. select() will then
> return because there is input. The diamond operator will then block on
> a second sysread() because it wants to combine as many sysread()s as
> necessary to return a full line.

Is the only bad side effect of this that you will block until that socket
recieves a full line?

And an only slightly related question: What's the best way to recover from
a network disconnect? Like a timout, or if the client at the other end
just dies. If I use a SIGALRM, what's the best way to deal with multiple
connections if I'm using select? Is there a better way than SIGALRM?

-pmb

-- 
bierman@apple.com 
http://www.upl.cs.wisc.edu/~lunatic/   "This is MASS MADNESS you MANIACS!"


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

Date: 12 Feb 1997 06:42:57 GMT
From: Matt Kruse <mkruse@shamu.netexpress.net>
Subject: ANNOUNCE: Graph.pm v0.9 graphing module
Message-Id: <5droph$djb@news1-alterdial.uu.net>

Graph.pm version 0.9 is now available from:
     http://www.netexpress.net/~mkruse/perl/

Comments are *definitely* wanted, as this is my first "real" module in 
the whole "real module" packaging.

>From the documentation:

DESCRIPTION 
This module lets you create charts from data and output them
to a GIF image.  It uses GD.pm to do the actual image manipulation.
The goal of this module is to let you have as much or as little
control over the resulting graph as you want.  You can just insert
a few data points and get a graph, or control every aspect of the
graph layout and contents, depending on your needs.  It is intended
for other modules with different graph types (pie chart, line 
graph, etc) to be derived from this class.

-- 
Matt Kruse
mkruse@netexpress.net
http://www.netexpress.net/~mkruse/                  http://www.mkstats.com/
---------------------------------------------------------------------------
Unsolicited advertising of any type to this addresss will not be tolerated.


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

Date: Wed, 12 Feb 1997 08:56:43 GMT
From: dburbury@vision.net.au (Douglas Burbury)
Subject: Avoiding *massive number of pattern matches
Message-Id: <5drt0p$hjl@pandora.vision.net.au>

Regarding the question about replacement of Interleaf tag codes which
I asked earlier, there are a few things about the nature of these tags
that I should have explained better.

>"[@_nnnnnn_@]" is the basic tag structure, where n = 0..9

>e.g.O"[@_000123_@]"ring
>   ->  This tag represents a wrapping hyphen.
> The reconstituted text would be O-ring.

>Other easily inferrable tags include attribute settings (bold, etc), 
>bullets, CR/LF, dashes, tabs, high ASCII characters, etc.

The tag structure defined above is the generic structure, but there is
no one-to-one correspondence between the number inside the delimiters
and the text/attribute the number represents. i.e. although 000123
represents a hyphen in one file, in another file it could be something
entirely different. Moreover, there may be any number of hyphens
within a single file, and each one will be represented by a
differently-numbered tag code. Each tag code appears in numbered
sequence, and is unique for the given file. 

Presumably the relationships between the tags and their definitions
are given in the definition section of the master document, but I
don't have that available to me.

Hence, the only way to infer the meaning of a particular code is to
look at the *context*, which means the meaningful text and numbers
around the code.

This is why a simple associative array with the codes themselves as
the keys and the replacement text as the values is insufficient.

Douglas Burbury


E-mail:  dburbury@vision.net.au
http://www.vision.net.au/~dburbury/burbury.htm	(Burbury family page)
http://www.vision.net.au/~dburbury/server.htm	(Fax server system)



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

Date: 12 Feb 1997 04:27:17 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: Avoiding *massive number of pattern matches
Message-Id: <slrn5g2hfu.9cg.dave@fast.thomases.com>

On Wed, 12 Feb 1997 04:24:37 GMT, Douglas Burbury <dburbury@vision.net.au> wrote:
> 
> e.g.O"[@_000123_@]"ring
>    ->  This tag represents a wrapping hyphen. The reconstituted text
> would be O-ring.
> 
> So I need to replace each tag code with the equivalent text or
> attribute code. The initial way I thought of to do it is to run
> *every* single pattern match on *every* single paragraph.

Could you set up a hash with replacement text, keys on the mark-up, and then
just have a single substitution?

(UNTESTED)

   my %replace = { '@_000123_@' => '-',
                   '@xyz@'      => 'bunny',
		   etc...
		 };
		 
   while (<>) {
      s/\[(.*?)]/$replace{$1} || "??: $1"/eg;
   }

Dave

-- 

 _________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: Tue, 11 Feb 1997 22:08:16 -0800
From: Devin Ben-Hur <dbenhur@emarket.com>
To: Douglas Burbury <dburbury@vision.net.au>
Subject: Re: Avoiding *massive number of pattern matches
Message-Id: <33015E50.4DD3@emarket.com>

Douglas Burbury wrote:
> "[@_nnnnnn_@]" is the basic tag structure, where n = 0..9
> 
> e.g.O"[@_000123_@]"ring
>    ->  This tag represents a wrapping hyphen. The reconstituted text
> would be O-ring.

> But this process still seems grossly inefficient. I wondered if there
> is some functionality in Perl which would make such pattern matching
> operations much faster and accurate than simply bombarding a given
> string with a few hundred matching possibilities.

How about using a hash to look up the appropriate tag
replacement:

%tagstrs = (
    '000123' => '-',
    'xxxxxx' => 'foo',
    'yyyyyy' => 'bar',
    ...
);

s/\"\[\@_(\d+)_\@\]\"/$tagstrs{$1}/eg; # evaluate replacement as expr

If the tags are more complex than that, write a function which takes
the internal part of the tag and returns the string to substitute:

sub replace_tag { my $tag = shift;
    # do stuff
    return $str;	# output from tag transformation
}

s/\"\[\@_(\d+)_\@\]\"/replace_tag($1)/eg; # evaluate replacement as expr

HTH
--
Devin Ben-Hur      <dbenhur@emarket.com>
eMarketing, Inc.   http://www.emarket.com/
"Don't run away. We are your friends."  O-



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

Date: 12 Feb 1997 04:25:16 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Can't die from failed open
Message-Id: <5drgnc$deh$2@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    Larry Rosenberg <ljr@ictv.com> writes:
:I don't understand the behavior of the following program. I don't 
:see why I cannot test for open failing to create a pipe to the output
:of a command.

Because the error happens in the child process after the fork.
See perlipc or chap 6 in the camel.

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


Fungus doesn't take a vacation.  --Rob Pike


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

Date: 12 Feb 1997 03:22:16 GMT
From: "Darrell LaRock" <rockhead@camalott.com>
Subject: CGI Script
Message-Id: <01bc188f$8059f3e0$308c53c6@rockhead.camalott.com>

Does Anyone have a CGI script I can use to send the output of a form into a
file on my system.  (unix based).

Darrell


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

Date: 12 Feb 1997 04:23:40 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Code refs not first class?
Message-Id: <5drgkc$deh$1@csnews.cs.colorado.edu>
Keywords: first class, references

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

In comp.lang.perl.misc, 
    jason@ampersand.com (Jason Brazile) writes:
:Hmmm. It seems as if either code references are not really first class
:or there is some inconsistent syntax on how to get at it that I am 
:failing to grasp. I am still relatively new to the language.
:
:Can you tell me how to access an immediate code ref as in the following
:code?
:
:#	&{sub {print "foo\n"}};			# syntax error
						^^^^^^^^^^^^^^

Fixed in the next release.

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

    echo "I can't find the O_* constant definitions!  You got problems."
            --The Configure script from the v5.0 perl distribution


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

Date: Wed, 12 Feb 1997 08:20:35 GMT
From: toto1@netaphore.com (JACKO1)
Subject: Help for a perl program (small and simple)
Message-Id: <5drve9$kbe@buggy.news.easynet.net>

Hi,

I'm a newbie in Perl and am trying to do the following ...

I want to create a dynamic page which allows ...

By clicking on the link to this page a new page is created on the fly
(by passing arguments through a post  (type of page + page number).

This page must allow :
- to include a .txt file (ie. 12.txt)
- to include navigation facilities as go previous page or next page
(it'll be a call to the script with -1 +1 page numbers) (ie. 11.txt
and 13.txt)

That's all but that's enough for me at this stage ..

Tahnxs for your help

toto1@netaphore.com



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

Date: Wed, 12 Feb 1997 09:56:45 -0800
From: Geert Nijs <geert.nijs@fys.kuleuven.ac.be>
Subject: HELP: Pattern Matching Problem
Message-Id: <3302045D.3D4D@fys.kuleuven.ac.be>

Hi all,

Again a pattern matching problem:

String= "these!are!all!words!geert@fys.kuleuven.ac.be"

Goal: extract everything after the last ! sign
	so I want to get 'geert@fys.kuleuven.ac.be'

The number of ! signs is highly variable and unknown.

Can anyone help me with this ?

GN
Network Manager
University of Leuven


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

Date: Wed, 12 Feb 1997 11:15:02 +0200
From: "Tomi \"2xT\" Tuominen" <tomi.tuominen@tele.inet.fi>
Subject: Re: HELP: Pattern Matching Problem
Message-Id: <33018A16.3147@tele.inet.fi>

Geert Nijs wrote:
> String= "these!are!all!words!geert@fys.kuleuven.ac.be"
> 
> Goal: extract everything after the last ! sign
>         so I want to get 'geert@fys.kuleuven.ac.be'

$string =~ s/^.*!//;

--2xT


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

Date: Tue, 11 Feb 1997 20:12:58 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: How to Determine operating system type?
Message-Id: <av8rd5.8p4.ln@localhost>

Kin Cho (kin@sampras.isi.com) wrote:
: Is there a builtin subroutine or a package call for this?


Yes, but it is operating system dependent  ;-)

uname -a         (for Unix)


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


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

Date: Wed, 12 Feb 1997 09:38:02 +0530
From: Ajitesh Das <baku@india.ti.com>
To: klcho5@student.monash.edu.au
Subject: Re: How to handle a "@" (not "\@") in a string ?
Message-Id: <33014222.7F9D@india.ti.com>

Edmund,
  here in that line you can use single quote (') instead of double quote
("). Actually in perl, this (") does the subs of the string given with
in the double quote
>$txt="http://user:password@abc.ct.monash.edu.au/~cvc/sdc.html?hidval=test";
>  $txt =~ s/$d/$c/g;
          .....................
          ....................
          .....................

>  print "\nfrom user :";print $str3[2];
>  print "\ndata:"; print $str~3[3];
 here "~" is a printing mistake I suppose.

-------------------------------------------
The changed code :
#! /usr/local/bin/perl

 $x = "/";
 $y = "~";
 $z = "+";
 $a = "=";
 $b = "//";
 $c = "\@";
 $d = "@";

# $txt = $ENV{QUERY_STRING};

 $txt
='http://user:password@abc.ct.monash.edu.au/~cvc/sdc.html?hidval=test';
 $txt =~ s/$d/$c/g;

 print $txt;
 print "\n";
 @str1 = split(/$b/,$txt);

#get user name
 print "\n";
 $txt1 = $str1[1];
 @str2 = split(/:/,$txt1);
 print "user name :";print $str2[0];

# get password and data
 $txt2 = $str2[1];
 @str3 = split(/$c/,$txt2);
 print "\npassword :";print $str3[0];
 print "\nfrom server :";print $str3[1];
 print "\nfrom user :";print $str3[2];
 print "\ndata:"; print $str3[3];

exit(0);

Out produced :
http://user:password@abc.ct.monash.edu.au/~cvc/sdc.html?hidval=test

user name :user
password :password
from server :abc.ct.monash.edu.au/~cvc/sdc.html?hidval=test
from user :
data:
Is this what you want...;o)
Regards,
  Ajitesh 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
AJITESH  DAS                       TI INTERNAL MSGID : BAKU
SOFTWARE DESIGN ENGINEER           E-MAIL ID  : baku@india.ti.com
DART GROUP                                      baku@msg.ti.com
EDA SYSTEMS                                     a-das1@ti.com
ASIC                               PHONE:  (091)-(080)-526-9451 
TEXAS INSTRUMENTS INDIA PVT LTD	   Extn: 174
Wind Tunnel Road		   URL:- http://www.india.ti.com/~baku/
Murugheshpalya                                                         
Bangalore- 560017                       
Karnataka                                
India.                                    
"Anything can change any time,in any manner,the whole world is the 
field of all probabilities, all possibility." -- "The Discipline of
Yoga" 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: 12 Feb 1997 09:22:09 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: How to tell if Perl is run in debug mode
Message-Id: <5ds241$phu$2@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Tom Phoenix 
<rootbeer@teleport.com>],
who wrote in article <Pine.GSO.3.95q.970211162026.23091I-100000@julie.teleport.com>:
> On Tue, 11 Feb 1997, Brett Denner wrote:
> I believe you're looking for the $^P variable, documented in perlvar. Hope
> this helps!

Interesting!!! Note that this variable is not mentioned in
perl5db.pl. Probably this chunk of docs is another remnant from
perl4. 

Ilya


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

Date: Wed, 12 Feb 1997 16:08:57 +0800
From: Tony Chan <chankct@hkstar.com>
Subject: Novell Netware Web Server 2.50
Message-Id: <33017A99.5210@hkstar.com>

Hello Dear,

I am now using Novell Web Server as my intranet server, and Novell
bundled with a CGI Interpreter.  I have the following questions:

my homepage listing:

	<html><body bgcolor="#ff4500" text="#ffffff">
	<center><h2>Content</h2></center><br>
	<center><table border=0>
	<TR><TD><FONT SIZE=+1>
	<FORM ACTION="/cgi-bin/deptlink.pl" METHOD="GET"><CENTER>
	<SELECT SIZE=5 NAME="deptid">
	<OPTION VALUE="frame.htm">HOME
	<OPTION VALUE="mis/mis_home.htm">MIS
	</SELECT></CENTER></TD></TR>
	<TR><center><TD>
	<INPUT TYPE="submit" VALUE="Dept. Page">
	</TD></center></TR>
	</FORM></FONT>
	</table></center>
	</body></html>

My CGI program listing:

	$server = "http://".$ENV{"SERVER_NAME"}."/";
	$q_string = $ENV{"QUERY_STRING"};
	$q_string =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex ($1))/eg;
	($field,$html) = split (/=/, $q_string);
	print "Location: $server$html\n\n";

This program will work properly if I input the URL manually in the 
browser location field, 

	eg. (http://www.host.com/cgi-bin/deptlink.pl?mis/mis_home.htm

which will link to the homepage I want but if I select option such as
MIS
from the form and click on submit, the browser will prompt me that no
such 
URL.  I have checked that the form will link to an address:

	(http://www.host.com/www.host.com/mis/mis_home.htm)

I am really confuse about why there are differece between two
situations.
I am not sure about whether this is problem about Novell Web Server's
CGI
interpreter or any error occured in my program or homepage.

In addition, the CGI program listed above will have the following error, 

	PREMATURE EOF WHILE PARSING SCRIPT OUTPUT HEADER.
	PREVIOURS HEADERS WERE:<BR>

if I insert either one the the following two lines in the program:

	require("cgi-bin.pl");
	&ReadParse;

The program will appear the above problem in both situations I mentioned
above.  Do my perl library have bugs?

It will be very appreciated if you can help me to solve the problem or
if 
there is any idea about dynamic link to an URL by using form and CGI and
how
to link to a homepage in a target frame.

Thank you very much for your help and attention.


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

Date: 11 Feb 1997 20:49:17 -1000
From: kgb@aaoepp.aao.gov.au (Karl Glazebrook)
Subject: Re: on the fly graphs
Message-Id: <5drp5d$1a5@pa.jach.hawaii.edu>

In article <01bc17b5$d862bc00$73725ba5@afpc-115>, "Richard S. Boswell" <sboswell@tamu.edu> writes:
>
>I'm trying to write a program that will generate gifs of graphs on the fly
>for web publishing.  I need to generate simple graphs (line,bar,pie) for a
>simulation model.  There is the possibility of thousands of graphs, so to
>conserve disk space, we only want to generate graphs that are needed by a
>certain user.
>
>I figured that I could strip data from text files with perl rather easily. 
>My question is how to get graphs from that data.  Is there an easy way to
>do this without spending a fortune on some COTS product?  It will probably
>be running on an NT box (the simulation model runs on DOS/Windoze/NT), but
>if last comes to last I could run it on a UNIX box (but first I'd have to
>get the data from NT to the other machine...).
>
>thanks,
>sid.
>
>


The PGPLOT and GD modules both do this. PGPLOT is more science-graph
oriented, GD is more pretty-picture oriented but I expect the difference
between them is more a matter of taste than anything else.

I should add that I am the author of the PGPLOT module which links
to Tim Pearson's pgplot library.

I am still surprised no one has done a pure-perl graphics module
generating Postscript.

Karl






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

Date: Tue, 11 Feb 1997 23:35:22 -0500 (EST)
From: gamma@mintaka.iern.disa.mil (Jim Showalter)
Subject: Re: optimization of binary data operations.
Message-Id: <Pine.GSO.3.95.970211225641.16068A-100000@mintaka.iern.disa.mil>

On 11 Feb 1997, Richard J. Duncan wrote:

> I am trying to do some really simple DSP in a perl script. It requires
> the swapping of word order for a stream of data. My current pathetic
> approach is:
> 
> 	while(($len = sysread(PIN,$_,4))>0){
> 		if (/(..)(..)/) {
> 			syswrite(POUT,"$2$1",$len);
> 		}
> }
> 
> Where PIN and POUT are input/output file handles, respectively.
> 
> This is dog slow, I would like to be able to work on 8k of data at a
> time in a memory buffer. Does Perl have anything like a pointer for
> memory?

Your lack of a fully qualified domain name made a courtesy reply
impossible.

Anyway, I'm not certain how efficient this is (I didn't use the
Benchmark module to time it) but you could try taking advantage of the
big-endian, little-endian features of pack and unpack.  The following
might be made better with more thought but this works for me.  If you
just want to swap bytes, the last two pack and unpack statements
can be removed. 

e.g
   
#!/usr/local/bin/perl -w
my $a = "abcdefghijklmnopqrstuvwxyzabcdefjhijklmnopqrstuvwxyz";
my $z = pack "v26", unpack "n26", pack "V13", unpack "N13", $a;
print "$z\n";



You could easily adapt it to larger record sizes.

Hope this helps.
Jim













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

Date: 12 Feb 1997 03:59:02 GMT
From: "Sriram Srinivasan." <sriram@sirius.com>
Subject: Re: order of FREETMPS and LEAVE
Message-Id: <01bc1898$bd369da0$89f586cd@sriramppp.sirius.com>


oops. I said:

> There are some places in the Perl code (perl.c) where LEAVE is
> called after FREETMPS. 
I meant to say LEAVE is called *before* FREETMPS;

> This doesn't seem right, because LEAVE
> would mess up tmps_floor, and FREETMPS would then deallocate 
> all temporaries in the last scope and the current scope. Seems
> to me that it is likely to cause a crash.
> 
> In other words, LEAVE should always be called last.
> Can someone confirm or deny this ?
> 
> Sriram
> (sriram@sirius.com)
> 


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

Date: 12 Feb 1997 09:33:21 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: order of FREETMPS and LEAVE
Message-Id: <5ds2p1$phu$4@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Sriram Srinivasan.
<sriram@sirius.com>],
who wrote in article <01bc1897$cd4f8400$89f586cd@sriramppp.sirius.com>:
> There are some places in the Perl code (perl.c) where LEAVE is
> called after FREETMPS. This doesn't seem right, because LEAVE
> would mess up tmps_floor, and FREETMPS would then deallocate 
> all temporaries in the last scope and the current scope. Seems
> to me that it is likely to cause a crash.
> 
> In other words, LEAVE should always be called last.
> Can someone confirm or deny this ?

If you had 10 ENTER's, you cancel them by 10 LEAVE's. If you feel like
freeing temporaries, you intersperse them with FREETMPS in whatever
order you find relevant. Somewhere in this equation SAVETMPS may enter
too ;-) - their effect is forgotten when the enclosing LEAVE is
performed.

Ilya


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

Date: Tue, 11 Feb 1997 20:14:52 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Parsing several texts to generate a single index text?
Message-Id: <s29rd5.8p4.ln@localhost>

Raul Almquist (strider@shadowmac.org) wrote:

:   Looking for a perl parsing example that will show me how to compile 
: several texts, each text containing the descriptives relating to the text 
: the descriptives are inside of, the descriptives are contained in a set 
: of fields, one field equals one line of text, with each field/line ending 
: in a LF.

:   There are 24 field/lines in each text, and I need to parse all the 
: texts with the extension of ".hqx" contained inside a specific directory 
: (not the dir where the script will be located) and generate a 00index.tab 
: (fields 
: delimited by tabs and records delimited by a LF) from those texts.

:   Each line provides a different type of textual data (date, version, 
: terse one line stand-alone description, verbose description, author's 
: info, support site, etc...), so I need to take that data from all of 
: those texts and generate a single tab delimited text.

:   Any ideas on where an example can be located that will point me to 
: accomplishing this?


Well, if you would post some sample input data, and the output
you want from that sample data, someone might be able to take
a crack at helping you...


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


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

Date: Wed, 12 Feb 1997 01:46:00 -0800
From: Fred Adorno <fadorno@mail.gte.net>
Subject: Pattern matching and regular expression
Message-Id: <33019158.4475@mail.gte.net>

Gentlemen,

I like to be able to find every word that begins with a character and
ends with that same character in my dictionary using perl.  I can do it
using vi, ed and shell scripting but I can't seem to get it to work with
perl.  Any suggestions?

This is how it works with the editors:

^\(.\).*\1$


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

Date: 12 Feb 1997 09:17:37 GMT
From: Casper.Dik@Holland.Sun.COM (Casper H.S. Dik - Network Security Engineer)
Subject: Re: Perl on SunOS 4.1.3
Message-Id: <casper.855739202@uk-usenet.uk.sun.com>

Jason Warner <jwarner@mitre.org> writes:

>ar rcu libperl.a perl.o malloc.o gv.o toke.o perly.o op.o regcomp.o
>dump.o util.o mg.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o
>pp_sys.o doop.o doio.o regexec.o taint.o deb.o globals.o 
>gcc  -L/usr/local/lib -o miniperl miniperlmain.o libperl.a -lnsl -lgdbm
>-ldbm -ldl -lm -lc -lposix 
>/usr/local/gnu/ld: No such file or directory for libdl.a
>collect2: ld returned 1 exit status
>make: *** [miniperl] Error 1

This looks like a GNU configuration problem to me.  You're using collect2
*and* GNU ld.   In addition, you're using a version of GNU ld which
doesn't understand dynamic linking.

SInce you're using collect2, you already have a means to run C++ constructors
and using GNU ld isn't necessary.  Make sure the compiler picks up
the system's own linker (/usr/bin/ld) and you'll get a dynamically linked
perl.

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.


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

Date: 12 Feb 1997 09:18:37 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Perl rand() function on solaris SPARC
Message-Id: <5ds1td$phu$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Tom Phoenix 
<rootbeer@teleport.com>],
who wrote in article <Pine.GSO.3.95q.970211153653.23091E-100000@julie.teleport.com>:
> 
>     perl -MConfig -e 'print $Config{randbits},$/'

I hope you just mistyped
	perl -V:randbits
;-)

Ilya


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

Date: 12 Feb 1997 09:26:39 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Problem with -dw & use strict
Message-Id: <5ds2cf$phu$3@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Tom Lynch 
<toml@synnet.com>],
who wrote in article <3300AF8A.5BE9@synnet.com>:
> Greetings:
> 
> 	One of the system admins here has a script which runs 
> 	just fine with the "-w" & "use strict;" but when I 
> 	add the "-d" for debugging I get:
> 
> Can't use string ("DB::dbwarn") as a subroutine ref while "strict refs"
> in use.

Upgrade/downgrade. 5.005_02 is _very_ as dev-releases go.

Ilya


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

Date: Wed, 12 Feb 1997 15:45:18 +0800
From: Tony Chan <chankct@hkstar.com>
Subject: Programming CGI with Novell Web Server 2.50
Message-Id: <3301750E.3641@hkstar.com>

Hello Dear,

I am now using Novell Web Server as my intranet server, and Novell
bundled with a CGI Interpreter.  I have the following questions:

my homepage listing:

	<html><body bgcolor="#ff4500" text="#ffffff">
	<center><h2>Content</h2></center><br>
	<center><table border=0>
	<TR><TD><FONT SIZE=+1>
	<FORM ACTION="/cgi-bin/deptlink.pl" METHOD="GET"><CENTER>
	<SELECT SIZE=5 NAME="deptid">
	<OPTION VALUE="frame.htm">HOME
	<OPTION VALUE="mis/mis_home.htm">MIS
	</SELECT></CENTER></TD></TR>
	<TR><center><TD>
	<INPUT TYPE="submit" VALUE="Dept. Page">
	</TD></center></TR>
	</FORM></FONT>
	</table></center>
	</body></html>

My CGI program listing:

	$server = "http://".$ENV{"SERVER_NAME"}."/";
	$q_string = $ENV{"QUERY_STRING"};
	$q_string =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex ($1))/eg;
	($field,$html) = split (/=/, $q_string);
	print "Location: $server$html\n\n";

This program will work properly if I input the URL manually in the 
browser location field, 

	eg. (http://www.host.com/cgi-bin/deptlink.pl?mis/mis_home.htm

which will link to the homepage I want but if I select option such as
MIS
from the form and click on submit, the browser will prompt me that no
such 
URL.  I have checked that the form will link to an address:

	(http://www.host.com/www.host.com/mis/mis_home.htm)

I am really confuse about why there are differece between two
situations.
I am not sure about whether this is problem about Novell Web Server's
CGI
interpreter or any error occured in my program or homepage.

In addition, the CGI program listed above will have the following error, 

	PREMATURE EOF WHILE PARSING SCRIPT OUTPUT HEADER.
	PREVIOURS HEADERS WERE:<BR>

if I insert either one the the following two lines in the program:

	require("cgi-bin.pl");
	&ReadParse;

The program will appear the above problem in both situations I mentioned
above.  Do my perl library have bugs?

It will be very appreciated if you can help me to solve the problem or
if 
there is any idea about dynamic link to an URL by using form and CGI and
how
to link to a homepage in a target frame.

Thank you very much for your help and attention.


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

Date: Tue, 11 Feb 1997 19:54:42 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Sourcing files from my perl script
Message-Id: <2t7rd5.5m4.ln@localhost>

Charles Peri - EUCD ~ (cperi@pcocd2.intel.com) wrote:

: 	I am trying to source a file which sets env variables
: from inside my perl script. Since I need these env variables 
: later in my program, I have to get the vaiables set by
: the source command.

: For example :
: if file, "file_to_source" has
: setenv NAME some_name
: setenv VAR1 varable1
: setenv VAR2 variable2


: Inside my perl script, I need to source the above file and
: should be able to use later VAR1 and VAR2.

: I know if I use system command to source the file, it spawns a
: process to spawn, so all the env variables are lost !!

: Can anyone help me in this situation!


How about parsing the file from within your script?

Something like (UNTESTED):

open(SOURCE, "file_to_source") || die "could not open file_to_source $!";
while (<SOURCE>) {
   if (/^setenv\s+(\S+)\s+(.*)$/) {
      $ENV{$1} = $2;
   }
}
close(SOURCE);


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


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

Date: Wed, 12 Feb 1997 10:35:35 +0100
From: Klaus Johannes Rusch <e8726057@student.tuwien.ac.at>
Subject: Re: USING <SELECT MULTIPLE> WITH PERL FORMS
Message-Id: <33018EE7.2BF3@student.tuwien.ac.at>

Adam M. Donahue wrote:
> 
> How do you get ALL the data from a multiple SELECT form?  Using a perl
> script with a standard call to $FORM{'favorites'} say, where I want the
> user to choose three of fifty options using the CTRL key, how do you
> extract this data?  The $FORM{'favorites'} only returns one (the last I
> believe) choice selected from the list.

The data are passed to the client as individual fields, like this:

/cgi-bin/script.pl?favorites=mocha&favorites=vanilla&favorites=crema

If your form processing program gets only one of them your program needs
to be fixed. A common way of handling multiple options is storing them
as comma delimited list (at least, that's the way webmonitor works).

Klaus Johannes Rusch
--
e8726057@student.tuwien.ac.at, KlausRusch@atmedia.net
http://www.atmedia.net/KlausRusch/


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

Date: Tue, 11 Feb 1997 19:49:54 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Where is PerlTk discussed on Usenet
Message-Id: <2k7rd5.5m4.ln@localhost>

David Ransier (davidr@wv.mentorg.com) wrote:
: Is there a special news group for discussions on PerlTk?

comp.lang.perl.tk


: If this is it, then does anyone know when PerlTk will be supported 
: on Win32 platforms?  Since both Perl and Tk exist on Win32, it would
: seem that PerlTk should follow soon.


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


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

Date: 8 Jan 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Jan 97)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V7 Issue 932
*************************************

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