[8173] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1791 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 2 17:11:57 1998

Date: Mon, 2 Feb 98 14:00:28 -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, 2 Feb 1998     Volume: 8 Number: 1791

Today's topics:
        A regex problem <Kari.Marttila.@tietogroup.com>
        Can I speed up this code? <Brett.W.Denner@lmco.com>
    Re: can variables be generated on the fly (Andrew M. Langmead)
    Re: dbm files <vladimir.kerkhoff@--pins.nl-->
    Re: Decent Perl books <joseph@5sigma.com>
        FIRST WE KILL ALL THE MIMES (was Re: Passing URL to Bro (Chip Salzenberg)
    Re: FIRST WE KILL ALL THE MIMES (was Re: Passing URL to (Nathan V. Patwardhan)
        GD.pm <dan.albertsson@swipnet.se>
        goto & with variable routine $sub in SUPER - is this ri (Peter Scott)
    Re: How to get at stuff piped into Perl? (Repost) <trachier@crrel.usace.army.mil>
    Re: I Got A Bug in My Program! (Chip Salzenberg)
        larry wall in news.com article <dboorstein@shopcfn.com>
    Re: local() scoping rules - unusual results (Chip Salzenberg)
    Re: Looking for a search script for NT <peterson@cns.uni.edu>
        Modifying a file on another Server <sme@planetpod.com>
    Re: Multi-line blocks of text (Steve Linberg)
    Re: newbie Q:create a subset (Tad McClellan)
    Re: perl and file system (Chip Salzenberg)
        Perl Stock Quote Retriever (stewart samuel bushman)
    Re: Perl/Msql problem (Chip Salzenberg)
        Problem with running perl scripts <janne.kallunki@tietogroup.com>
    Re: Problem with TIE and DB_File (Chip Salzenberg)
    Re: recursive regex? (Chip Salzenberg)
    Re: Scripts For Automating Adding Users Via Web Interfa <scottj@mthcsc.wfu.edu>
    Re: Survival Of perl (Chip Salzenberg)
    Re: tainted socket (Chip Salzenberg)
    Re: Trying to find good PERL book <barnett@houston.Geco-Prakla.slb.com>
    Re: TYP21D (was: substitute...) (Tom Grydeland)
    Re: TYP21D (was: substitute...) (Dave Till)
    Re: TYP21D (was: substitute...) (Dave Till)
    Re: Unpack float (Chip Salzenberg)
    Re: Windows NT perl mail command <peterson@cns.uni.edu>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 02 Feb 1998 15:49:39 +0200
From: Kari Marttila <Kari.Marttila.@tietogroup.com>
Subject: A regex problem
Message-Id: <34D5CEF3.2060@tietogroup.com>

Is there a way to remove certain tags inside another tags? E.g.

<H3>Nok aat <p>esit le <p>na <p>rean <p></H3>No<p> <H3> asdf <p> </H3>
=>
<H3>Nok aat esit le na rean </H3>No<p> <H3> asdf  </H3>

In this example I wanted to remove all "<p>" tags only if they were
inside a string delimited by "<H3>..</H3>" tags.

I have tried several ways without success.

Kari.Marttila@tietogroup.com


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

Date: Mon, 02 Feb 1998 13:56:31 -0600
From: Brett Denner <Brett.W.Denner@lmco.com>
Subject: Can I speed up this code?
Message-Id: <34D624EF.7969C2D7@lmco.com>

Does anyone have a faster algorithm to read a text file with numbers in 
several columns and extract certain columns into arrays?

Here's a sample of the input file:
=======================================================
   2248   6.359E+00   3.331E+00  8.00E+00   6.162E-02   
   2249   6.529E+00   3.457E+00  8.00E+00   6.162E-02   
   2250   6.705E+00   3.599E+00  8.00E+00   6.164E-02   
   2251   6.873E+00   3.763E+00  8.00E+00   6.169E-02   
=======================================================

and here's what I've tried so far:

=======================================
open FILE, "file.txt" or die;

while (<FILE>)
    {
    my @columns = split;
            
    push @x, $columns[0];  # first column
    push @y, $columns[2];  # third column
    }
=======================================

Is there a faster way to accomplish the following?

Thanks for the help,
Brett Denner

P.S. My newsgroup provider is one to three days behind, so please
email a copy of any responses to this post.  Thanks.

-- 
 Brett W. Denner                                Lockheed Martin TAS
 Brett.W.Denner@lmco.com                        P.O. Box 748            
 (817) 935-1144 (voice)                         Fort Worth, TX 76101
 (817) 935-1212 (fax)                           MZ 9333


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

Date: Mon, 2 Feb 1998 21:18:14 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: can variables be generated on the fly
Message-Id: <EnrsIF.6A7@world.std.com>

aml@world.std.com (Andrew M. Langmead) writes:

>Cameron Kaiser <cdkaiser@delete.these.four.words.concentric.net> writes:

>>aml@world.std.com (Andrew M. Langmead) writes:

>>>eedvab@eed.ericsson.se (Vjekoslav Balas) writes:

>>>>Subject: Re: can variables be generated on the fly

>>>Its a feature called symbolic references. The feature exists, but
>>>there use is strongly discouraged, and in most cases can be easily

>>Why? There's nothing in the New Testament aka Programming Perl that calls
>>symbolic references depreciated.

>No, there is just text that discourages their use.
[long boring excerpts from "Programming Perl" deleted]

There is one other thing that I just remembered that I wanted to
explain in my previous article, but I had left it out when I finally
got around to writing it. I want to add some guesses (these are just
guesses, mind you) on why feature like soft references were put in
perl 5, even when people immediately were told to avoid them.

In perl 4, eval and typeglobs were a ultimate "backdoors" into the
workings of the perl interpreter. Typeglobs allowed you muck around
with the symbol table, and eval allowed you to change the code that
was executed. When perl 4 didn't allow the programmer to do something
directly, it is quite possible that they could use these two features
to get their result. There were features added to perl 5 that seemed
to be added solely for the sole purpose of giving direct language
support for the programming problems that perl 4 programmers resorted
to typeglobs and eval for.

Using a symbolic reference is preferable to someone saying:

{
  local(*a);
  *a='var1';
  $a='value of generated variable';
}

But if there are even better ways (for example, hard references, which
includes using hard references to implement complex data structures)
then obviously symbolic references should be avoided as well.

-- 
Andrew Langmead


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

Date: Mon, 2 Feb 1998 22:39:13 +0100
From: "Vladimir Kerkhoff" <vladimir.kerkhoff@--pins.nl-->
Subject: Re: dbm files
Message-Id: <6b5ec1$4pl$1@news2.xs4all.nl>


Carol Lynn Smith heeft geschreven in bericht
<34d617a7.961543@news.amrcorp.com>...
>Hi,
>I have a two-fold question regarding dbmfiles  that I am using to
>store employee information:
>1.  Is there a size restriction on either the .dir or .pag files?  I
>am storing key/value pairs and I can't create my 29th one.
>2.  How do I sort by value?  FYI, my key is a record number I assign,
>but I would like to sort by last name, which makes up part of the
>value (in essence, I have a value that might look like this -
>Smith:Carol:46762:1-8765:13L81:etc.).

Try this:

        dbmopen(%db1,$filename,0755);
        foreach $key (sort bylastname (keys %db1)) {
          $val = $db1{$key};
          @names = split(/$delim/,$val);

          print "$names{0}\n";
        }
        dbmclose(db1);

sub bygroup {
   $sys_temp=$db1{$a};
   @rec1 = split($delim,$sys_temp);
   $sys_temp=$db1{$b};
   @rec2 = split($delim,$sys_temp);
   $bygroup = $rec1[0] cmp $rec2[0];
}

It works fine with my databases!



>Thanks in advance.
>Carol


Vladimir Kerkhoff




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

Date: Mon, 02 Feb 1998 14:46:00 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Decent Perl books
Message-Id: <34D63E61.2ABEDC1F@5sigma.com>

Tom's Camel Critiques page is currently out of date, and the faq
list is very brief and also out of date.  I wish you folks would 
stop pointing people there and point them to reference.perl.com 
instead.

	-joseph

-- 
Joseph N. Hall, prop., 5 Sigma Productions       mailto:joseph@5sigma.com
Author, Effective Perl Programming . . . . . http://www.effectiveperl.com
Perl Training  . . . . . . . . . . . . . . .  http://www.perltraining.com

Tad McClellan wrote:
> 
> Chris Heiden (cmheiden@mtu.edu) wrote:
> : Hello there,
> :     I am new to the Perl community.  I was wondering if any of you could
> : recommend any books as tutorials and reference to Perl.  I already have
> : two from Learning Perl and Learning Perl on Win32 systems from O'reilly
> : and Associates.  I just wanted to see what everyone out there with
> : actual experience with some books had to say.
> 
> Perl FAQ, part 2 has a section titled "Perl Books":
> 
> ------------------------
> A number books on Perl and/or CGI programming are available.  A few of
> these are good, some are ok, but many aren't worth your money.  Tom
> Christiansen maintains a list of these books, some with extensive
> reviews, at http://www.perl.com/perl/critiques/index.html.
> 
>  ... (much more snipped. See the actual FAQ)
> ------------------------


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

Date: Mon, 02 Feb 1998 20:47:38 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: FIRST WE KILL ALL THE MIMES (was Re: Passing URL to Browser from Script)
Message-Id: <6b5bh2$ov5$1@cyprus.atlantic.net>

According to Scott Kelley <jsk2@axe.humboldt.edu>:
>--------------msDFB546772F4DBF93B78B351F

No answers for MIMEs.
-- 
Chip Salzenberg               - a.k.a. -                <chip@pobox.com>
 "Boy, is it ever dark."  "I hope they don't get a moonburn."  // MST3K
           ->  Ask me about Perl training and consulting  <-
    Like Perl?  Want to help out?  The Perl Institute: www.perl.org


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

Date: 2 Feb 1998 21:02:23 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: FIRST WE KILL ALL THE MIMES (was Re: Passing URL to Browser from Script)
Message-Id: <6b5c8v$m7g@fridge.shore.net>

Chip Salzenberg (chip@mail.atlantic.net) wrote:

: No answers for MIMEs.

Oh well.  They probably wouldn't say "thank you," anyways.  ;-)

--
Nathan V. Patwardhan
please don't send spam to president@whitehouse.gov


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

Date: 2 Feb 1998 19:55:11 GMT
From: "DAN ALBERTSSON" <dan.albertsson@swipnet.se>
Subject: GD.pm
Message-Id: <01baf1a8$053ea020$84edf482@default>

I have downlodad GD.pm for Win32 and installed the the
GD.PM file into the \PERL\LIB\ directory and the GD.PLL
into \PERL\LIB\AUTO\GD\ directory in Windows95.
But when I am trying to run the test.pl script that comes
with the package i get Error:Parse exception.

My windows version of perl is 5.003_07 and the build is
315.

Can it have someting to do with filenames or how to tell
perl to use the GD.pm file in windows. I have included these
statements first in the test.pl file:

use lib "c:\perl\lib";
use GD;

Or do I maybe have to compile a version of GD.pm.

Thanks
/Dan



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

Date: 2 Feb 1998 20:17:52 GMT
From: psd@euclid.jpl.nasa.gov (Peter Scott)
Subject: goto & with variable routine $sub in SUPER - is this right?
Message-Id: <6b59lg$qc6@netline.jpl.nasa.gov>

Okay, I have something here that looks like it may be working, but
it's so convoluted (to me), that I would like to have some
confirmation or refutation of my thought processes.

I wrote an object that had a number of attributes for which I provided
a generic get/set routine with AUTOLOAD.  It checks whether $AUTOLOAD
is one of the set of valid attribute names and dies if it isn't.

Then I subclassed it.  The new object defined a few more attributes
and so naturally I provided it with an AUTOLOAD for them; however,
what it needs to do if $AUTOLOAD isn't part of *that* list is not die,
but punt to its superclass, since $AUTOLOAD at this point likely names
either an attribute or a method of the superclass.

So I want to jump to the method named $AUTOLOAD in my superclass, passing
whatever arguments I currently have.  I wound up with the eval line in:

sub AUTOLOAD {
    my $self = shift;
    $AUTOLOAD =~ s,.*::,,;
    return if $AUTOLOAD eq "DESTROY";
    eval "goto &\$self->SUPER::$AUTOLOAD" unless exists $ATTRS{$AUTOLOAD};
    $self->{$AUTOLOAD} = shift if @_;  
    return $self->{$AUTOLOAD};
}

I am sufficiently new to this level of Perl programming that this
appears disgusting to me.  So I would like to know whether this is the
best way to do it or not.

(If there's a CPAN module that circumvents the issue, that interests me,
but I would still like to know the answer to the question above for
my own edification.)  TIA.

-- 
This is news.  This is your      |  Peter Scott, NASA/JPL/Caltech
brain on news.  Any questions?   |  (psd@euclid.jpl.nasa.gov)

(Email address is temporary one which will be shut down shortly after 
 first spam.)

Disclaimer:  These comments are the personal opinions of the author, and 
have not been adopted, authorized, ratified, or approved by JPL.


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

Date: 2 Feb 98 16:06:49 -0500
From: "Gary Trachier" <trachier@crrel.usace.army.mil>
Subject: Re: How to get at stuff piped into Perl? (Repost)
Message-Id: <B0FB9FA1-162A55@144.3.128.40>

>Environment: Windows NT, Perl 5.04.04

>

>I want to pipe lists of files into Perl and assemble them into a
command,

>eg.

>

>> grep foo * | myscript.pl

>

>I can't figure out how to get at the output of the grep once I'm in

>myscript.pl. I've read all the references I can find about pipes but
they

>all seem to be talking about using open and creating a process to
read/

>write

>from/to.

>

>

>

>


the pipe will send stuff to STDIN in your Perl script.  Try something
like

my @fromGrep =3D <<STDIN>

to read it in one felled swoop, or


while (defined ($thisLine =3D <<STDIN>)) {

	# do something with $thisLine

}


to read it one line at a time.


Hope this helps.


-Gary




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

Date: Mon, 02 Feb 1998 21:11:22 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: I Got A Bug in My Program!
Message-Id: <6b5ctg$p1v$1@cyprus.atlantic.net>

According to hood@panix.com (Philip Hood):
>A while ago, I wrote a Shopping Cart Script, which
>I hoped would make me some money ...

There are other free shopping carts that have proven records.

I suggest you try something more likely to make money, like writing
a word processor for windows.  :-,
-- 
Chip Salzenberg               - a.k.a. -                <chip@pobox.com>
 "Boy, is it ever dark."  "I hope they don't get a moonburn."  // MST3K
           ->  Ask me about Perl training and consulting  <-
    Like Perl?  Want to help out?  The Perl Institute: www.perl.org


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

Date: Mon, 02 Feb 1998 16:42:51 -0500
From: Dan Boorstein <dboorstein@shopcfn.com>
Subject: larry wall in news.com article
Message-Id: <34D63DDB.A024FEDF@shopcfn.com>

hello all,

just wanted to point out an article on news.com which mentions
larry wall. it concerns the free software movement, which seems
to be a contentious, if not relevant, topic around here lately.

http://www.news.com/SpecialFeatures/0,5,18652,00.html

--

dan boorstein


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

Date: Fri, 30 Jan 1998 05:10:03 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: local() scoping rules - unusual results
Message-Id: <6arneu$9rd$1@cyprus.atlantic.net>
Keywords: local, scoping

According to dfh@dwroll.dw.lucent.com ():
>Can anyone comment on whether:
>   (1)  local() is breaking the "rules"?  (See example below)
>   (2)  My understanding of the "rules" is incorrect?

(1) is the case.  You've found a bug!  Who knows, maybe I'll be
able to fix it for 5.004_05.
-- 
Chip Salzenberg               - a.k.a. -                <chip@pobox.com>
    Like Perl?  Want to help out?  The Perl Institute: www.perl.org
           ->  Ask me about Perl training and consulting  <-
             "It's the lemon zester of death!!"   // MST3K


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

Date: Mon, 02 Feb 1998 14:44:43 -0600
From: Kerry Peterson <peterson@cns.uni.edu>
To: "Abigael L. Anthony" <roseala@erols.com>
Subject: Re: Looking for a search script for NT
Message-Id: <34D6303B.45094E01@cns.uni.edu>

http://www.worldwidemart.com/scripts is the home of Matt's script archives
and he has a simple search which is UNIX-specific which can be converted to
work on NT

--KP

Abigael L. Anthony wrote:

> Hi,
>
> I'm looking for a good search script for windows NT? Something to put on
> my web page so visitors can search the site.
>
> Warmest Regards & Best Wishes,
>
> Abigael Anthony
> roseala@erols.com





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

Date: Mon, 02 Feb 1998 11:42:16 -0800
From: Stewart Eastham <sme@planetpod.com>
Subject: Modifying a file on another Server
Message-Id: <34D62198.6F4F2486@planetpod.com>

I have a question reagrding PERL.  The goal is to have a script modify a
file on another server.

The first way I tried to do this was to have a server-side include that
called a PERL CGI script on another server.  But, I could not determine
how (or if it was even possible) to call a script that resides on
another server.

The other solution I imagined was having the script modify a file and
then upload it to another server.  Is there a ftp type method for PERL
and if so, where is it available?  There is also the security issue.  Is
there a secure way to go about it?  Of course, the login and password to
the other server would have to be included in the PERL script that will
be uploading files to it.  If this script were behind an .htaccess,
would that be secure enough?

Thanks for your help.

Stewart Eastham
sme@planetpod.com



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

Date: Mon, 02 Feb 1998 15:32:16 -0500
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Multi-line blocks of text
Message-Id: <linberg-0202981532170001@projdirc.literacy.upenn.edu>

In article <6b53t4$75n$1@dinkel.civ.utwente.nl>, "Laurens van Alphen"
<alphen@craxx.com> wrote:

<ka-snip>

> <VirtualHost www.otherserver.com>
>   ServerName www.otherserver.com
> 
>   User thatuser
>   Group thatgroup
> 
>   DocumentRoot /home/thatuser/www
>   ScriptAlias /cgi-bin/ /home/thatuser/www/cgi-bin/
> 
>   TransferLog /home/www/log/www.otherserver.com
> </VirtualHost>
> --- end of file --

<ka-snip>

> what i want is this:
> 
> deete an entire <VirtualHost></VirtualHost> block by only specifying the
> username (in the User xxx directive).
> 
> can this be done using perl? maybe sed, awk, ed, grep? i've not been able to
> set up a proper multi-line regex...

I tried to do something similar to this - the situation was variable
substitution in a text block - and found that this basic approach DIDN'T
work:

s/$open_delim     # match the opening delimiter
   (.*?)          # match as few characters as possible
   $str           # match the desired string (user, or whatever)
   (.*?)          # match as few more characters as possible
  $close_delim    # match the closing delimiter
 /                # replace with nothing
 /xsg;

The problem, I guess, is the two (.*?)s.  What this approach tries to do
is start from the center, as it were, and expand out in both directions to
the first delimiters it encounters, but if I understand correctly, regexps
don't work that way.  It would do one or the other, but not both.  When I
think about it, this makes sense.

Soooooooo, I did it the old-fashioned way by using index() to find the
desired string, then search backward and forward from there to get the
delimiters, then deleting.  More code, but not too awful.

I'd love to hear more creative approaches, or (especially) if I am a
bonehead and there IS a neat-o way to do this with regexps.

-- 
Steve Linberg                  |    National Center on Adult Literacy
Systems Programmer etc.        |           University of Pennsylvania
linberg@literacy.upenn.edu     |        http://www.literacyonline.org


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

Date: Mon, 2 Feb 1998 14:15:15 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: newbie Q:create a subset
Message-Id: <jg95b6.uha.ln@localhost>

Raghu Hon (honr@ms.com) wrote:

: If I have Arrays  @A and @B
: How do I create an subset(or delta array)  @C, 
: where in @C should contain elements which are 
: in @A but Not in @B.


That is called the "set difference" operation.


Perl FAQ, part4:

   "How do I compute the difference of two arrays?  
    How do I compute the intersection of two arrays?"


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Mon, 02 Feb 1998 20:44:09 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: perl and file system
Message-Id: <6b5b9j$oug$1@cyprus.atlantic.net>

According to Fabrice Gonton <fabrice.gonton@aigf.sncf.fr>:
>Is there a simple way to determine the fs ?

Most of the time, the value of `df .` or `df -k .` is helpful.
-- 
Chip Salzenberg               - a.k.a. -                <chip@pobox.com>
 "Boy, is it ever dark."  "I hope they don't get a moonburn."  // MST3K
           ->  Ask me about Perl training and consulting  <-
    Like Perl?  Want to help out?  The Perl Institute: www.perl.org


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

Date: 2 Feb 1998 20:30:31 GMT
From: sbushman@students.uiuc.edu (stewart samuel bushman)
Subject: Perl Stock Quote Retriever
Message-Id: <6b5ad7$ouh$1@vixen.cso.uiuc.edu>

For your perusal...it's kludgy, but it works.  If anyone wants to improve
on it, I'll gladly take a copy.

-stu

##########################################
# A command-prompt stock quote retriever #
#                  by Stewart S. Bushman #
#                                        #
# Copyright (c) 1998                     #
#    					 #
# Will retrieve quote information for an #
# entered symbol and display in the fol- #
# lowing format: 			 #
#					 #
# Symbol				 #
# Time of last update			 #
# Current value				 #
# Amount up/down			 #
# Percentage up/down   			 #
# Volume				 #
#					 #
# Distribute freely, but if you make any #
# cool modifications (especially a comm- #
# and line symbol entry) please send me  #
# a copy of the new script.              #
#					 #
# Tested in HP-UX, but code is generic   #
# enough that it should work everywhere. #
# 				         #
# Requires LWP and MIME-64 Modules,      #
# available at your local CPAN.          #
##########################################

# Call up Yahoo, and get the page for the symbol ORCL (for example)
use LWP::Simple;
$doc = get 'http://quote.yahoo.com/q?s=orcl';

# Search through for string before quote info and delete all before
$_ = $doc;
/q?s=ORCL&d=t">/;
$firstcrop = "$'";

# Search through for string after quote info and delete all after
$_ = $firstcrop;
/<a href="/;
$secondcrop = "$`";

# Remove all HTML coding (courtesy of the FAQ)
$_ = $secondcrop;
$secondcrop =~ s/<(?:[^>'"]*|(['"]).*?\1)*>//gs;

# Dump to output
print $secondcrop;
exit;

# CROP HERE
--
                   |
Stewart S. Bushman | The more I study religions the more convinced I become 
sbushman@uiuc.edu  | that man never worshipped anything but himself.
                   |     		- Sir Richard Francis Burton


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

Date: Mon, 02 Feb 1998 21:06:47 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Perl/Msql problem
Message-Id: <6b5ckg$p0j$1@cyprus.atlantic.net>

According to rreuss@nmdp.org:
>Can't find loadable object for module Msql in @INC (<paths>) at
><paths>Msql.pm line 99.
>
>so looking at line 99 of Msql.pm the code is
>  Bootstrap Msql;
>
>Does anyone know what is wrong?  Is this a configuration issue?  Please
>help!!!

Perhaps someone installed Msql and then you upgraded to a new Perl
versions and/or you're using it from a directory that was installed
from a different OS and/or architecture.
-- 
Chip Salzenberg               - a.k.a. -                <chip@pobox.com>
 "Boy, is it ever dark."  "I hope they don't get a moonburn."  // MST3K
           ->  Ask me about Perl training and consulting  <-
    Like Perl?  Want to help out?  The Perl Institute: www.perl.org


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

Date: Mon, 2 Feb 1998 15:28:34 +0200
From: "Janne Kallunki" <janne.kallunki@tietogroup.com>
Subject: Problem with running perl scripts
Message-Id: <6b4htp$j02$1@hiisi.inet.fi>


I have a problem with perl and apache server. When I run perl script
from a command line I have not any problems. But if I try to run same
script from browser I got following error message to a apache server
log:

exec of /usr/apache_1.2.4/cgi-bin/test.pl failed, reason: Exec format error
(errno=8)

Scripts with /bin/sh from cgi-bin work well so where is a problem.

Please send answer through mail because I don't normally follow this group.

Janne.Kallunki@tietogroup.com







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

Date: Mon, 02 Feb 1998 20:03:44 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Problem with TIE and DB_File
Message-Id: <6b58um$oop$1@cyprus.atlantic.net>

According to tzdpab@procats1.afibs.ch (Bernd Patolla):
>use DB_File ;
>tie ( %Aliases, "DB_FILE", "/var/adm/sendmail/aliases", 1, 0 ) ;

o/~  One of these things is not like the others...
     One of these things just isn't the same...      o/~

Check your capitalization.
-- 
Chip Salzenberg               - a.k.a. -                <chip@pobox.com>
 "Boy, is it ever dark."  "I hope they don't get a moonburn."  // MST3K
           ->  Ask me about Perl training and consulting  <-
    Like Perl?  Want to help out?  The Perl Institute: www.perl.org


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

Date: Mon, 02 Feb 1998 20:18:46 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: recursive regex?
Message-Id: <6b59qk$ori$1@cyprus.atlantic.net>

According to Richard Caley <spt@cstr.ed.ac.uk>:
>In article <6b1o86$mt61@zinc.imation.com>, Mark Rostron (mr) writes:
>mr> am writing a parser and would like to use regex to easily decode nested
>mr> funcion calls - any ideas?
>
>Can't be done (at least generally). Regular expressions recognise
>regular languages and regular languages don't include recursive
>structures. Wouldn't put it past `them' to provide non-regular regular
>expressions in some future perl though :-).

Actually, just such a thing is under active design work even as we
type at each other here.  Probably won't be in 5.005, but you might
expect to see it in 5.006.
-- 
Chip Salzenberg               - a.k.a. -                <chip@pobox.com>
 "Boy, is it ever dark."  "I hope they don't get a moonburn."  // MST3K
           ->  Ask me about Perl training and consulting  <-
    Like Perl?  Want to help out?  The Perl Institute: www.perl.org


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

Date: Mon, 02 Feb 1998 15:01:16 -0500
From: Kevin Scott <scottj@mthcsc.wfu.edu>
Subject: Re: Scripts For Automating Adding Users Via Web Interface
Message-Id: <34D6260C.FFE1E8A8@mthcsc.wfu.edu>

George Graham wrote:
> 
> Does anyone have, or know of, a suite of CGI programs for adding users to a
> Linux system via HTML forms? I would like to turn over the taks to people
> without official root access via a CGI web interface. I imagine there are

[snip]

Is it just me, or does this not sound like a very good, i.e., secure
idea?  In any case, this is probably not the right newsgroup for this
question.  comp.os.linux.misc might be a better place.

-- 
******  Kevin Scott
********  Department of Mathematics & Computer Science
********  Wake Forest University
******  scottj@mthcsc.wfu.edu


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

Date: Mon, 02 Feb 1998 20:01:59 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Survival Of perl
Message-Id: <6b58r8$oo6$1@cyprus.atlantic.net>

According to Zenin <zenin@best.com>:
>Tom Christiansen <tchrist@mox.perl.com> wrote:
>: In comp.lang.perl.misc, lovegod@earthling.net writes:
>: :the only computer I could find
>: :with web (or "net") access for less than $20,000.00 came with w95. 
>: Linux is free.
>
>	And if one _had_ to actually pay for the OS, both Sun and SGI
>	make pretty meen boxes for not much more then a high end PC.
>
>	But then you'd have to work with IRIX <shutters> or Solaris...

Well, even then, you could run Linux on your Sun.
-- 
Chip Salzenberg               - a.k.a. -                <chip@pobox.com>
 "Boy, is it ever dark."  "I hope they don't get a moonburn."  // MST3K
           ->  Ask me about Perl training and consulting  <-
    Like Perl?  Want to help out?  The Perl Institute: www.perl.org


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

Date: Mon, 02 Feb 1998 21:10:27 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: tainted socket
Message-Id: <6b5crp$p1e$1@cyprus.atlantic.net>

According to Tom Roddy <tomroddy@netrition.com>:
>I am trying to write a Perl socket (client) script to retrieve
>an HTML page from a web server. This script must run
>setuid so it must pass taint checks. If I "Use socket;", 
>and connect to a socket, I get an "Insecure dependency".

Well, I'm afraid that's not enough info.

I suggest you read the  perlsec  man page and then try to figure
out what data are tainted and why.
-- 
Chip Salzenberg               - a.k.a. -                <chip@pobox.com>
 "Boy, is it ever dark."  "I hope they don't get a moonburn."  // MST3K
           ->  Ask me about Perl training and consulting  <-
    Like Perl?  Want to help out?  The Perl Institute: www.perl.org


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

Date: Mon, 02 Feb 1998 14:07:35 -0600
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: Trying to find good PERL book
Message-Id: <34D62787.656C6451@houston.Geco-Prakla.slb.com>

Scott McIntyre wrote:
> 
> Hi all,
> 
> I have been watching the discussions in this forum and have noticed
> that the name O'Reilly is mentioned quite often.  I have been
> searching for books by this person but don't have enough information
> to find any matches.
> 
> Could one of you be so kind as to tell me what this gentleman's
The president (and I believe owner) of the company is Tim O'Reilly, but
has little to do with the author's names.

Try http://www.ora.com
which will lead you to O'Reilly & Assosciates web page.

Good luck.

Dave
<snip>

-- 
"Security through obscurity is no security at all."
		-comp.lang.perl.misc newsgroup posting

------------------------------------------------------------------------
* Dave Barnett               U.S.: barnett@houston.Geco-Prakla.slb.com *
* DAPD Software Support Eng  U.K.: barnett@gatwick.Geco-Prakla.slb.com *
------------------------------------------------------------------------


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

Date: 2 Feb 1998 19:55:18 GMT
From: Tom.Grydeland@phys.uit.no (Tom Grydeland)
Subject: Re: TYP21D (was: substitute...)
Message-Id: <slrn6dc955.bq3.Tom.Grydeland@mitra.phys.uit.no>

On 30 Jan 1998 11:24:57 -0500,
Dave Till <davet@angel.uunet.ca> wrote:

> But I find any comments on the amount of effort an author has put into
> a book somewhat presumptuous.

Under most circumstances, I'd agree.  In this case, what made me write
this was errors due to cut-n-paste'ing examples and the surrounding text
without bothering to check that running the examples as stated even made
sense.  (the description of the -x command line flag, p. 615)

I'll take it out when I revise the review, though.

> >Unfortunately, the fixed width font has two critical shortcomings:
> >
> >   * The single quote ' looks like a straight quote, and it is thus
> >     impossible to determine from a glance whether a single quote or a
> >     backtick was intended.
> 
> It's actually worse than that:  there have been several occasions where
> I have specified a backtick in examples, only to see it converted into
> a straight quote upon printing.  (I don't get galley proofs, so I can't
> fix this myself.)
> 
> >   * Instead of a minus character, a hyphen is used, which is hard on the
> >     eyes. In addition, it would appear that the typesetting system used
> >     will interpret consecutive dashes to an em-dash, sometimes actively
> >     exploited by the author, while other times leaving the text wrong. (See
> >     p. 595.)
> 
> Again, the text as I wrote it used minus characters, not emdashes, and I keep
> having to try to get SAMS to remove the damned things when I get author
> reviews of new printings.  (Non-technical typesetters don't always
> realize that the auto-decrement operator *has* to be two minus characters,
> and *can't* be converted into an emdash.  Sigh.)

Seeing the quality of some of the production jobs released to press by
some companies, I'm not really surprised.  (I might be surprised that
authors would agree to publish something when they can't see the
galleys, though.)  That's why I haven't stressed these points.

> I'll take a look at the rest of Mr. Grydeland's comments when I get a
> chance, and will put any errors found up on my web page
> (http://www.net/~davet/errata52.html).  Apologies for having stalled
> on this:  I got a copy of this message a few months ago, got bogged down
> in my day job, and then forgot about it.  Mea culpa. :-)

As promised, I've put your comments up on the page with the review:
I've changed your *emphasis* to <em>emphasis</em> and added a hyperlink,
but otherwise it's left untouched and without comments on my part.

<URL:http://xenu.phys.uit.no/~tom/TYP21D.html>

Please mail me if you object to this or if you have further comments.

> --Dave Till

-- 
//Tom Grydeland <Tom.Grydeland@phys.uit.no>


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

Date: 2 Feb 1998 15:46:02 -0500
From: davet@angel.uunet.ca (Dave Till)
Subject: Re: TYP21D (was: substitute...)
Message-Id: <6b5baa$2o4@angel.uunet.ca>

In article <slrn6dc4mf.5fm.Tom.Grydeland@mitra.phys.uit.no>,
Tom Grydeland <Tom.Grydeland@phys.uit.no> wrote:
>> My point is that, in Perl, you can do this:
>> 
>> # $var is undefined
>> $var += 3;

>Hmm, let's try:
>
>% perl -wle 'print $a+=3'
>3
>% perl -wle 'print $a+3'
>Use of uninitialized value at -e line 1.
>3
>
>
>Seems your factual information is slightly out of date.

But your example does print 3 (albeit with a warning).  Isn't that what
I just said?

Hairsplittingly yours, :-)
--Dave


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

Date: 2 Feb 1998 15:49:25 -0500
From: davet@angel.uunet.ca (Dave Till)
Subject: Re: TYP21D (was: substitute...)
Message-Id: <6b5bgl$2q0@angel.uunet.ca>

In article <slrn6dc955.bq3.Tom.Grydeland@mitra.phys.uit.no>,
Tom Grydeland <Tom.Grydeland@phys.uit.no> wrote:
>On 30 Jan 1998 11:24:57 -0500,
>Dave Till <davet@angel.uunet.ca> wrote:
>
>> But I find any comments on the amount of effort an author has put into
>> a book somewhat presumptuous.
>
>Under most circumstances, I'd agree.  In this case, what made me write
>this was errors due to cut-n-paste'ing examples and the surrounding text
>without bothering to check that running the examples as stated even made
>sense.  (the description of the -x command line flag, p. 615)
>
>I'll take it out when I revise the review, though.

And I, in turn, will take note of the errors you've found and put them
up on my errata page.  (I have a fulltime day job, which means I may
not get around to it right away, but I'll do it, I swear... :-))


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

Date: Mon, 02 Feb 1998 19:53:34 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Unpack float
Message-Id: <6b58bk$om7$1@cyprus.atlantic.net>

According to pbanks@ix.netcom.com:
>Does anyone have a solution other than writing a small c program to
>convert the entire struct to character data via fprintf?

I'm afraid that's it ... unless you write an extension that can be
use'd from your Perl program.
-- 
Chip Salzenberg               - a.k.a. -                <chip@pobox.com>
    Like Perl?  Want to help out?  The Perl Institute: www.perl.org
           ->  Ask me about Perl training and consulting  <-
             "It's the lemon zester of death!!"   // MST3K


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

Date: Mon, 02 Feb 1998 14:33:58 -0600
From: Kerry Peterson <peterson@cns.uni.edu>
To: vzanini@xplore.it
Subject: Re: Windows NT perl mail command
Message-Id: <34D62DB6.304BC270@cns.uni.edu>

Try windmail at http://www.geocel.com

vzanini@xplore.it wrote:

> I'm quite new in Windows NT CGI programming using Perl. An obstacle I've
> found hard to pass is the following: how can I send some data (for
> example the one coming from an HTML form) via E-Mail? I know I can do
> that in UNIX calling the SENDMAIL shell command. But, there is such a
> command also in Windows NT, or does exist an utility which permit to
> execute this function? If someone has some experience in this field,
> please write me!!! Thank you,  Valerio
>





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

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

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