[11501] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5101 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 10 12:07:21 1999

Date: Wed, 10 Mar 99 09:00:26 -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, 10 Mar 1999     Volume: 8 Number: 5101

Today's topics:
    Re: append 3 huge log files (Larry Rosler)
    Re: Array of Array???? dave@mag-sol.com
        Can a PARENT NOT wait on a CHILD Process? HOW? global3@my-dejanews.com
    Re: Can I turn a Perl program into an NT .exe? (Randal L. Schwartz)
    Re: Centering a submit button using CGI.pm. Possible? (George Crissman)
        DBD installation & ODBC libraries <fabascal@gredos.cnb.uam.es>
        declaring a local in a while <marty@catnmoose.com>
    Re: deletion problem (brian d foy)
    Re: FAQ 3.16: How can I make my Perl program run faster <dtbaker@bus-prod.com>
        FAQ 3.22: How can I compile my Perl program into byte c <perlfaq-suggestions@perl.com>
        FAQ 3.23: How can I compile Perl into Java?   <perlfaq-suggestions@perl.com>
    Re: Getting rid of ^M (Will England)
    Re: Hashes ?? (Steve Linberg)
    Re: Hashes ?? dave@mag-sol.com
    Re: how do i format a forwarded letter <ebohlman@netcom.com>
    Re: Illiad!!!!!! (I R A Aggie)
    Re: Missing CGI Environment Variables (John Casey)
    Re: Missing CGI Environment Variables <jeromeo@atrieva.com>
    Re: MS ACCESS database with perl (John Casey)
    Re: Newbie needs help!! (Tad McClellan)
    Re: Open Source compiling Perl: *NIX & wintel ??? <jcraft@ucar.edu>
    Re: Perl and a Here document kstinson@hotmail.com
    Re: Perl and NT backoffice (Scott McMahan)
    Re: Perl comment (George Crissman)
        Perl Power Tools update <tchrist@mox.perl.com>
        please help with compiling perl/modules 5.005 <chad@vcn.net>
        problems with readdir jstrike@execpc.com
    Re: problems with readdir (Dimitri Ostapenko)
    Re: s/\n\s// don't work <jacklam@math.uio.no>
    Re: Shouldn't we have 'perlmonger' ? (brian d foy)
        Sorting IP numbers <kzal@pol.pl>
    Re: Sorting IP numbers (Sam Holden)
    Re: Sorting IP numbers (Greg Bacon)
    Re: split? <admin@asarian-host.org>
        URGENT: Problem with Bitwise AND slamda@hotmail.com
        Wrapping perl and #! problems <Phil.Kime@ed.ac.uk>
    Re: Your opinion on an HTML stripper regex <jacklam@math.uio.no>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Sun, 7 Mar 1999 10:55:52 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: append 3 huge log files
Message-Id: <MPG.114c6b8fd97fcde4989708@nntp.hpl.hp.com>

In article <36e2c191.1205354227@news.ionet.net> on Sun, 07 Mar 1999 
18:13:36 GMT, Mark P. <mag@imchat.com >says...
 ...
>       open(FILE, "<$datadir/$file") || die $!;
> 	print DATA <FILE>;

I interpret 'huge' to mean "doesn't fit comfortably in memory", but that 
is what this code calls for.  If you insist on doing this 'by hand', 
loop on reasonably-sized sysreads and syswrites.

 ...
> On Sun, 07 Mar 1999 06:38:50 GMT, vnguyen2891@my-dejanews.com wrote:
> >I got 3 huge log files which I want to append them all into one file ( put 3
> >files into 1 file).

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personl/Larry_Rosler/
lr@hpl.hp.com


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

Date: Wed, 10 Mar 1999 16:10:29 GMT
From: dave@mag-sol.com
Subject: Re: Array of Array????
Message-Id: <7c65hc$sa6$1@nnrp1.dejanews.com>

In article <36E55C98.477A@hotmail.com>,
  lufan@hotmail.com wrote:
> Yu Fang wrote:
> >
> > I think you are talking about 2-d array.
> >
> > Here is one way:
> > @array = (['a','b'],['c','d']);
> > #   $array[1][1] will be 'd'.
> >
> > Here is another way:
> > @a = ('a','b');
> > @b = ('c','d');
> > @array = (\@a, \@b);
> > #   $array[1][1] will be 'd'.
> >
> > lufan@hotmail.com wrote:
> > >
> > > hi,
> > >
> > > How to make a PERL array contains several pointers to
> > > others arrays ? All 2 arrays are scalable.
> > >
> > > Here is what I think of it,
> > >
> > >     array1 ->   {a,b,c,d,e,f ...}
> > >
> > >     array1{a} -> {1,2,3,4 ..}
> > >     array1{b} -> {4,1,2,3,4 ..}
> > >
> > > thanks ;)
> >
> > --
> > Frank Yu Fang
> >
> > GTE Internetworking
> > 40 Sylvan Road
> > Waltham, MA 02451-1128
> >
> > Phone: 781-466-3351
> > Fax: 781-466-2650
> > Pager: 1-800-759-8888 PIN# 1619895 or 1619895@skytel.com
>
> I may confuse you. What I want to do is about hash.
> 2 scalable arrays, one is @ and another is hash %.
>
>     @a1={1,2,3,4,5 ...}
>     @a2={a,s,23245,1,44,...}
>     @a3=
>       .
>       .
>     @an=
>
>     $hash{a1} = \@a1
>     $hash{a2} = \@a2
>
>         .
>         .
>         .
>
> Can you show me some sample code ?
> thanks

There's certainly some confusion here. You are using the wrong sort of
brackets to create your initial arrays. Your version will 'work', but almost
certainly won't do what you expect.

Try:

@a = (1,2,3,4,5);
etc...

and reread

perldoc perlref
perldoc perllol
perldoc perldsc

hth,

Dave...

--
Dave Cross
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 10 Mar 1999 13:36:05 GMT
From: global3@my-dejanews.com
Subject: Can a PARENT NOT wait on a CHILD Process? HOW?
Message-Id: <7c5sg4$jrh$1@nnrp1.dejanews.com>

Hi All,

I've been trying to get the perl code quoted below to send a query string to a
child process but I don't want the parent script process to wait on the child
process neither do I want the child to wait on the parent. The query string is
contained in the $add string. I'm aware that the pipe(), exec() and fork()
functions can be used for communication between parent and child but I'm not
sure how to use them or which one is better to use for what I want to do. I
tried using the pipe() function. Here  is the code from my script that I've
tried without success:

$add = "title=$title&url=$url&email=$email&section=$section";

open(LPR,"|$subprog") || die "can't fork $subprog: $!\n";
print LPR $add;

If anyone can let me know how I can do this I will be grateful. What code can
I add to my code above to get this to work as I would like it to work or is
there a better way to do it? I'm looking forward to hearing from someone.
Please post your response to this forum.

Best regards,
Alan


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 10 Mar 1999 06:26:14 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Can I turn a Perl program into an NT .exe?
Message-Id: <m190d52zg9.fsf@halfdome.holdit.com>

>>>>> "hal" == hal 9000 <hal9000@fetchmail.com> writes:

hal> Perl2Exe at <http://www.demobuilder.com/perl2exe.htm> looks
hal> as what you are after. I have not yet tried it myself
hal> though...

>From what's been said here many times, perl2exe is NOT a compiler.
It's merely a distribution bundler.  It's still the same old Perl
compiling and executing the same old program every time you say go.

IMHO, Don't spend money for such a useless product.  <sigh>

-- 
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@teleport.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: Wed, 10 Mar 1999 16:25:10 GMT
From: strads@tmisnet.com (George Crissman)
Subject: Re: Centering a submit button using CGI.pm. Possible?
Message-Id: <36e69c76.5582152@news2.tmisnet.com>

This might work, even though it's not CGI.PM:

<CENTER>
<INPUT TYPE="SUBMIT" VALUE="Calculate"><BR>
<INPUT TYPE="RESET" VALUE="Clear Form">  
</CENTER>

-- George Crissman
-- strads@tmisnet.com


On 5 Mar 1999 10:57:49 -0500,  (James W. Sandoz) wrote:

>
>Greetings!
>	I've been trying to place the submit (and reset) button on the center
>	of the line, using CGI.pm.  I've read Lincoln Stein's Official Guide
>	as well as the on-line documentation at wiley.com to no avail.  I've
>	also tried a few tricks such as
>		submit({align=>'center'}-name=>'Set'),
>		center(reset(-name =>'Reset')),
>
>	The buttons work just fine, but placing them where I want has been
>	more difficult than I'd thought.  I _could_ write the form code in
>	plain 'ol html and then process it with CGI.pm, but that seems a
>	waste of a good tool.
>
>	If someone could point me to the correct documentation (or to what I've
>	perhaps overlooked) I'd be most appreciative.
>		Jim Sandoz
>-- 
>Mr. James W. Sandoz, Instructor, UMBC Dept of Biol Sciences,  
>				 1000 Hilltop Circle
>				 Catonsville, MD 21250
>voice: (410) 455-3497; fax: 455-3875; net: sandoz@umbc.edu

-----------------------------------------------------------------------
"There is no need to criminalize millions of legitimate and responsible
businesses and individuals in order to stop a very small group of
irresponsible people, particularly when there are other ways already
working ." says Mr. Dan Hufnal of the 10,000 member DEAA 
<http://www.deaa.com>. What does he mean by "already working"?
Maybe:  <http://www.tmisnet.com/~strads/spamhunt/index.html>
-----------------------------------------------------------------------


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

Date: Wed, 10 Mar 1999 15:08:56 +0100
From: Federico Abascal <fabascal@gredos.cnb.uam.es>
Subject: DBD installation & ODBC libraries
Message-Id: <36E67CF8.DF8B3650@gredos.cnb.uam.es>


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

Please, let me do another question about this. We have problems with the
installation of the DBD:ODBC library, and we think we need an ODBC
library. Do you know what's our problem? Where can we find a free UNIX
ODBC library? Any help is wellcome,
Thanks in advance,
Fede y Jose Maria.

--------------E423607C561B24981CD2CCB6
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Please, let me do another question about this. We have problems with the
installation of the DBD:ODBC library, and we think we need an ODBC library.
Do you know what's our problem? Where can we find a free UNIX ODBC library?
Any help is wellcome,
<br>Thanks in advance,
<br>Fede y Jose Maria.</html>

--------------E423607C561B24981CD2CCB6--



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

Date: Wed, 10 Mar 1999 11:32:22 -0500
From: Marty Landman <marty@catnmoose.com>
Subject: declaring a local in a while
Message-Id: <36E69E96.A5FA0014@catnmoose.com>

I would like to know about the following:

 my $buffer;
 $buffer .= $_ while <File>;

if I were to say 'my $buffer .= $_ while <File>;' I'm thinking that'd be
wrong or at minimum inefficient since the 'my' would try to execute in a
loop.

Is this correct, is there a reasonable way to code this functionality in
one stmt?

tia

--
 Marty Landman            Web Programming and Design
 Cat 'n Moose dot com     http://www.catnmoose.com/
 (914) 657-2605           marty@catnmoose.com




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

Date: Wed, 10 Mar 1999 11:59:47 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: deletion problem
Message-Id: <comdog-ya02408000R1003991159470001@news.panix.com>

In article <7c41qd$1th$1@nnrp1.dejanews.com>, @l@ <aqumsieh@matrox.com> posted:

> In article <comdog-ya02408000R0703992005510001@news.panix.com>,
>   comdog@computerdog.com (brian d foy) wrote:
> > In article <7bsgtj$p9t$1@nnrp1.dejanews.com>, @l@ <aqumsieh@matrox.com>
> posted:
> >
> > > --Ala
> > > $monger->{montreal}->[0];
> >
> > why are you signing your posts with Nicolas Bertrand's
> > monger designation?
> 
> I like it ..
> is it copyrighted? any problems with that?

no, but you aren't the leader of the Montreal Perl Mongers and it
looks like you don't understand the idiom or the use of complex
data structures.

of course, if you like annoying Perl Mongers, don't expect much
help from them.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>


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

Date: Wed, 10 Mar 1999 07:21:48 -0600
From: Dan Baker <dtbaker@bus-prod.com>
Subject: Re: FAQ 3.16: How can I make my Perl program run faster?
Message-Id: <36E671EC.5A134560@bus-prod.com>

Tom Christiansen wrote:
> 
> (This excerpt from perlfaq3 - Programming Tools
 ...
>     In some cases, it may be worth it to use the backend compiler to
>     produce byte code (saving compilation time) ...
--------------

this sounds really interesting... especially for when development is
*done*. It might be a nice last step to pre-compile and distribute. Can
anyone give a little more information on this?

- what section of the docs should I read to find out more about it?
- what tools do you need? (compilers?)
- is this similar to what perl2exe does? would it be simpler to use
their stuff? (haven't tried it yet.)

thanx,

Dan


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

Date: 10 Mar 1999 06:46:17 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 3.22: How can I compile my Perl program into byte code or C?  
Message-Id: <36e677a9@csnews>

(This excerpt from perlfaq3 - Programming Tools 
    ($Revision: 1.33 $, $Date: 1998/12/29 20:12:12 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq3.html
if your negligent system adminstrator has been remiss in his duties.)

  How can I compile my Perl program into byte code or C?

    Malcolm Beattie has written a multifunction backend compiler,
    available from CPAN, that can do both these things. It is
    included in the perl5.005 release, but is still considered
    experimental. This means it's fun to play with if you're a
    programmer but not really for people looking for turn-key
    solutions.

    Merely compiling into C does not in and of itself guarantee that
    your code will run very much faster. That's because except for
    lucky cases where a lot of native type inferencing is possible,
    the normal Perl run time system is still present and so your
    program will take just as long to run and be just as big. Most
    programs save little more than compilation time, leaving
    execution no more than 10-30% faster. A few rare programs
    actually benefit significantly (like several times faster), but
    this takes some tweaking of your code.

    You'll probably be astonished to learn that the current version
    of the compiler generates a compiled form of your script whose
    executable is just as big as the original perl executable, and
    then some. That's because as currently written, all programs are
    prepared for a full eval() statement. You can tremendously reduce
    this cost by building a shared *libperl.so* library and linking
    against that. See the INSTALL podfile in the perl source
    distribution for details. If you link your main perl binary with
    this, it will make it miniscule. For example, on one author's
    system, /usr/bin/perl is only 11k in size!

    In general, the compiler will do nothing to make a Perl program
    smaller, faster, more portable, or more secure. In fact, it will
    usually hurt all of those. The executable will be bigger, your VM
    system may take longer to load the whole thing, the binary is
    fragile and hard to fix, and compilation never stopped software
    piracy in the form of crackers, viruses, or bootleggers. The real
    advantage of the compiler is merely packaging, and once you see
    the size of what it makes (well, unless you use a shared
    *libperl.so*), you'll probably want a complete Perl install
    anyway.

-- 


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

Date: 10 Mar 1999 09:16:31 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 3.23: How can I compile Perl into Java?  
Message-Id: <36e69adf@csnews>

(This excerpt from perlfaq3 - Programming Tools 
    ($Revision: 1.33 $, $Date: 1998/12/29 20:12:12 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq3.html
if your negligent system adminstrator has been remiss in his duties.)

  How can I compile Perl into Java?

    You can't. Not yet, anyway. You can integrate Java and Perl with
    the Perl Resource Kit from O'Reilly and Associates. See
    http://www.oreilly.com/catalog/prkunix/ for more information. The
    Java interface will be supported in the core 5.006 release of
    Perl.

-- 
Travel important today; Internal Revenue men arrive tomorrow.


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

Date: Wed, 10 Mar 1999 14:40:51 GMT
From: will@mylanders.com (Will England)
Subject: Re: Getting rid of ^M
Message-Id: <slrn7ed1bg.gp1.will@mylanders.com>

On Mon, 08 Mar 1999 16:43:04 -0800, lufan@hotmail.com <lufan@hotmail.com> wrote:
>Robert Saunders wrote:
>> 
>> I am sure this is very simple.. but I have a data files that gets
>> created and I open it up and want to take out the ^M at the end of
>> several lines..

>From command line, 

bash$ sed s/^V^M//g file.pl > temp; cp -i temp file.pl

(I think.)

You use the ^V (actually enter <ctrl>-V,) to escape the <ctrl>-M.

And, I'm not sure how to do that with perl.

Will

-- 
Jan: Our monitors go 'doink' when they change HSCAN freq. Is this normal?
jguthrie: Do they also go "Narf!" and say things like "I think so, Brain, but
where are we going to find leather pants in our size?" 
                                                           will@mylanders.com


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

Date: Wed, 10 Mar 1999 14:22:09 GMT
From: slinberg@crocker.com (Steve Linberg)
Subject: Re: Hashes ??
Message-Id: <slinberg-1003990922090001@cc11620-a.lwmrn1.pa.home.com>

In article <36e64636.7609123@news.wxs.nl>, pvdkamer@inter.NL.net wrote:

> Hello,
> Ok i've got two flat file database. In the first one there is a unique
> code wich i've to lookup in the second file. In the second file there
> can be more of the same key's.
> I've been told i have to do it with hashes but i do not know how. Can
> someone please help ?

How about posting a few lines from each file to show the kind of data
you're talking about, and then we can help you.


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

Date: Wed, 10 Mar 1999 16:11:56 GMT
From: dave@mag-sol.com
Subject: Re: Hashes ??
Message-Id: <7c65k3$sb5$1@nnrp1.dejanews.com>

In article <36e64636.7609123@news.wxs.nl>,
  pvdkamer@inter.NL.net wrote:
> Hello,
> Ok i've got two flat file database. In the first one there is a unique
> code wich i've to lookup in the second file. In the second file there
> can be more of the same key's.
> I've been told i have to do it with hashes but i do not know how. Can
> someone please help ?

Post what you've got and tell us what is going wrong.

Dave...

--
Dave Cross
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 10 Mar 1999 15:32:07 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: how do i format a forwarded letter
Message-Id: <ebohlmanF8DxtJ.5nI@netcom.com>

Larry Rosler <lr@hpl.hp.com> wrote:
: All these problems could be fixed by something like this (UNTESTED):

:   #!/usr/local/perl -w
:   use strict;

:   my $file = 'fix-letter';

:   open FILE, "+<$file" or die "Can't open $file: $!\n";
:   { local $/; $_ = <FILE> }
:   s/^>//gm;
:   seek FILE, 0, 0 or die "Can't rewind $file: $!\n";
:   print FILE;
:   close FILE;

That will leave junk at the end of the file, since the new contents will 
be shorter than the old contents.  trunc(FILE,0) before the seek should 
fix that.


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

Date: 10 Mar 1999 15:14:58 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Illiad!!!!!!
Message-Id: <slrn7ed3l6.ohs.fl_aggie@stat.fsu.edu>

On 9 Mar 1999 22:48:03 -0000, Jonathan Stowe <gellyfish@btinternet.com> wrote:

+ But why is the llama all punctured up ?

Shoddy workmanship? over-inflation?

James - the way to a girls heart is the llama book? hmmm...have to try that...


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

Date: Wed, 10 Mar 1999 15:17:56 GMT
From: jcasey@workingventures.ca (John Casey)
Subject: Re: Missing CGI Environment Variables
Message-Id: <36e68cab.176020844@wv-proxy>

Here is the code:

#!/perl5/bin/perl.exe
#!/usr/bin/perl
# Order the lines above so that the first gives the location
# of Perl on your system.  The rest become comments. 

#simple Perl script to print CGI inputs

print "Content-type: text/html\n\n";
print "<HEAD>\n";
print "<TITLE>Show CGI Inputs</TITLE>\n";
print "</HEAD>";
print "<BODY>";
print "<h1>Show CGI Inputs:</h1><hr>\n";

print "<h2>Command Line Arguments:</h2>\n";

$j=1;
foreach $a (@ARGV)
{
print "arg$j: $a<BR>\n";
$j=$j+1;
}


print "<HR>";
print "<h2>Environment Variables:</h2>\n";
print "SERVER_SOFTWARE = $ENV{'SERVER_SOFTWARE'}<BR>\n";
print "SERVER_NAME = $ENV{'SERVER_NAME'}<BR>\n";
print "GATEWAY_INTERFACE = $ENV{'GATEWAY_INTERFACE'} <BR>\n";
print "SERVER_PROTOCOL = $ENV{'SERVER_PROTOCOL'}<BR>\n";
print "SERVER_PORT = $ENV{'SERVER_PORT'}<BR>\n";
print "REQUEST_METHOD = $ENV{'REQUEST_METHOD'}<BR>\n";
print "HTTP_ACCEPT = $ENV{'HTTP_ACCEPT'}<BR>\n";
print "PATH_INFO = $ENV{'PATH_INFO'}<BR>\n";
print "PATH_TRANSLATED = $ENV{'PATH_TRANSLATED'}<BR>\n";
print "SCRIPT_NAME = $ENV{'SCRIPT_NAME'}<BR>\n";
print "QUERY_STRING = $ENV{'QUERY_STRING'}<BR>\n";
print "REMOTE_HOST = $ENV{'REMOTE_HOST'}<BR>\n";
print "REMOTE_ADDR = $ENV{'REMOTE_ADDR'}<BR>\n";
print "REMOTE_USER = $ENV{'REMOTE_USER'}<BR>\n";
print "CONTENT_TYPE = $ENV{'CONTENT_TYPE'}<BR>\n";
print "CONTENT_LENGTH = $ENV{'CONTENT_LENGTH'}<BR>\n";
print "DOCUMENT_NAME = $ENV{'DOCUMENT_NAME'}<BR>\n";
print "DOCUMENT_URI = $ENV{'DOCUMENT_URI'}<BR>\n";
print "DATE_LOCAL = $ENV{'DATE_LOCAL'}<BR>\n";
print "DATE_GMT = $ENV{'DATE_GMT'}<BR>\n";
print "PHYSICAL_PATH = $ENV{'PHYSICAL_PATH'}<BR>\n";
print "LOGICAL_PATH = $ENV{'LOGICAL_PATH'}<BR>\n";
print "HTTP_REFERER = $ENV{'HTTP_REFERER'}<BR>\n";
print "<hr>\n";
print "<h2>Standard Input:</h2>\n";
print "</BODY><HTML>\n";

It worked at school, so I can't really see it being the code


On Tue, 9 Mar 1999 23:51:03 -0500, rjk@linguist.dartmouth.edu (Ronald
J Kimball) wrote:

>John Casey <jcasey@workingventures.ca> wrote:
>
>> I later tried using the same script with Omnicron HTTPd/Perl5.
>> PATH_INFO and HTTP_REFERER do not work, but others do. Almost all of
>> my path type information does not work. 
>> 
>> Could this be because I am on an intranet (I dunno), an Omnicron HTTPd
>> limitation (doubt it) or something I did wrong(more than likely)?
>
>It's possible you did something wrong in your Perl code.  I might even
>have been able to point it out to you, if only you had included an
>example of the code that is not working for you.
>
>If your code is written properly, then it's one of the other things, and
>not specifically related to this newsgroup.
>
>-- 
>#!/usr/bin/sh -- chipmunk (aka Ronald J Kimball)
>    perl -s -e'print sort grep { /\s/ } keys %main::
>        ' -- -is -' Just' -' another ' -'Perl ' -'hacker 
>' http://www.ziplink.net/~rjk/ [rjk@linguist.dartmouth.edu]



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

Date: Wed, 10 Mar 1999 08:39:47 -0800
From: Jerome O'Neil <jeromeo@atrieva.com>
To: John Casey <jcasey@workingventures.ca>
Subject: Re: Missing CGI Environment Variables
Message-Id: <36E6A053.C849BC32@atrieva.com>

John Casey wrote:
> 
> Here is the code:
> 
> #!/perl5/bin/perl.exe

[Snip]

Here is a  less verbose method.

foreach(keys(%ENV)){
	print $_, q{=}, $ENV{$_}, qq{\n};
}

Saves many keystrokes, and is guaranteed to show you exactly what's in
%ENV.

Good Luck!

Jerome

> It worked at school, so I can't really see it being the code

Of course not.

-- 
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947 
The Atrieva Service: Safe and Easy Online Backup  http://www.atrieva.com


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

Date: Wed, 10 Mar 1999 15:14:08 GMT
From: jcasey@workingventures.ca (John Casey)
Subject: Re: MS ACCESS database with perl
Message-Id: <36e68c02.175851821@wv-proxy>

Do you have to use Active State or can you use Perl 5.0004 (not sure
how many zeros) from www.perl.com? 

On Wed, 10 Mar 1999 02:29:02 GMT, leonandrews@my-dejanews.com wrote:

>It's easy, so long as you are reasonably proficient with Perl and can get to
>grips with some documentation.
>
>You need ActivePerl 509 from http://www.activestate.com
>
>install DBD-ODBC and DBI using the ppm installer supplied with ActivePerl,
>set up an ODBC system DSN in control panel, and away you go.
>
>In fact, that's exactly what I did this morning, and it works very well. Give
>me a shout if you want more help,
>
>Leon.
>
>
>In article <7c0k8o$rjc$1@xenon.inbe.net>,
>  "Nicolas Malfeyt" <nicolasm@luon.be> wrote:
>> Is it possible and how hard would it be to send some kind of SQL query to an
>> MS ACCESS database residing on your webserver with Perl, and then using the
>> results in your web application?
>>
>> Thanks,
>>
>> Nicolas Malfeyt
>> nicolasm@luon.com
>>
>>
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    



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

Date: Wed, 10 Mar 1999 03:13:15 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Newbie needs help!!
Message-Id: <ri95c7.hi3.ln@magna.metronet.com>

Dev (hr5aa@herts.ac.uk) wrote:

: The error I get when I compile it 
: is "Missing comma after first argument to open function at comments.cgi 
: line 49, near "$fname)". Here is a sample of the code:

: $fname = ">>", $COMMENT_FILE;  
: open(OUT $fname);


   You should be checking to see if the open() succeeded.

   It might not you know...

      open(OUT, ">$COMMENT_FILE") || die "could not open '$COMMENT_FILE' $!";


: This was an example taken from a book, 
: and I copied it verbatim, which is 
: why this error is soooo annoying!! 


   Books can have mistakes in them.

   Just because it is printed doesn't make it right.


: Can anyone help?!??!?


   You don't need any help.

   perl has already told you what is wrong. 

   Just fix it by putting a comma after the first 
   argument to the open function.


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


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

Date: Wed, 10 Mar 1999 09:48:30 -0700
From: Jim Craft <jcraft@ucar.edu>
Subject: Re: Open Source compiling Perl: *NIX & wintel ???
Message-Id: <36E6A25E.45505F29@ucar.edu>

Dear Frustrated,

IMO, perhaps you need to move your desires for open source to a higher
level.  Rather than trying to maintain OSS at the compiler level, maintain
it at the Perl level.  ActiveStates Perl runs very similar to Perl compiled
with gcc on AIX and Linux, in my experience.  I develop Perl codes for AIX,
Linux, and NT4.0.  The only differences I've found are at the system level
(NT still has quite a ways to catch any *NIX system functionality).  I can
develop code on one platform, and drop it on another.  Let ActiveState sweat
the details on keeping up with *NIX, rather than trying to maintain
compilers for several platforms!  Again this is In My Opinion.  Your mileage
may differ!

Regards,

Jim Craft
Software Engineer
HIRDLS Project
University of Colorado Center for Limb Atmospheric Sounding
3300 Mitchell Lane Suite 250
Boulder CO 80301
(303) 497-8071




"Michael D. Schleif" wrote:

> I'm frustrated.
>
> I'm developing for a large heterogenous environment: several *NIX (AIX,
> HPUX, NCR, Solarix) *and* wintel (95, 98 & NT) platforms, with hundreds
> of systems on each.
>
> < . . .  >
>
>
> How have others of you handled this?  What are the alternatives to
> ActiveState Perl on wintel -- without a proprietary compiler, such as VC
> or BCC?
>
> --
>
> Best Regards,
>
> mds
> mds resource
> 888.250.3987
>
> "Dare to fix things before they break . . . "
>
> "Our capacity for understanding is inversely proportional to how much we
> think we know.  The more I know, the more I know I don't know . . . "

--
Jim Craft
HIRDLS Project
University of Colorado Center for Limb Atmospheric Sounding
3300 Mitchell Lane Suite 250
Boulder CO 80301
(303) 497-8071




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

Date: Wed, 10 Mar 1999 16:07:50 GMT
From: kstinson@hotmail.com
Subject: Re: Perl and a Here document
Message-Id: <7c65ce$s5q$1@nnrp1.dejanews.com>

In article <36E59642.6B5F984@giss.nasa.gov>,
  jglascoe@giss.nasa.gov wrote:
> [posted and mailed]
>
> kstinson@hotmail.com wrote:
> >
> > How can I mimic the "here document" facility in the korn shell using perl?
> > For Instance I have the following script that I would like duplicate in
perl:
> >
> > #/bin/ksh
> >
> > DOC_tool <<!
> > surf
> > 3160
> > q
> > !
> >
>
> Simply use a "pipe":
>
> open FH, "| DOC_tool" or die "can't open pipe: $!";
> print FH << "EOF";
> surf
> 3160
> q
> EOF
> close FH or die "pipe failed: $!";
>
> 	Jay Glascoe
> --
> 	"Even if you do learn to speak correct English,
> 	 whom are you going to speak it to?"
>
> 	--Clarence Darrow
>

The example of using the pipe works great.  Thanks.  Now I am trying to use
this and process the output.  How can I either get the output in a variable or
just process directly?

thanks,
Kevin

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 10 Mar 1999 14:27:14 GMT
From: scott@aravis.softbase.com (Scott McMahan)
Subject: Re: Perl and NT backoffice
Message-Id: <36e68142.0@news.new-era.net>

Mick (horizon@internetexpress.com.au) wrote:
> Hi.....Can Perl communicate with Backoffice?

Which component? BackOffice is a suite!

Scott



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

Date: Wed, 10 Mar 1999 16:23:28 GMT
From: strads@tmisnet.com (George Crissman)
Subject: Re: Perl comment
Message-Id: <36e69979.4817047@news2.tmisnet.com>

On Fri, 05 Mar 1999 10:46:21 +0100, Philip Newton  wrote:

>George Crissman wrote:
>> 
>> On Mon, 01 Mar 1999 12:07:06 +0100, Philip Newton  wrote:
>> >KC wrote:
>> >> dubing wrote:
>> >> > Is there any easy way to comment out a block of Perl code (like how
>> >> > /*....*/
>> >> > is used in C) instead of putting '#' at the beginning of each line
>> >> > line by line?
>> >> Nope. The pound sign is it.
>> >...and the advantage over C comments is that Perl comments can be
>> >"nested" ... if a line begins with '#' and you add another one, it's
>> >still a comment, whereas /* /* ... */ */ will usually cause problems :)
>> 
>> ...unless you set the "allow nested comments" flag in the compiler ...
>
>...which will promptly break your code when you port it to another
>system with a different C compiler...

True ... but I didn't say it would be portable.  I need to be more
specific, obviously.

-- George Crissman
-- strads@tmisnet.com

-----------------------------------------------------------------------
"There is no need to criminalize millions of legitimate and responsible
businesses and individuals in order to stop a very small group of
irresponsible people, particularly when there are other ways already
working ." says Mr. Dan Hufnal of the 10,000 member DEAA 
<http://www.deaa.com>. What does he mean by "already working"?
Maybe:  <http://www.tmisnet.com/~strads/spamhunt/index.html>
-----------------------------------------------------------------------


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

Date: 10 Mar 1999 08:06:32 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Perl Power Tools update
Message-Id: <36e68a78@csnews>

The following commands have implementations:

    addbib apply asa ar arch awk basename cal cat chmod chgrp chown
    clear cmp colrm comm cut dc diff dirname dos2unix du echo egrep env
    expand expr false fgrep fold grep head id join kill look ls make
    mkdir mkfifo od paste ping printenv printf pwd rev rm rmdir shar
    sleep split strings sum tac tail tar tee test touch tr true tsort
    tty uname unexpand uniq units unix2dos unshar uuencode uudecode wc
    which xargs yes --- banner ching factor fish hangman maze moo morse
    pig pom ppt primes random wump

The following commands still need volunteers:  

    apropos bc col cp date dd ed file find fmt ftp hostname lex ln locate
    lock m4 machine mail man more mv nroff patch pr rc sed sh sort spell
    stty talk telnet time ul whatis yacc --- adventure arithmetic atc
    backgammon battlestar bcd bj boggle bs caesar canfield cfscores
    checkers chess cribbage fortune gomoku grdc hack hunt huntd larn
    mille monop number phantasia quiz rain reversi robots rogue sail
    snake snscore tetris trek ttt words worm worms

If you can think of any more that should be in these lists (especially
because you have an implementation to send in :-), please let us 
know.

    http://language.perl.com/ppt/

--tom
-- 
Build a system that even a fool can use, and only a fool will want to use it.


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

Date: Wed, 10 Mar 1999 15:46:59 GMT
From: Chad M. Townsend <chad@vcn.net>
Subject: please help with compiling perl/modules 5.005
Message-Id: <7c645f$r2a$1@nnrp1.dejanews.com>



I thought I posted this, but here goes again.

I am having trouble compiling perl modules.  Perl scripts compile just fine.
I'm using 'perlcc' in the new release of perl.  Could someone please explain
exactly how to compile the below script and module so they work together?

Thanks,
-- cut --
#!/usr/bin/perl
use Timer;
$timer = new Timer;
sleep 5;
print "elapsed: ", $timer->Elapsed(), "\n";
-- cut --

-- cut --
package Timer;

sub new {

  my $pkg = shift;
  bless { created => time }, $pkg;
}

sub Elapsed {

  my $self = shift;
  return time - $self->{created};
}
1;
-- cut --

--------------------------------------------------------
Chad M. Townsend         Virtual Community Network, Inc.
Chief Technical Officer  Your Local Community Online!
chad @ vcn.net           http://www.vcn.net

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 10 Mar 1999 13:30:26 GMT
From: jstrike@execpc.com
Subject: problems with readdir
Message-Id: <7c5s4h$snd@newsops.execpc.com>

Has anyone had any problems with readdir returning different results
on different platforms?  I'm working on a program that reads a
directory, grabs the .pdf files in that directory, sorts them, and
displays the 4 newest files on the web page.  I wrote it on a win 98
machine and moved it to our web server. (IIS on Intel NT)  Works fine
on the 98 machine, and from a command prompt on the NT server, but
when I transfer it to the NT machine and run it from the browser it
doesn't return the size or any of the time attributes.  I just need to
get the last modified time so I can sort the files.  At this point I'm
somewhat inclined to think that it's a setting on the IIS server.   

Any help is greatly appreciated.

TIA,
-Jeff


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

Date: Wed, 10 Mar 1999 16:08:27 GMT
From: dimitrio@fantom.com (Dimitri Ostapenko)
Subject: Re: problems with readdir
Message-Id: <%NwF2.166$0T2.98@198.235.216.4>

Could you spare a little bit of code?

--
If we knew what it was we were doing, it would not 
be called research, would it? 
                                     - Albert Einstein 


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

Date: Wed, 10 Mar 1999 13:55:29 +0100
From: Peter John Acklam <jacklam@math.uio.no>
Subject: Re: s/\n\s// don't work
Message-Id: <36E66BC1.8BA96851@math.uio.no>

Manfred Brunner wrote:
> 
> I just want to substitute from stdin all newline followed by
> whitespace beginning in the next line, with nothing.

>From the "perlsub" manpage:

    # get a line, combining continuation lines
    #  that start with whitespace

    sub get_line {
        $thisline = $lookahead;  # GLOBAL VARIABLES!!
        LINE: while (defined($lookahead = <STDIN>)) {
            if ($lookahead =~ /^[ \t]/) {
                $thisline .= $lookahead;
            }
            else {
                last LINE;
            }
        }
        $thisline;
    }

    $lookahead = <STDIN>;       # get first line
    while ($_ = get_line()) {
        ...
    }

Peter

-- 
Peter J. Acklam - jacklam@math.uio.no - http://www.math.uio.no/~jacklam



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

Date: Wed, 10 Mar 1999 11:57:53 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Shouldn't we have 'perlmonger' ?
Message-Id: <comdog-ya02408000R1003991157530001@news.panix.com>

In article <7c4247$23l$1@nnrp1.dejanews.com>, @l@ <aqumsieh@matrox.com> posted:

> In article <comdog-ya02408000R0703992005510001@news.panix.com>,
>   comdog@computerdog.com (brian d foy) wrote:
> > In article <7bsgtj$p9t$1@nnrp1.dejanews.com>, @l@ <aqumsieh@matrox.com>
> posted:
> >
> > > --Ala
> > > $monger->{montreal}->[0];
> >
> > why are you signing your posts with Nicolas Bertrand's
> > monger designation?
> 
> Shouldn't we have a perlmonger pod?

i see no reason to pollute the Perl documentation with such things.  
perhaps if there was a convincing argument...

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>


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

Date: Wed, 10 Mar 1999 13:38:29 +0000
From: Krzysztof Zaleski <kzal@pol.pl>
Subject: Sorting IP numbers
Message-Id: <36E675D5.2A95E900@pol.pl>

Hi,

Does anyone know how to sort IP numbers? When I use sort function I get
(which is proper output, anyway):
10.0.0.1
10.0.0.2
10.0.0.3
10.0.0.4
10.0.0.41
10.0.0.42
10.0.0.5
10.0.0.6 ... etc.
Sorting class C is as simple as spliting last element and sorting array
of those elements, but how to sort A and B classes?

Krzysztof
-- 

-----------------------------------------------
Krzysztof Zaleski, System Engineer, kzal@pol.pl
Polska OnLine, Emaliowa 28, 02-295 Warsaw, PL
tel: (48 22) 8680808, fax: (48 22) 8466271
-----------------------------------------------
Linux is like wigwam: no windows, no gates...
                         ... and apache inside.


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

Date: 10 Mar 1999 13:55:27 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Sorting IP numbers
Message-Id: <slrn7ecuef.sni.sholden@pgrad.cs.usyd.edu.au>

On Wed, 10 Mar 1999 13:38:29 +0000, Krzysztof Zaleski <kzal@pol.pl> wrote:
>Hi,
>
>Does anyone know how to sort IP numbers? When I use sort function I get
>(which is proper output, anyway):
>10.0.0.1
>10.0.0.2
>10.0.0.3
>10.0.0.4
>10.0.0.41
>10.0.0.42
>10.0.0.5
>10.0.0.6 ... etc.
>Sorting class C is as simple as spliting last element and sorting array
>of those elements, but how to sort A and B classes?

This was discussed here some time ago, so dejanews might give you some answers.

I think one relatively easy way suggested was to pack() the four numbers into
a four byte string (since they range from 0-255) and then do a normal sort and
then upack() them. However, I also believe there is function whose name I
can not recall in a module I also can't recall which does the packing for
you and has some other useful properties to do with IP addresses that don't
use all four numbers. My memory could be wrong since I didn't follow the
thread closely.

However, I'm sure you can find what you want on dejanews (and the pack, unpack
method will work for the above data anyway).

-- 
Sam

The very fact that it's possible to write messy programs in Perl is also
what makes it possible to write programs that are cleaner in Perl than
they could ever be in a language that attempts to enforce cleanliness.
	--Larry Wall


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

Date: 10 Mar 1999 15:22:18 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Sorting IP numbers
Message-Id: <7c62na$41v$2@info2.uah.edu>

In article <36E675D5.2A95E900@pol.pl>,
	Krzysztof Zaleski <kzal@pol.pl> writes:
: Does anyone know how to sort IP numbers?

Here's one way:

my @sorted = map  { $_->[0] }                  # compute the list of
             sort {                            # addresses sorted by
                  $a->[1] <=> $b->[1]          # the first octet..
                          ||                   # or..
                  $a->[2] <=> $b->[2]          # the second octet..
                          ||                   # or..
                  $a->[3] <=> $b->[3]          # the third octet..
                          ||                   # or..
                  $a->[4] <=> $b->[4]          # the fourth octet (fallback)
             }
             map { [ $_, split /\./ ] }
             @ip_addrs;                        # of the IP addresses

Hope this helps,
Greg
-- 
A meeting is an event at which the minutes are kept and the hours are lost.


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

Date: Wed, 10 Mar 1999 14:26:14 GMT
From: Mark <admin@asarian-host.org>
Subject: Re: split?
Message-Id: <7c5vdq$mhc$1@nnrp1.dejanews.com>

In article <7c1fnh$qbg$1@nnrp1.dejanews.com>,
  bing-du@tamu.edu wrote:

> Hello there,
>
> There is a string  $test = "3:http://www.test.edu/building.html".
>
> How to split this string to get two parts.  One is "3" and the other is
> "http://www.test.edu/building.html"?
>
> I tried the command:
>
>  ($first, $second) = split(/:/,$test);
>
> Then $first is "3".  However $second is just "http" instead of
> "http://www.test.edu/building.html" which is what I want.
>
> Any idea?  Thanks in advance.
>
> Bing


How about:

($first, $second) = split(/:/, $test, 2);

- Mark

        System Administrator Asarian-host.org

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 10 Mar 1999 16:17:35 GMT
From: slamda@hotmail.com
Subject: URGENT: Problem with Bitwise AND
Message-Id: <7c65uk$snh$1@nnrp1.dejanews.com>

Hi,

I'm using hashtables to store both namedata and mask data which I then
AND together.

However - when I do this I get the unexpected results of producing
zero's...i.e some sample output from my script:


CLUB: Fencing Club FIELD :activity DATA: 2368 MASK: 2048 R: 0

Now output shown is simply the result of...

    $r=($clubdata{'Fencing Club'} & $mask{'activity'});

which equates to 2368 & 2048 ....which should yield 2048 not 0 - my results
are the same whatever field/mask combinations are used.

I have a sneaking suspicion that the hashtable's are not storing my values as
numbers and hence my bitwise AND is being performed on strings?

Can anybody help me - i need the bitwise and to be done on the NUMBERS stored
in the hashtable NOT on the numbers as strings!?

Thanks in advance

  Ian Dash

####### FULL CODE HERE #################################

#!/usr/bin/perl

#use CGI;

#hashtable of bits for categories - fitness,expensive etc etc

$mask{"regular"}=65536;
$mask{"team"}=32768;
$mask{"trips"}=16384;
$mask{"social"}=8192;
$mask{"fitness"}=4096;
$mask{"activity"}=2048;
$mask{"water"}=1024;
$mask{"expensive"}=512;
$mask{"competitive"}=256;
$mask{"outdoors"}=128;
$mask{"size"}=64;
$mask{"newex"}=32;
$mask{"intell"}=16;
$mask{"charity"}=8;
$mask{"polit"}=4;
$mask{"campg"}=2;
$mask{"public"}=1;

#HashTable for table data - 1 and 0's stuff [binary numbers]
#Bits set for club data - ie is expensive etc.

$clubdata{"Canoeing Club"}=61056;
$clubdata{"Cross Country Club"}=39296;
$clubdata{"Explorer's Club"}=26816;
$clubdata{"Fencing Club"}=2368;
$clubdata{"Gliding Club"}=68256;
$clubdata{"Jui Jitsu"}=31504;
$clubdata{"Combat Karate Club"}=6928;
$clubdata{"Mountain Climbing Club"}=88960;
$clubdata{"Cycling Club"}=80768;
$clubdata{"Orientering Club"}=92560;
$clubdata{"Coalition for Tibet Society"}=65566;
$clubdata{"Political Society"}=73751;
$clubdata{"Debating Society"}=74005;

#Hashtable to keep score

$clubscore{"Canoeing Club"}=0;
$clubscore{"Cross Country Club"}=0;
$clubscore{"Explorer's Club"}=0;
$clubscore{"Fencing Club"}=0;
$clubscore{"Gliding Club"}=0;
$clubscore{"Jui Jitsu"}=0;
$clubscore{"Combat Karate Club"}=0;
$clubscore{"Mountain Climbing Club"}=0;
$clubscore{"Cycling Club"}=0;
$clubscore{"Orientering Club"}=0;
$clubscore{"Coalition for Tibet Society"}=0;
$clubscore{"Political Society"}=0;;
$clubscore{"Debating Society"}=0;

#$query=new CGI;


print("Content-type: text/html\n\n"); print"<html><body>"; foreach $clubname
(keys(%clubdata)) {  ##iterate through clubnames  foreach $fieldname
(keys(%mask)) {  ##iterate through fields to mask 
$result=($clubdata{$clubname} & $mask{fieldname});  print("CLUB: $clubname
FIELD :$fieldname DATA: $clubdata{$clubname} MASK: $mask{$fieldname} R:
$result\n");  }  } #@hello=$query->param; #print join("<br>",@hello);
print"</body></html>";

exit;

####################### code ends #########################

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 10 Mar 1999 15:21:39 GMT
From: Phil Kime <Phil.Kime@ed.ac.uk>
Subject: Wrapping perl and #! problems
Message-Id: <exg1zix9xq4.fsf@ed.ac.uk>

Greetings,
    I have a need currently to wrap perl so that

#!/usr/bin/perl

calls a wrapper like this

/usr/bin/perl -> perl.wrapper

and perl.wrapper execs particular perl binaries and logs usage. Does
anyone have any information about this? Perl.wrapper needs to be a
binary, not a script, of course but are there any other issue involved
or neat ways of doing this? Mail as well as follow up please.

		    PK

-- 
=                   Dr Phil Kime (Phil.Kime@ed.ac.uk)                 =
=             Dept of Philosophy/Centre for Cognitive Science         =
=                         University of Edinburgh                     =


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

Date: Wed, 10 Mar 1999 13:49:24 +0100
From: Peter John Acklam <jacklam@math.uio.no>
Subject: Re: Your opinion on an HTML stripper regex
Message-Id: <36E66A54.D6100E33@math.uio.no>

Jonathan Stowe wrote:
> 
> =head2 How do I remove HTML from a string?
> 
> (...)
> 
> Here's one "simple-minded" approach, that works for most files:
> 
>     #!/usr/bin/perl -p0777
>     s/<(?:[^>'"]*|(['"]).*?\1)*>//gs
> 
> (...)

I guess it's not that important, but

    s/<[^>'"]*(?:(['"]).*?\1[^>'"]*)*>//gs

was slightly faster, and

    s/<[^>'"]*(?:(?:"[^"]*"|'[^']*')[^>'"]*)*>//g

was almost twice as fast on my test cases (with Perl 5.005_02).
Both use the "unrolling the loop" approach from J. E. Friedl's
"Mastering Regular Expressions".

Peter

-- 
Peter J. Acklam - jacklam@math.uio.no - http://www.math.uio.no/~jacklam




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

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


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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