[6496] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 121 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 15 01:07:36 1997

Date: Fri, 14 Mar 97 22:00:21 -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           Fri, 14 Mar 1997     Volume: 8 Number: 121

Today's topics:
     Re: [HELP] !@#$% sort subroutines... (Brian L. Matthews)
     Re: [HELP] !@#$% sort subroutines... <fawcett@nynexst.com>
     Re: Can you help me with this script? <walton@frontiernet.net>
     CGI Security Scripts <Shadow@r56h108.res.gatech.edu>
     Re: Elegant way to strip spaces off the ^ and $ of a va (Charles DeRykus)
     Re: Elegant way to strip spaces off the ^ and $ of a va <merlyn@stonehenge.com>
     Re: eval prematurely exitting on syntatically correct c <rootbeer@teleport.com>
     Help modifying functioning script <areed@mphs.com>
     Re: Is globbing still useful? (Tim Gim Yee)
     isqlperl4 and the Future (Brian Wilson)
     Method not implemented <rvince@sprynet.com>
     Oracle and Perl5 <astone@sprintmail.com>
     Perl Question <mstich@erols.com>
     Problem!!!! NT 4.0, Oracle 7.3.2.2.0, Perl 5 (Build 303 <astone@sprintmail.com>
     Problems with stdio in perl 5.003 <J.S.Peatfield@damtp.cam.ac.uk>
     Re: random perl core dumps with obscure message (Ilya Zakharevich)
     Re: sort large array (Tim Gim Yee)
     sourcing (bash) config files within perl <lauriem@cstr.ed.ac.uk>
     term 'regular expressions' considered undesirable (Rahul Dhesi)
     Re: Unpack Cobol Comp-3 data <billc@tibinc.com>
     Re: What's a good Perl book? <lauriem@cstr.ed.ac.uk>
     Re: What's wrong with "an email" (was: How to spam - le (Dennis Marti)
     Re: year 2000 question (Jeffrey)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 14 Mar 1997 17:57:16 -0800
From: blm@halcyon.com (Brian L. Matthews)
Subject: Re: [HELP] !@#$% sort subroutines...
Message-Id: <5gcvls$kvu$1@halcyon.com>

In article <3329D19B.7830@tibinc.com>, Bill Cowan  <billc@tibinc.com> wrote:
|mblase@ncsa.uiuc.edu wrote:
|> sub Alphabetical {
|>   local($a,$b) = @_;
|    ^^^^^^^^^^^^^^^^^^
|Delete this line.

Not unless you really want the source array entries to be mangled as
well. If you want to preserve the source array, change the local to
something like:
my ($x, $y) = ($a, $b);
and then mangle and compare $x and $y.

Of course, this will be mind-numbingly slow, because you'll end up
modifying entries a number of times. A better bet would be to create
a secondary array consisting of the mangled entries, then sort that.

|>     s/^a?\s+//;                         # remove either 'a' or 'an'

Informative aside: That actually just removes leading 'a's. This:
s/^an?\s+//;
will handle both 'a' and 'an'.

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


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

Date: 14 Mar 1997 22:43:04 -0500
From: Tom Fawcett <fawcett@nynexst.com>
Subject: Re: [HELP] !@#$% sort subroutines...
Message-Id: <8j67ytakhj.fsf@nynexst.com>

mblase@ncsa.uiuc.edu writes:
> I know I have the syntax right, because the thing runs. It even runs
> in the debugger. The only thing it doesn't do is sort the array
> it's given. Could some kind soul glance through this and tell me
> what I'm doing wrong?
> 
> Thanks in advance --
> 
> -- Marty Blase
>    mblase@ncsa.uiuc.edu
> 
> 
> sub AlphaSort {
>   local(@array) = @_;
>   return sort Alphabetical @array;     # return the sorted array
> }
> 
> sub Alphabetical {
>   local($a,$b) = @_;
    ^^^^^^^^^^^^^^^^^
Eh, no.  The args of a sorting predicate are passed via $a and $b.  You
shouldn't assign to $a and $b from @_.  

>   foreach($a,$b) {
>     tr/A-Z/a-z/;
>     s/^\s+//;                           # remove any leading whitespace
>     s/^the\s+//;
>     s/^a?\s+//;                         # remove either 'a' or 'an'
>   }
>   return $a cmp $b;
> }

And you probably don't want to do this conversion each and every time you
compare two elements.

-Tom


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

Date: Fri, 14 Mar 1997 22:19:11 -0500
From: Bob Walton <walton@frontiernet.net>
Subject: Re: Can you help me with this script?
Message-Id: <332A152F.46C@frontiernet.net>

Bob, your script runs verbatim in my perl (5.001 for win32), with
only a change to put the output to a file instead of /dev/ctp,
since Win32 doesn't have devices, or not at least ones that
are accessable that way.  So I don't think your problem 
is perl syntax.  The program, though, does have some serious logic
trouble -- $hazard and $premium are left with the values from the 
last line in "stuff" when "stuff" is closed, so the previous values 
aren't available.  I think you probably want to stuff $hazard and 
$premium into hashes indexed by $beastie so the values can be 
retrieved in your while(1) loop.  Something like:

open(STUFF, "stuff.txt") || die "Can't open stuff: $!\n";
open(CTP, ">ctp") || die "can't open /dev/ctp: $!\n";
while(<STUFF>) {
($beastie,$hazard, $premium,)
=split(/:/, $_); 
$haz_hash{$beastie}=$hazard;
$prem_hash{$beastie}=$premium;
}
close STUFF;
while(1) {
print "letter for which beastie: ";
chop($beastie = <STDIN>);
last unless $beastie;
print CTP <<"EndOfLetter";
Dear People:
find enclosed $prem_hash{$beastie} of the annual premium for insuring
my $beastie against $haz_hash{$beastie}.
EndOfLetter
print CTP"\f";
}

That will generate either the camels or the sheep message depending
on whether sheep or camels is entered.

BOB wrote:
> 

> 4. But the script doesn't work: macPerl give me the following error:
> 
> #Missing right bracket, at end of line
>


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

Date: 15 Mar 1997 03:21:48 GMT
From: "Shadow" <Shadow@r56h108.res.gatech.edu>
Subject: CGI Security Scripts
Message-Id: <01bc30ef$61e13f40$0f02000a@shadow>

does Anybody know where I can find some examples of a cgi Login script,
that prompts for a username and a password and refers to a file to check
names and passwords ?


-- 
shadow@full-moon.com 
http://128.61.56.108/~shadow/


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

Date: Sat, 15 Mar 1997 01:05:56 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Elegant way to strip spaces off the ^ and $ of a variable containing a sentence.
Message-Id: <E728Dx.6L0@bcstec.ca.boeing.com>

In article <qum7mjbr1iv.fsf@cyclone.stanford.edu>,
Russ Allbery  <rra@cs.stanford.edu> wrote:
>Tom Christiansen <tchrist@mox.perl.com> writes:

 > ...The return value of print is regularly annoyed, for example.

                            
Is that because it was dealing with something unprintable ... :)


Ducking,

--
Charles DeRykus


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

Date: 14 Mar 1997 21:32:37 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: crusso@alink.net (Chris Russo)
Subject: Re: Elegant way to strip spaces off the ^ and $ of a variable containing a sentence.
Message-Id: <8csp1xydui.fsf@gadget.cscaper.com>

>>>>> "Chris" == Chris Russo <crusso@alink.net> writes:

Chris> I mean, these are the same guys who included:

Chris> select((select(STDERR), $| = 1)[0])

Chris> in the manual that *they* wrote.  :) Yes, I know that there's a
Chris> comment of its being "bizarre and obscure", but by including it
Chris> and from the fact that I've never seen its usage disparaged
Chris> here, it seems to be "bizarre and obscure but accepted".
Chris> Meanwhile, the map thing isn't bizarre, but it's a little
Chris> obscure and *not* accepted.

I wrote that, and I have repented since that time.  I'm no longer
"randal the clever hack author".  I'm trying to stay a little more
mainstream these days.  map and grep in a void context... Ick. :-)

On the other hand, many people have written me to tell me that the
Schwartzian Transform is second only to sliced bread.  Cool.

Chris> pot, kettle... black?

pot, flower... green!

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

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


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

Date: Fri, 14 Mar 1997 19:25:13 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: rhills@leupstv.com
Subject: Re: eval prematurely exitting on syntatically correct code
Message-Id: <Pine.GSO.3.95q.970314192251.11801E-100000@linda.teleport.com>

On Fri, 14 Mar 1997 rhills@leupstv.com wrote:

> I am attempting to implement PLEXUS on a HPUX 9.04 system running
> perl 5.001. 

Then there's a pretty good chance that you've found a bug which has been
fixed in the many moons since 5.001 was released. Would you try testing
the beta version of 5.004 (not for production, just for testing) and see
whether it still has that bug? If it does, the Perl developers will be
eager to fix it for 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: Fri, 14 Mar 1997 17:43:35 -0800
From: Alison Reed <areed@mphs.com>
Subject: Help modifying functioning script
Message-Id: <3329FEC7.6902@mphs.com>

Hi, I'm Alison and I'm trying to generate several thousand html pages
from a perl script.
I need help with altering a functional script.

Here's what I'm doing:
1. perl script-which works, but only reads one record at a time and
generates a page based on that record. I need it to read several records
and then generate a page.
2. html template (state.template)-has variables defined that match field
names from my text based table.
3. text-based table (state.txt)

Here's the script (running on Win95/Perl5):
-----------------------------------------
#!/perl5

# =-=-= The variable setting part 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

# where the text-based table is stored
$database = "c:/statescript/state.txt"; 

# the html template      
$template = "c:/statescript/state.template";  

#
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


open (F, $database) || die "Couldn't open file $database: $!\n";

$firstline = <F>;  # get rid of the first line (column headers)

while (<F>) {
  chop;
 ($filename,$statename,$stategif,$msavalue,$selectmsa,$countyvalue,
  $selectcounty,$cityvalue,$selectcity,$dirname,$banner) = split(/\t/);

  $newfile = $dirname.$filename;

  open(NEWFILE,">$newfile") || die "Couldn't open file $newfile: $!\n";

  open (TEMPLATE, $template) || die "Couldn't open file $template:
$!\n";
  @lines = <TEMPLATE>;
  close TEMPLATE;
  foreach $line (@lines) {
     $line =~ s/%%FILENAME%%/$filename/;
     $line =~ s/%%STATENAME%%/$statename/;
     $line =~ s/%%STATEGIF%%/$stategif/;
     $line =~ s/%%MSAVALUE%%/$msavalue/;
     $line =~ s/%%SELECTMSA%%/$selectmsa/;
     $line =~ s/%%COUNTYVALUE%%/$countyvalue/;
     $line =~ s/%%SELECTCOUNTY%%/$selectcounty/;
     $line =~ s/%%CITYVALUE%%/$cityvalue/;
     $line =~ s/%%SELECTCITY%%/$selectcity/;
     $line =~ s/%%DIRNAME%%/$dirname/;
     $line =~ s/%%BANNER%%/$banner/;
     print NEWFILE $line;
  }

  close NEWFILE;
  print "Successfully wrote file: $newfile\n";
}
print ".... done for now.\n";
close F;
#
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Variables on template:
-----------------------------------------
statename
stategif
msavalue (possible 20 for each page)
selectmsa (possible 20 for each page)
countyvalue (possible 150 for each page)
selectcounty (possible 150 for each page)
cityvalue (possible 650 for each page)
selectcity (possible 650 for each page)
banner


Variables only in text-based table:
-----------------------------------------
statecode: identifies the state 
filename: name of file to create
dirname: directory where created file will be stored

6 records from text-based table (state.txt):
(first row is column headings/field names)
-----------------------------------------
StateCode,FILENAME,STATENAME,STATEGIF,MSAVALUE,SELECTMSA,COUNTYVALUE,SELECTCOUNTY,CITYVALUE,SELECTCITY,DIRNAME,BANNER
01,al.html,Alabama,al,,,,,,,c:/acn/html/states_g,1
01,,,,http://www.acn.net/states_gate/al/msa/gag.msa.colu,Columbus,,,,,,
01,,,,,,http://www.acn.net/states_gate/al/county/alg.cty.w,Walker,http://www.acn.net/states_gate/al/county/alg.cty.w,Jasper
,,
02,ak.html,Alaska,ak,,,,,,,c:/acn/html/states_g,1
02,,,,http://www.acn.net/states_gate/ak/msa/akg.msa.anch,Anchorage,,,,,,
02,,,,,,http://www.acn.net/states_gate/ak/county/akg.cty.k,Kenai
Peninsula,http://www.acn.net/states_gate/ak/county/akg.cty.k,Homer ,,

I want every record with the same StateCode to build 1 html file.
Thanks so much for your help!! If possible, respond to my email!!

Alison Reed
areed@mphs.com


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

Date: Fri, 14 Mar 1997 20:49:06 GMT
From: tgy@chocobo.org (Tim Gim Yee)
Subject: Re: Is globbing still useful?
Message-Id: <3329b4dd.125492678@news.oz.net>

On Fri, 14 Mar 1997 16:04:47 -0800, Mike Nakagawa <mikenak@best.com>
wrote:

>In a recent e-mail exchange I found out that the following code snippet
>will run the subroutine "file1":
>
>#File: file1.pl
>sub file1
>{
>#  stuff
>}
>#end file1.pl
>
>#File: whatever.pl
>
>require "file1.pl"
>$string = "file1";
>&$string;          # this runs file1, since when can you run a scalar?

It's a symbolic reference.  Perl sees it as '&file1'.  If you don't
like it, disable it with  'use strict;'   See perlref man pages.

>#end whatever.pl
>
>In perl 4, trying to do this involved putting "file1" into a glob, 
>then using the glob in another context.
>
>I guess the question I have is of what use is globbing in Perl 5?

Type glob.  For passing filehandles to subroutines (I think):
	&subroutine(\*FILEHANDLE);



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


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

Date: 14 Mar 1997 16:35:52 -0500
From: bwilson@gate.net (Brian Wilson)
Subject: isqlperl4 and the Future
Message-Id: <5gcgbo$1dki@seminole.gate.net>

We have a number of applications where I work that depend upon isqlperl4
to access Informix databases. 

Recently some concerns have arisen in our DBA group because "'isqlperl' is
a freeware version of perl 4 that has routines added to it to access
Informix databases, there is no support or commitment to port, test,
certify isqlperl with future releases of Informix" (this from the actual
letter of concern). They're worried that we'll hit some Informix revision
upgrade, and there won't be an isqlperl that works with it, so we won't be
able to upgrade.

I've been sniffing around the web sites, trying to learn more about DBI
and perl 5 (I've only worked with isqlperl4 up to this point, so I'm no
expert) so that I can offer some arguments in favor of perl. I need to get
some idea of the direction that isqlperl is going, as well where DBI (and
most specifcally DBD:Informix) is headed in case we need to cut over that
way and do some rewrite.

So, I'm fishing for any information or pointers to information that anyone
can provide me in penning my justification for our use of perl to pull
data out of databases for use on the web.

Thank you in advance for your time.

I will check the news group periodically for replies, but any chance you
get to respond by mail would be just that much better.

Thanks...
Brian

-- 
What could be more dainty than a brimming mouthful of crunchy crab shells?



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

Date: 14 Mar 1997 23:26:01 GMT
From: "R. Vince" <rvince@sprynet.com>
Subject: Method not implemented
Message-Id: <01bc30cf$152d8700$b6c0a6cf@isjfvklh>

	I'm trying to get a Perl script up and running. I know once I do this one
time, subsequents times will be a snap. I've read a number of books on the
subject, and have studied the faq's. 

	I have put a Perl script onto the server in my  directory, called
feedback.pl. I then renamed it
feedback.cgi, and did a chmod 755 on it (it's an Apache running Linux). I
also have an html file to invoke
it called http://technalink.com/FEEDBACK.HTM. Both files (the htm and the
cgi) are in the same directory.

	When I invoke the html file from my browser though, I keep getting the
following message:

Method not implemented
POST to /feedback.cgi> <TABLE> <TR> <TH>Your Full Name</TH> <TD><INPUT
TYPE= not supported.

	I am certain it is not something in the script itself, of which the first
line appears as:

#!/usr/bin/perl -- -*-perl-*-

	which is correct for my server for Perl 5.

	I must have something very stupid wrong. I have also tried changing the
filename to nph-feedback.cgi, and I get the same message. Can someone
please take a
look at this  - I'm certain it's not a hairy programming problem, just
something really dumb I must not have done. Once I get this going,
subsequent Perl scripts will be relativelty easy. Thanks a lot, Ralph


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

Date: Sat, 15 Mar 1997 22:10:39 -0500
From: Wintermute <astone@sprintmail.com>
Subject: Oracle and Perl5
Message-Id: <332B64AF.10F3@sprintmail.com>

If there is anyone who has successfully integrated Perl 5 w/ODBC.PM and
Oracle please contact me.  I am having extreme difficulties in getting
it to work.

-- Wintermute


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

Date: Fri, 14 Mar 1997 23:18:10 -0500
From: Matthew Stich <mstich@erols.com>
Subject: Perl Question
Message-Id: <332A2300.4902@erols.com>

This is a multi-part message in MIME format.

--------------24216D55623E
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Would somebody mind looking at my script, that I borrowed from Kenneth
Murphy in his book, I think there are some problems, but I am not sure
how to correct them.

The scripts are attached.

Matthew

--------------24216D55623E
Content-Type: application/mac-binhex40; x-mac-type="54455854"; x-mac-creator="424E4851"; name="HTML&PERL.Hqx"
Content-Transfer-Encoding: 7bit
Content-Description: Binhex v.4.0 Document
Content-Disposition: inline; filename="HTML&PERL.Hqx"

(This file must be converted with BinHex 4.0)

:#8K868`Q8%956!"849K88LTMD!#3""Vd!!!&VJ'5$5U3#JdUN!SJ9%K*8b"*8b"
85%8J5&406#"'58a&1L"RBQp[Dh0KGQ8ZD(4YE!dUN!S0N!-m)5dY9'KTFb"QD@a
P)'0bC@&dC@3J-bma0#mj0b!c1M8j)&"0)'*j)%0XBA*TFb")EfeP)&"KCf8JGQ9
bFfP[EL!b,M!Y,6i02%K868`q$6a)48&%2JdJN!-m9%P86%8q9&G"6L"(G@9cG#"
#EfpV)&"KCf8m,e4*9%a&2JdJN!-m689835"138e&28G&6N9539428L"$6dj848j
825*$E'&bDA-J5'pYC5"3B@GP)$)Z-#)q$5#3!caB,90"8beA58j%6eFJ9%p3263
b)%*29&4266dc16FJ6%9'9$dd)&**4dK826Bc-ci02#p)48&%2Jdm3Np%@5"#4d0
26%p525)M3C!')Mi02%C28NdJB@0dD@pZ25*SG(4`1Lm[BfGTBQPZ,Q9bEfac,Q0
[E5pYFh4TBfJ[BfGT,@*TELpRBQp[DfCKEQ0j,R"X)L"YCA4SEf3p)P"28e3L2Jd
02&!q2%0&6P4&8Mim9%&#6%8J3Np54%9526%`)%0&6%a68%&$58j(26%`)%0&6%a
3384%58j(26)q$5#3!ca88Mi0)*!'2&4))%026&0338ip-L"KE'PREMe$48j849)
q$5#3#6a32Ma*2Ma'6dj8)&0*@N8p)LXa)L"$6da28MdL)d&'-*!%)Mj89d&1*h-
m,dC26P3q2#p*2Ma'6dj8$5#3#90*@N8p)LXa)MiJ4h9PFh4#EfpV)%9ZG(*j2#p
'6dj82Ma#8Mi0)*!*$5#3"JdJN!Bm,e4)2M`[9&)q$5#3!ca88Mi0)*!'2&4%2Jd
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`!4J!"69"
68J#3!a*#3P08!*!$(J2Yrrm!N!8rU1!!J2rr!*!$6!!rU3LphJ:

--------------24216D55623E--



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

Date: Sat, 15 Mar 1997 22:06:40 -0500
From: Wintermute <astone@sprintmail.com>
Subject: Problem!!!! NT 4.0, Oracle 7.3.2.2.0, Perl 5 (Build 303), ODBC.PM
Message-Id: <332B63C0.375F@sprintmail.com>

I've contacted Dave Roth with this question, but in lieu of a response
I'll drop it to you here.  

I am trying to interface Perl 5 build 303 and the latest ODBC from Mr.
Roth with an Oracle database.  Both Perl 5 and the Oracle database are
running on the same machine.

I can create a connection to the database just fine, and even execute
Sql statements.  Inserts, Deletes, Drops, and Creates work just fine. 
However, when I attempt to Select information from a table I only get
the column names and a nifty Application Error message from NT.

Without further ado, here's the error and the code that's causing it.

"The instruction at "0x011bf9c6" referenced memory at "0x00000023". The
memory could not be "read".

Click on OK to terminate the application."

-------------
And here's the code (very simple):
-------------

use Win32::ODBC;

$dbh = new Win32::ODBC("DSN=tbdb;UID=SYSTEM;PWD=MANAGER;") || die "Open
Failed\n";

$statement = "select * from test";
$dbh->sql($statement);

$dbh->DumpData();

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

The Oracle database has a table named "test" defined and the only column
of information it has is named "name" and defined as char(30). 
Currently the table only consists of one entry which is my name.

When I attempt to run this script I see:

Dumping Data for connection: 1
Error: ""
NAME
----

And that's it.

If there is anyone out there who has successfully used the Perl 5 ODBC
module with an Oracle database please contact me.  This is important, I
cannot continue with the project I am working on for my company without
it.  

-- Wintermute


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

Date: 15 Mar 1997 01:24:23 +0000
From: Jon Peatfield <J.S.Peatfield@damtp.cam.ac.uk>
Subject: Problems with stdio in perl 5.003
Message-Id: <vxjohcm9cc8.fsf@kro.amtp.cam.ac.uk>

I have a piece of code which behaves stragely when run on perl 5.003
on Linux (RedHat 4 in fact).  I think that this is an odd interaction
between perl and stdio, but re-compiling perl with stdstdio undef'd
seems to make no difference.  The problems I see are:

When reading from a handle in an eval, if an interupt is handled which
causes a die() then the next read from the handle returns the same
data as the previous one.  I think that this is caused by perl
longjmp()ing out of stdio without due care and attention.

I can work round this using tell/seek around the reads, but this seems
to cause data loss when an underlying read() read several lines.

The second is when a handle is re-opened from a pipe after data has
been read from it, and then rewound.  The next data read is from the
old fd not the new pipe.  I thought I had a workround for this, by
explicitly opening the pipe on a different handle then closing the
original, and dup2ing it.

i.e.

  open(STDIN, "program|") ;

becomes:

  open(NEWFH, "program|") ;
  close(STDIN) ;
  open(STDIN, "<&NEWFH") ;

but this isn't right, because if STDIN was already a handle on program
output, the close() waits for it, and in any case the new STDIN
afterwards, when close()'d won't wait for the process just started.

Here are some sample test programs.  Run them on a tty and type at
them.  The first shows the but when an INT signal is sent.

--cut-here--
#!/usr/bin/perl
# Test of stdio and signal handlers

$handle = sub { die $_[0] } ;

$SIG{INT} = 'IGNORE' ;
$ct=0;
$loc = tell(STDIN) ;

while($ct++ < 10){
    $_ = '';
    eval { local $SIG{INT} = $handle ;
#	   seek(STDIN, $loc, 0) ;
	   $_ = <STDIN> ;
	   $loc = tell(STDIN) ;
       } ;
    if ($@) {
	print "Caught a Signal: $@" ;
    } ;
    if ($_) {
	print "Read : $_" ;
    }
}
--cut-here--

--cut-here--
#!/usr/bin/perl
# Test of stdio and open

# Cause some stdin to be read
read(STDIN, $_, 30) ;
print "Read: $_\n" ;
seek(STDIN, 0, 0) ; # Rewind it

# Now put it through a "filter"
open(STDIN, "/bin/echo hello worldd |") || die "Can't open" ;
# Cause some stdin to be read
$_ = <STDIN> ; 
print "Line: $_" ;
--cut-here--

Using signal handlers in perl seems very dangerous, the man page says
never to allocate memory (fair enough), and use die, which can't be
safe unless perl knows too much about the underlying libc.  The 2nd
problem seems just to be that perl isn't syncronising it's view of
things, when it goes underneath stdio's feet to re-open a handle.

Worryingly my tests of the 2nd program suggest that it also affects
other systems (sos4, DEC unix for example) when the stdin is a plain
file, but not when it is a tty (for example) -- I was testing this
with an older version of perl (5.001) though.  On Solaris-2.5 I don't
see the problem on any file type.

What is going on?  Am I going mad?  Will these things go away when
file handles become proper objects in 5.004?

-- 
Jon Peatfield,  DAMTP,  Computer Officer,   University of Cambridge
Telephone: +44 1223  3 37852    Mail: J.S.Peatfield@damtp.cam.ac.uk


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

Date: 15 Mar 1997 00:36:40 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: random perl core dumps with obscure message
Message-Id: <5gcquo$3cc$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Eryq 
<eryq@enteract.com>],
who wrote in article <3329DD58.25118AB5@enteract.com>:
> Tom Christiansen wrote:
> > Is the only way you can do a timed-out read.
> 
> Wouldn't one have to worry about what $SIG{__DIE__} was currently
> set to in this case?   That is, imagine this is code in a 
> reusable module (IO::Timed?)... such a module would need to
> temporarily save/restore a possibly-non-signal-safe $SIG{__DIE__}
> handler, would it not?  

Note that this operation is too complicated to do safely in
sighandler. On the other hand, it is kid's play comparing to die, so
you may have a similar segfault rate with
	local $SIG{__DIE__};
as without.

Ilya


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

Date: Fri, 14 Mar 1997 20:26:58 GMT
From: tgy@chocobo.org (Tim Gim Yee)
Subject: Re: sort large array
Message-Id: <3329ab11.122984352@news.oz.net>

On Fri, 14 Mar 1997 18:06:10 GMT, Jim Shi <jims@ss5mth44.franklin.com>
wrote:

>use 
>sort by_my_cmp @a
>
>to sort @a. If @a is very large. it's very slow. how can make it fast?

You've neglected to tell us what by_my_cmp does.  Let me guess...

sub by_my_cmp {
	sleep(1);
	$b cmp $a;
}

Bet that would slow it down some.  Try removing the sleep().  Or try
telling us what by_my_cmp does.  Or try Unix's sort :)


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


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

Date: Fri, 14 Mar 1997 16:17:33 +0000
From: Laurence Molloy <lauriem@cstr.ed.ac.uk>
Subject: sourcing (bash) config files within perl
Message-Id: <33297A1D.36AC@cstr.ed.ac.uk>

Hi,

Does anybody have an answer to this problem that doesn't involve
actually reading in the necessary config files and assigning each
variable manually by pattern matching, or including the variables in the
 .bashrc file?...

I have a configuration file of environment variables (for bash shell)
which I can source at the command line, to add to my usual set. However,
I need to ensure that all my perl scripts automatically use these
environment variables. Now, I've tried the obvious within my perl
scripts. i.e.

system ". <config filename>";        # Sources the config file.

foreach $key (sort(keys %ENV))      # Prints out current set of
{                                   # environment variables
print $key, '=', $ENV{$key}, "\n";
}

However, this doesn't work because the system command actually creates a
sub-process which, when exited, loses all its additional environment
variables. Are there any neat perl commands that do the same without
creating a sub-process?

I know the obvious answer is to source whatever is necessary manually
before running any of the perl scripts but these scripts are going to be
used by a wide set of people so it would be nice to be able to do the
equivalent automatically. Afterall, it's one less operation for the
users to have to remember to do.

thanks,
Laurence.
--
 _____________________________________________________________
                                                             
  Laurence Molloy				             
  Centre for Speech Technology Research	                     
  University of Edinburgh                                    
  Level D					             
  80 South Bridge		Tel.  +44 131 650 6357      
  Edinburgh.  EH1 1HN		Fax.  +44 131 650 6351      
  Scotland, UK.			Email lauriem@cstr.ed.ac.uk 
 ____________________________________________________________


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

Date: 15 Mar 1997 01:49:33 GMT
From: c.c.eiftj@33.usenet.us.com (Rahul Dhesi)
Subject: term 'regular expressions' considered undesirable
Message-Id: <5gcv7d$jbj@samba.rahul.net>

I am concerned that the term 'regular expression' has come to mean any
pattern.  In fact a 'regular expression' originally referred to a very
specific type of pattern:

     one that can converted into a finite state machine

Another way of saying is that a 'regular expression' is a pattern that
can be used for matching with no backtracking needed.  Such pattern
matches are fast.

My guess is that early implementations of regular expressions were in
fact implemented as finite state machines, but people decided they were
not powerful enough.  So they kept on adding extensions until the
original goal of having regular expressions, i.e., to match with no
backtracking, was lost.

The ? suffix in perl5, which causes quantifiers to become non-greedy,
help bring perl paterns close to real regular expressions.

   /a.*b.*c/	# greedy, needs backtracking, slow, not regular expression
   /a.*?b.*?c/  # non-greedy, no backtracking, fast, regular expression

Perhaps it's now too late, and we need to find a new term for what
we used to call regular expressions.
-- 
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: Fri, 14 Mar 1997 20:50:30 -0500
From: Bill Cowan <billc@tibinc.com>
To: Yufang &Zhihong Zou <zouwu@erols.com>
Subject: Re: Unpack Cobol Comp-3 data
Message-Id: <332A0066.3041@tibinc.com>

Yufang &Zhihong Zou wrote:
> 
> Hi, there,
> 
> I was looking for some perl scripts or helps to unpack COBOL
> COMP-3 data into ascii data. Any suggestion will be highly
> appreciated.
> 
> Thanks,
> Zhihong,

If I remember correctly, COMP-3 is also called "packed decimal", which
stores one digit in each nibble (or nybble in Camel II), i.e. one digit
in a group of 4 bits.  If true, then you should consider using
pack/unpack function and the template character "h" or "H".  

It appears that each h/H position would get one nibble (one digit) out
of the packed decimal field.  You would still need to be careful of
where  the plus or minus sign is stored as one nibble. 

Please post any conversion routine that you may develop.

-- Bill
-----------------------------------------------------------------------
Bill Cowan <billc@tibinc.com>    Voice:919-490-0034   Fax:919-490-0143
Tiburon, Inc./3333 Durham-Chapel Hill Blvd Suite E-100/Durham, NC 27707


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

Date: Fri, 14 Mar 1997 15:56:06 +0000
From: Laurence Molloy <lauriem@cstr.ed.ac.uk>
Subject: Re: What's a good Perl book?
Message-Id: <33297516.6407@cstr.ed.ac.uk>

Bradley Alan wrote:

> 
> The camel book of course!  It's Programming Perl by Larry Wall,
> Randall Schwartz, and Tom Christiansen.  It's published by
> O'Reilley and Associates, and can be found in any good book
> store.
> 
> / Brad


It's worth noting that there are actually 2 camel books..."Programming
Perl" is very useful as a reference, but David Tong did say he was new
to perl so the "Learning Perl" book is likely to be better as an initial
introduction to the concepts and syntax, with the "Programming" volume
becoming useful later on.

The "Learning" volume doesn't actually cover everything (and I guess
that's rightly so...otherwise it would just confuse the average newbie)
so when the programming becomes more involved, you may sometimes only
find the neat little tricks and commands you're looking for in the
"Programming" volume. At least that's what I've found.

Laurence.
-- 
 ____________________________________________________________
                                                             
  Laurence Molloy				             
  Centre for Speech Technology Research	                     
  University of Edinburgh                                    
  Level D					             
  80 South Bridge		Tel.  +44 131 650 6357      
  Edinburgh.  EH1 1HN		Fax.  +44 131 650 6351      
  Scotland, UK.			Email lauriem@cstr.ed.ac.uk 
 ____________________________________________________________


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

Date: 15 Mar 1997 02:52:55 GMT
From: marti@netrail.net (Dennis Marti)
Subject: Re: What's wrong with "an email" (was: How to spam - legitimately)
Message-Id: <5gd2u7$svq$1@skipper.netrail.net>

Matt "Or at least not until Ebonics meats Cybonics..." Kruse wrote:

: Just be happy that on Internet we don't have to hear people "axe" 
: questions. :)

Where ya been Matt? A quick search of DejaNews found 824 documents
containing the string 'aks'. My favorite was:

> Just writin' to tell all of you that the Aks Mamma Home Page has been
> updated and moved. 

(The new address is http://pilot.msu.edu/user/spitsber by the way.)

This one was posted to comp.lang.c:

> But feel free to aks your wuestions concerning the standard C language
> here.

Although, to be fair, it was posted by someone with a .de email address.
Hmmm, that's a usage of email that doesn't follow with mail. I said,
"My mail address is..." Nah.

Dennis


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

Date: 13 Mar 1997 18:52:10 GMT
From: jfriedl@tubby.nff.ncl.omron.co.jp (Jeffrey)
To: dxe@cassidy.sbi.com (Dan Ellsweig (Enterprise Management))
Subject: Re: year 2000 question
Message-Id: <JFRIEDL.97Mar14035210@tubby.nff.ncl.omron.co.jp>


[mail and post]

Non-Perl rant: I'm *still* waiting for the time when people drop the "year"
  from talking about the year after ``year 1999''. Geez, it's so friggin'
  verbose. 1997 is ``1997'' and 2000 is ``2000'' -- what's the big deal?
  [Ps: I'm writing this at hour 3am, minute 48, day 14, month March, 1997]

Dan Ellsweig (Enterprise Management) <dxe@cassidy.sbi.com> wrote:
|> Does anyone know of a version of PERL which will support
|> 4 character year as returned by localtime()??

localtime returns a number for the year, not a string.

|> Currently the localtime function calculates the correct year then it
|> subtracts 100 from the year before returning the year value in the
|> localtime array. The result is a 2 character year (99 for 1999 or 00 for
|> 2000).

Something's not quite right. You said that it subtracts 100, yet in the
examples you gave, it's subtracting 1900 and 2000, respectively.

Are you sure you're not mistaken with your last example? Every
implementation of Perl that I've seen (not all of them, by all means)
return (year-1900) from localtime, so 2000 will be returned as the number
100.

	Jeffrey
----------------------------------------------------------------------------
Jeffrey Friedl <jfriedl@ora.com> Omron Corp, Nagaokakyo, Kyoto 617 Japan
See my Jap<->Eng dictionary at http://www.wg.omron.co.jp/cgi-bin/j-e
O'Reilly's Regular Expression book: http://enterprise.ic.gc.ca/~jfriedl/regex/


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

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

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