[8405] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2022 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 4 16:07:25 1998

Date: Wed, 4 Mar 98 13: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           Wed, 4 Mar 1998     Volume: 8 Number: 2022

Today's topics:
    Re: "Learning Perl" or "Programming Perl" (Greg Bacon)
    Re: "Learning Perl" or "Programming Perl" (Benjamin Smith)
    Re: "Learning Perl" or "Programming Perl" (I R A Aggie)
        A perl question demarcao@sysadm.suny.edu
        Arrays and using output of executed program as input (Craig Keefner)
        constants as keys in hashes <orjana@acm.org>
    Re: constants as keys in hashes <ajohnson@gpu.srv.ualberta.ca>
    Re: constants as keys in hashes <orjana@acm.org>
        debugging 'Out of Memory' <jdporter@min.net>
    Re: Directory Processing and File output <jdporter@min.net>
    Re: Example for use Win32::NetResource::AddConnection (Jeffrey R. Drumm)
        Follow up to "PERL" puzzle <kevin@wx3.com>
        Log Stats  Looking for program (Ron Newton)
    Re: Lynx like browser in Perl <jdporter@min.net>
        mSQL crashing - HELP info@gadnet.com
    Re: passing wildcard file args to NT perl script (Martin Vorlaender)
    Re: perl compiler? (Ed Jamison)
    Re: perl compiler? <jdporter@min.net>
    Re: Perl on MS Personal Web Server <barnett@houston.Geco-Prakla.slb.com>
    Re: Perl performs a second miracle.  Prepare for canoni <jlannom@ford.com>
    Re: Q: How to (Craig Berry)
    Re: Q: How to <lsj@bnl.gov>
    Re: Q: How to <jdporter@min.net>
        QUESTION ! how to fill out referer variable in LWP::USE lufan@cheerful.com
    Re: QUIZ: answer and hash slice tutorial <jdporter@min.net>
        Search Scripts <niting@raleigh.ibm.com>
    Re: What is PERL? Learn JAVA instead? (Michael J Gebis)
    Re: What is PERL? Learn JAVA instead? (Nathan V. Patwardhan)
    Re: What is PERL? Learn JAVA instead? <jdporter@min.net>
    Re: What is PERL? Learn JAVA instead? <jdporter@min.net>
    Re: What is PERL? Learn JAVA instead? <bslone@earthlink.net>
    Re: Why PERL? [Re: Beginner in trouble] (Mike Ellwood)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 4 Mar 1998 18:56:24 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: "Learning Perl" or "Programming Perl"
Message-Id: <6dk84o$5gh$1@info.uah.edu>

In article <6dinik$lru$1@ionews.ionet.net>,
	Benjamin Smith <benbean@ionet.net> writes:
: I have to say though, Tom Christiansen's behaviour on this newsgroup has
: put me off putting money in his pocket. I love my other O'Reilly
: books... it's a pity he's causing me to debate purchasing another.

Give me a break.  Don't judge a man until you've walked a mile in his
shoes.  How would you feel if you gave ten years of your life to
something, only to watch it go to shit because some people are too
lazy to read the *hundreds* of pages of FAQs and other documentation
(mostly written by the aforementioned ``bad seed'').  I understand
Tom's position perfectly.

As for Tom's contempt for the sub^H^H^Hnon-Unix platforms (particularly
Win32), take a guess at what platform harbors the greatest percentage
of Known Lazy Bastards?  On the EFnet IRC #perl channel, we used to
check what client people asking FAQs, showing a gimme-gimme attitude,
or otherwise being rude were using.  It became a joke how often mIRC
(a win32 client) came up.  For a while we contemplated banning the
mIRCers.

If it weren't for ``Tom Christiansen's behaviour on this newsgroup''
it would be in a much sorrier state than it already is.  I like when
I see Tom pointing out that someone's excuse for a newsreader really
maimed the quoting, that munging the From: address is Bad, Evil, and
Wrong, or that the poster himself forgot to hit enter.  clpm is about
the only newsgroup where the regulars seem to even care about
netiquette.  If Tom leaves, I suspect most of the regular answerers
won't be far behind.  Run Tom out of town if you like, but you'll be
blowing your own head off in the process.

This used to be a really cool newsgroup.  It used to be pleasurable
to read the articles and answer questions where I could.  Now it's
just wading through a river of FAQs.  I'll be glad when we get our
moderated group.

Greg
-- 
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF


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

Date: Wed, 04 Mar 1998 19:50:21 GMT
From: benbean@yahoo.com-*nospam*- (Benjamin Smith)
Subject: Re: "Learning Perl" or "Programming Perl"
Message-Id: <34fdae32.15620144@news.ionet.net>

On 4 Mar 1998 18:56:24 GMT, gbacon@cs.uah.edu (Greg Bacon) wrote:

>If it weren't for ``Tom Christiansen's behaviour on this newsgroup''
>it would be in a much sorrier state than it already is. 

My rebuttal to this would be that sure, there is plenty of online
documentation supplied with Perl, all of which I'm sure covers just
about everything one needs to know about the language. But, for the
sake of argument, apply the same logic to learning C entirely based on
a definition of the language, its syntax and constructs. Sure, all the
information is there in the compiler help and man pages but without a
guide of some sort to present the information in a logical and
straight-forward manner it doesn't do the beginner any good.

My point is this: if it were possible to learn Perl entirely from the
supplied documentation alone there would be no market for books such
as Mr Christiansen's. If you already have a basic working knowledge of
the language, referring to the man pages and FAQs may be of help, but
if you're just starting out in a language, sometimes it's just easier
to ask a peer who has been through this learning process themselves.

Whilst I agree that it's perfectly adequate to assist an asker of a
frequently asked question by pointing them to an FAQ list or article
somewhere that answers their question, I don't think it necessary to
ridicule or abuse them in the process. It's possible to be terse, and
make your point without being rude. It may be the hundredth time
you've pointed somebody to this solution, but it's the first time for
them, and they deserve at least one chance each, wouldn't you say?


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

Date: Wed, 04 Mar 1998 15:37:35 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: "Learning Perl" or "Programming Perl"
Message-Id: <fl_aggie-0403981537350001@aggie.coaps.fsu.edu>

In article <6dk84o$5gh$1@info.uah.edu>, gbacon@cs.uah.edu (Greg Bacon) wrote:

+ As for Tom's contempt for the sub^H^H^Hnon-Unix platforms (particularly
+ Win32), take a guess at what platform harbors the greatest percentage
+ of Known Lazy Bastards? 

ObKLB story: the shop next door is NT dominated. Their sysadmin grouses
about his users asking him how to do certain things with certain 
applications. Not because they're bugging him, but because they're
asking questions that can be answered using Microslug's on-line help
system.

Its not that they don't know how to use it -- he's shown them -- but that
they think its easier to pick up the phone and call him.

Heh.

ObBooks: Programming Perl, for sure, Learning Perl if you want a kinder,
gentler introduction.

James

-- 
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>


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

Date: Wed, 04 Mar 1998 14:18:33 -0600
From: demarcao@sysadm.suny.edu
Subject: A perl question
Message-Id: <6dkctf$sno$1@nnrp1.dejanews.com>

I have aproblem that I need some help on.

I have a variable that I need to check for a space and replace the space with
%20, Can anyone give me an example on how to do this??

Thanks,

Alex

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Wed, 04 Mar 1998 19:20:55 GMT
From: keefner@kinetic.com (Craig Keefner)
Subject: Arrays and using output of executed program as input
Message-Id: <34fda3fe.343301451@news.visi.com>

I've checked perlfaq8 and can't get this to work right.
Also scanned current postings.

Under activestate for nt, i need to run a search program
with some parameters I gather and have those results
stored in an array.

open(JUSTDO, "|dos_search.exe /p $part /m \"$model\" /s $year >tmp/$$.file");
close(JUSTDO);
unless (open(MYFILE, "tmp/$$.file")) {
    die ("cannot open file");
}
system("rm /netscape/suitespot/cgibin/tmp/$$.file");
@array=<MYFILE>;
 .....

one problem is the system rm does not work and delete the
temp file I create but at least I get the results into the
array (despite poor error checking)

I've tried to execute and read the data in w/o writing the
tmp like this..from the command line..

$part="value";
$year="value";
$model="value";

@proglist=('dos_search.exe /p $part /y $year /m $model');
system($proglist);

but using the scalars $part, $year & $model doesn't work.
If I hardcode the values intot he script it does work.

And if it will work, how do I get the results of the
system($proglist) into an array for processing?

TIA

Craig




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

Date: Wed, 04 Mar 1998 19:06:54 +0000
From: Oerjan Nygaard Austvold <orjana@acm.org>
Subject: constants as keys in hashes
Message-Id: <34FDA64E.71712819@acm.org>

use constant FOO => "bar";
my %Hash = ( @{ [ FOO ] } => "foobar" );

This works fine and declares Hash as ( bar => "foobar" ), but isn't
there an easier way of reffering to a constant as a key in a hash?

-Oerjan.

-- 
Oerjan Nygaard Austvold    __________ Signature __________
Dept. of Computer Science /   tel/fax: +47 776 44571/44580
University of Tromsoe    /           mailto:orjana@acm.org 
N-9037 Tromsoe, Norway  / http://hstud3.cs.uit.no/~orjana/


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

Date: Wed, 04 Mar 1998 13:27:24 -0600
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: constants as keys in hashes
Message-Id: <34FDAB1C.36861AE9@gpu.srv.ualberta.ca>

Oerjan Nygaard Austvold wrote:
> 
> use constant FOO => "bar";
> my %Hash = ( @{ [ FOO ] } => "foobar" );
> 
> This works fine and declares Hash as ( bar => "foobar" ), but isn't
> there an easier way of reffering to a constant as a key in a hash?

one way, not much simpler:

use constant FOO =>'bar';
my %hash = (${\FOO} => 'foobar');
print join(':',each %hash);

another way, much simpler, just use the comma
operator rather than the => to avoid autoquoting
of the LHS:

use constant FOO =>'bar';
my %hash = (FOO,'foobar');
print join(':',each %hash);

regards
andrew


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

Date: Wed, 04 Mar 1998 19:42:43 +0000
From: Oerjan Nygaard Austvold <orjana@acm.org>
Subject: Re: constants as keys in hashes
Message-Id: <34FDAEB3.ACADB555@acm.org>

Andrew Johnson wrote:
> 
> another way, much simpler, just use the comma
> operator rather than the => to avoid autoquoting
> of the LHS:
> 
> use constant FOO =>'bar';
> my %hash = (FOO,'foobar');
> print join(':',each %hash);
> 

Thanks! I didn't think of autoquoting at all! :-)

So now you can write something like

$hash{ +FOO } to refer to element with key 'bar'... Great!

-Oerjan.


-- 
Oerjan Nygaard Austvold    __________ Signature __________
Dept. of Computer Science /   tel/fax: +47 776 44571/44580
University of Tromsoe    /           mailto:orjana@acm.org 
N-9037 Tromsoe, Norway  / http://hstud3.cs.uit.no/~orjana/


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

Date: Wed, 04 Mar 1998 15:05:40 -0500
From: John Porter <jdporter@min.net>
Subject: debugging 'Out of Memory'
Message-Id: <34FDB414.42B6@min.net>

Has anyone here had any experience dealing with
the 'Out of Memory!' condition?

This apparently occurs when a request is small;
since it dies (according to the docs), it should
be possible to trap this exception (once) -- but
only if perl was compiled with EMERGENCY_SBRK
defined and using perl's malloc.

As far as I can tell, my perl was not so compiled,
because the condition is not throwing an exception
I can catch.  (Also, I can't change that, because
I'm running on an ISP's server.)

Here's my situation:
I'm developing my CGI perl program on a local
Solaris machine, and everything works fine.
Then I upload it to the ISP's BSD/OS Virtual
Kernel machine, and I run out of memory.

I'm not sure what to do next, other than to go
through the code with a fine-tooth comb, looking
for where I might be doing unnecessary copying
of data structures.

AHMA.
John Porter


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

Date: Wed, 04 Mar 1998 14:29:26 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Directory Processing and File output
Message-Id: <34FDAB96.859@min.net>

Josh Cook wrote:
> 
> I'm _very_ new to programming

Have you read "Learning Perl"?  Yes? Good.
Now read the excellent FAQs, provided with your
installation of perl.

> I need to parse through a directory and 'grab' only the .htm files.

This is called "file globbing", and is implemented in perl via
the "glob" function.  To read info on glob, do this in a
command window:

	perldoc -f glob

(This technique works with other functions too.
You might even try 
	perldoc perldoc
and
	perldoc perl
for more essential info.)

> ...If there is a file called me.htm, 
> ...the script to produce ... something like this:
> 
> <a href="me.htm">me</a>

So you want to split the string at the dot, eh?
Check out the "split" function. 
(Yes, you guessed it: perldoc -f split).

hth,
John Porter


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

Date: Wed, 04 Mar 1998 20:44:06 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: Example for use Win32::NetResource::AddConnection
Message-Id: <34fdb89b.96827160@news.mmc.org>

On Wed, 4 Mar 1998 16:49:30 +0100, "Burkhard Kiesel"
<burkhard.kiesel@med.siemens.de> wrote:

>Hi there,
>
>is there anyone who has experience with the Win32::NetResource module.
>May be it is possible that I can get some examples how to use this.
>I just want to connect to a shared drive on a other host.
>
>Thanks in advance
>
>Burkhard

This works on my system (with the password and username suitably changed), but
don't ask me why:

#!d:/perl5.04/bin/perl.exe -w

my ($error,%resource);

use Win32::NetResource;

# Note: for Netware resources, change Provider to 'Netware Services'

%resource = 	(Scope => RESOURCE_CONNECTED,
		 Type => RESOURCETYPE_DISK,
		 DisplayType => RESOURCEDISPLAYTYPE_SERVER,
		 Usage => RESOURCEUSAGE_CONNECTABLE,
		 LocalName => 'Y:',
		 RemoteName => '\\\\HERMES\\CDROM0',
		 Comment => 'Oy gee wow!',
		 Provider => 'Microsoft Windows Network');

unless (Win32::NetResource::AddConnection(\%resource,'pass','user',1)) {
	Win32::NetResource::GetError($error);
	print "Couldn\'t connect to $resource{RemoteName}. Error # $error\n",
	      "Type NET HELPMSG $error for the failure reason, since\n"},
              "WNetGetLastError() seems to be broken.\n"}
__END__

-- 
                               Jeffrey R. Drumm, Systems Integration Specialist
                       Maine Medical Center - Medical Information Systems Group
                                                            drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented!" - me


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

Date: Wed, 04 Mar 1998 14:26:37 -0500
From: "Kevin J. Lin" <kevin@wx3.com>
Subject: Follow up to "PERL" puzzle
Message-Id: <34FDAAED.797BDBA0@wx3.com>

As promised, the solution to that "PERL" puzzle.  

The answer was, of course, "I Touch Myself" by the Divinyl.

Full translation:

#!/usr/bin/perl

&lv($i,my($self));                 # I love myself

$want=&lv($u,$me);                 # I want you to love me,

if ($i<0){                         # When I feel down,
	$want=++$me;                   # I want you above me.
}

grep my($self)/$me;                # I search myself   
$want=(grep $u/$me);               # I want you to find me

if(unlink $me){                    # I forget myself
	$want=alarm $me;           # I want you to remind me
}

$want=~ tr/$u/ /c;                 # I don't want anybody else

if ($thinking=$u){                 # When I think about you 
	utime time, time, my($self);   # I touch myself!
}

$want=~ tr/$u/ /c;                 # I don't want anybody else

#o!o!o!                            # Oh no, oh no, oh no!

bless($me,$u);                     # You're the one who makes me happy
(diff version of song)
??????????????                     # You're the sun who makes me shine
??????????????                     # When you're around, I'm also
laughing
$want=my($u);                      # I want to make you mine.
 
CLOSE(my($i)); CLOSE(my($i));      # I close my eyes
??????????????                     # and see you before me
if ($u eq 'IGNORE'){               # Think I would die, if you were to
ignore me.
	die $i;
}

??????????????                     # A fool could see
??????????????                     # just how much I adore you
while ($i>$knees){                 # I get down on my knees
	--$i;
}
for (;$u==$u;){                    # I'll do anything for you
	do (anything.pl)
}

$want=~ tr/$u/ /c;                 # I don't want anybody else

if ($thinking=$u){                 # When I think about you
	utime time, time, my($self);   # I touch myself	
}

$want=~ tr/$u/ /c;                 # I don't want anybody else

#o!o!o! (yeah)                     # Oh no, oh no, oh no! (Yeah...)

&lv($i,my($self));                 # I love myself

$want=&lv($u,$me);                 # I want you to love me

if ($i<0){                         # When I'm feeling down
	$want=++$me;               # I want you above me
}

grep my($self)/$me;                # I search myself
$want=(grep $u/$me);               # I want you to find me

if(unlink $me){                    # I forget myself
	$want=alarm $me;           # I want you to remind me
}

$want=~ tr/$u/ /c;                 # I don't want anybody else

if ($thinking=$u){                 # When I think about you
	utime time, time, my($self);   # I touch myself	
}

$want=~ tr/$u/ /c;                 # I don't want anybody else

#o!o!o!                            # Oh no, oh no, oh no!

$want=$u;                          # I want you
$want=~ tr/$u/ /c;                 # I don't wany anybody else

if ($thinking=$u){                 # When I think about you
	utime time, time, my($self);   # I touch myself
}
 
#oo ooo ooooo                      # Oo, ooo, ooooooh!

for($i=0;i<8;++i){;}               # I I I I I I I I...
$want=~ tr/$u/ /c;                 # I don't want anybody else

if ($thinking=$u){                 # When I think about you
	utime time, time, my($self);   # I touch myself
}

$want=~ tr/$u/ /c;                 # I don't want anybody else.

if ($thinking=$u){                 # I touch myself, I touch myself,
etc...
	for ($i=0;i<14;++i){
		utime time, time, my($self);	
	}
}


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

Date: Wed, 04 Mar 1998 20:22:56 GMT
From: rknewton@loxinfo.co.th (Ron Newton)
Subject: Log Stats  Looking for program
Message-Id: <34fdb7b5.29814909@news.loxinfo.co.th>

I am looking for a LOG file analysis program. Eitrher freeware or
Shareware does any one know of such a beast.

Regards


Internet: Training Support Web Design Web Hosting (Virtual Servers)
-----------------------------------------------------
  Have you read SiamNews today?  http://siamnews.com


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

Date: Wed, 04 Mar 1998 15:29:20 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Lynx like browser in Perl
Message-Id: <34FDB9A0.6A5F@min.net>

dominic@shafika.vetri.com wrote:
> 
> Hello,
> 
> Is there any lynx like character level browser available in Perl? It should
> not display jazzy pictures etc.
> 
> Or my objective is - An operator will call a home page (pre defined and he
> should not go to other sites) and he will get a form sort of a table and he
> will enter some data. Later Supervisor to that operator will approve the data
> entered by the operator and the same wil go as a report.
> 
> Some will be using only dumb terminal and some other will use
> Netscape/Iexplorer.

>From this description, I don't understand why you want a text-mode
browser
written in perl.  You want Lynx.  Lynx is amazingly powerful, especially
in the area of restricting access, e.g. to specific sites.

All the real work for your application is on the server side.
You can do all that good stuff in perl.

hth,
John Porter


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

Date: Thu, 05 Mar 1998 00:28:08 GMT
From: info@gadnet.com
Subject: mSQL crashing - HELP
Message-Id: <34fdf185.43488362@news.newsguy.com>

I have been happily running mSQL for a while on my site without any
problems. I have just uploaded an new program that displays statistics
about the contents of my database. The program does 64 consecutive
'select' statements, storing the results from each one before
displaying the information. The problem is that sometimes (frequently)
although far from always, this program seems to bring down the mSQL
server and I have to restart it.

Any ideas why this might happen? Has anybody else had experience of
programs apparently bringing the server down?

Thanks,

Drummond Miles



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

Date: Wed, 04 Mar 1998 20:12:33 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: passing wildcard file args to NT perl script
Message-Id: <34fda7a1.524144494f47414741@radiogaga.harz.de>

jason@dtlweb.com wrote:
: I'm just trying to write a simple script to do some text substitutions in a
: batch of files on NT, i.e, I want to be able to enter
:      perl myscript.pl *.txt
: and have it run on all the .txt files in the directory. But instead I just get
: a pesky "Can't open *.*: No such file or directory" message.
: I'm ftp-ing all my files up to my Unix box, where this syntax works, but I'm
: most curious to know if there is some easy way to accomplish the same thing
: on NT. It seems like such a common thing to need to do...

Put the following into a path in @INC, SET PERL5OPT=-MWild, and there you go.
To give credit: I think it's from Gurusamy Sarathy, but I deleted the reference.

Hope it helps,
  Martin

[--Wild.pm--]
=pod

=head2 Why won't my perl understand wildcards in arguments?

The default command shells on DOS descendant operating systems (such
as they are) usually do not expand wildcard arguments supplied to
programs.  They consider it the application's job to handle that.
This is commonly achieved by linking the application (in our case,
perl) with startup code that the C runtime libraries usually provide.
However, doing that results in incompatible perl versions (since the
behavior of the argv expansion code differs depending on the
compiler, and it is even buggy on some compilers).  Besides, it may
be a source of frustration if you use such a perl binary with an
alternate shell that *does* expand wildcards.

Instead, the following solution works rather well. The nice things
about it: 1) you can start using it right away 2) it is more powerful,
because it will do the right thing with a pattern like */*/*.c
3) you can decide whether you do/don't want to use it 4) you can
extend the method to add any customizations (or even entirely
different kinds of wildcard expansion).

	C:\> copy con c:\perl\lib\Wild.pm

=cut

	# Wild.pm - emulate shell @ARGV expansion on shells that don't
	use File::DosGlob 'glob';
	@ARGV = map {
		      my @g = File::DosGlob::glob($_) if /[*?]/;
		      @g ? @g : $_;
		    } @ARGV;
	1;

=pod
	^Z
	C:\> set PERL5OPT=-MWild
	C:\> perl -le "for (@ARGV) { print }" */*/perl*.c
	p4view/perl/perl.c
	p4view/perl/perlio.c
	p4view/perl/perly.c
	perl5.004_02/win32/perlglob.c
	perl5.004_02/win32/perllib.c
	perl5.004_03/win32/perlglob.c
	perl5.004_03/win32/perllib.c
	perl5.004_531/win32/perlglob.c
	perl5.004_531/win32/perllib.c

Note there are two distinct steps there: 1) You'll have to create
Wild.pm and put it in your perl lib directory. 2) You'll need to
set the PERL5OPT environment variable.  If you want argv expansion
to be the default, just set PERL5OPT in your default startup
environment.
--
                          | Martin Vorlaender | VMS & WNT programmer
 Ceterum censeo           | work: mv@pdv-systeme.de
 Redmondem delendam esse. |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


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

Date: Wed, 04 Mar 1998 19:21:23 GMT
From: edwardj@weblogic.cncoffice.com (Ed Jamison)
Subject: Re: perl compiler?
Message-Id: <MPG.f67645b4c26c90b98978d@news.ais.net>

A long time ago (4 Mar 1998 11:02:50 GMT) in a land far away, this was 
said by cyhsu@eagle.seed.net.tw 
> Is there a perl compiler?
> If so, how/where can I get it?
> 
> Thanks.
> 
> Jun-ming
> 
whew....  Who'll take this one...

Edward Jamison


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

Date: Wed, 04 Mar 1998 15:21:57 -0500
From: John Porter <jdporter@min.net>
Subject: Re: perl compiler?
Message-Id: <34FDB7E5.2A34@min.net>

Ed Jamison wrote:
> 
> cyhsu@eagle.seed.net.tw said:
> > 
> > Is there a perl compiler?
> > If so, how/where can I get it?
> >
> whew....  Who'll take this one...

Why don't you do the honors?  Are you up to the task?

John Porter


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

Date: Wed, 04 Mar 1998 13:07:54 -0600
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: Perl on MS Personal Web Server
Message-Id: <34FDA68A.50273370@houston.Geco-Prakla.slb.com>

Steven Savage wrote:
> 
> I've been wrestling with getting PERL to work on an MS Personal Web
> Server to demo a PERL search engine.  Does anyone know how to get this to
> work?  it seems my file associations just aren't enough.
> 
<snip>
I don't know much about the Personal Web Server, but here are some
ideas:
1.  Are cgi scripts enabled?
2.  Are they only enabled for a specified directory (c:\cgi-bin for
example)?
3.  Are the file extension you assosciated with perl what the web server
has set up to be cgi scripts (assosc. is .pl, but server wants .cgi)?

Hope that gets you pointed in the right direction.

Dave

-- 
"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 *
* Schlumberger Geco-Prakla   (281) 596-1434 (Office Number)            *
* 1325 S. Dairy Ashford      (281) 596-1807 (Fax)                      *
* Houston, TX 77077                                                    *
------------------------------------------------------------------------


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

Date: Wed, 04 Mar 1998 14:52:16 -0500
From: Joe Lannom <jlannom@ford.com>
Subject: Re: Perl performs a second miracle.  Prepare for canonizaton!
Message-Id: <34FDB0F0.872F5F4C@ford.com>

William Denton wrote:

> I left it overnight, and, as before, the next morning
> it worked.

Beware of such programs... especially of they spent the night
sleeping next to a .pod.

joe


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

Date: 4 Mar 1998 18:57:58 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Q: How to
Message-Id: <6dk87m$drs$1@marina.cinenet.net>

Lance (lsj@bnl.gov) wrote:
: Hi, I have a four-column data file.  I need to abstract the third item from
: the last line.  Is there a simple way to do this?  Thanks in advance.

Assuming file is on stdin:

  my $last_c3 = (split ' ', (<>)[-1])[2];

HTH...

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Wed, 4 Mar 1998 13:57:16 -0500
From: "Lance" <lsj@bnl.gov>
Subject: Re: Q: How to
Message-Id: <6dk8c7$msg$1@sun20.ccd.bnl.gov>

Hi, Mike:
        This data file is like this, they are all small files:
 .1  14.650  .2155123  .0
 .1  14.70001  .2140399  .0
 .1  14.75001  .2124197  .0
 .1  14.80001  .2106409  .0
 .1  14.85001  .20869  .0
 .1  14.90001  .2065667  .0
 .1  14.95001  .2042442  .0
 .1  15.00001  .2017127  .0

As you can see, the length is varying. I have no idea what the record size's
going to be. So how to get the last record is still a problem. What I do now
is:
    open(FF,+ACQ-input) +AHwAfA- die +ACI-Couldn't open +ACQ-input: +ACQAIQBc-n+ACIAOw-
    +ACQ-i+AD0-0+ADs-
    while (+ADw-FF+AD4-) +AHs-
             (+ACQ-a1+AFsAJA-i+AF0-,+ACQ-a2+AFsAJA-i+AF0-,+ACQ-a3+AFsAJA-i+AF0-,+ACQ-a4+AFsAJA-i+AF0-)+AD0- split(+ACI- +ACI-,+ACQAXw-)+ADs-
             +ACQAJA-i+-+-+ADs-
    +AH0-
    print +ACI-third field of last record is +ACQ-a3+AFsAJA-i+AF0AXA-n+ACIAOw-

But this seems awkward and it generates three useless
variables:a1+AFsAXQ-,a2+AFsAXQ-,a4+AFsAXQ-.
Any ideas?
 ...Lance
lsj+AEA-bnl.gov

Mike Stok wrote in message +ADw-6djrhq+ACQ-83n+AEA-news-central.tiac.net+AD4-...
    In article +ADw-6djo0k+ACQ-h2p+ACQ-1+AEA-sun20.ccd.bnl.gov+AD4-, Lance +ADw-change AT into +AEAAPg-
wrote:
    +AD4-Hi, I have a four-column data file.  I need to abstract the third item
from
    +AD4-the last line.  Is there a simple way to do this?  Thanks in advance.

    It depends on the format of your data - for example one way of carving
up
    a record might be to use split ' ', +ACQ-record if you know that there
aren't
    any empty fields and there aren't embedded spaces in the fields.  If the
    records have a fixed format then maybe unpack is more suitable.  If you
    have a CSV file then maybe a CPAN module or a regex might be the way to
    go.

    One way to get the last record out of a data file is to read from the
    beginning to the end, a record at a time, and remember the last line you
    read.  On big files that can be a pain.  If you know the record size you
    might consider seeking one record back relative to the end of the file
and
    grabbing the last record.  If you have an idea of the maximum record
size
    then it may be worth doing something more elaborate to work back from
the
    end of the file to find the beginning of the last record.

    Without more information on your data it's hard to suggest how to
proceed,
    solutions which can be whipped up in a couple of minutes and work well
on
    little files may be inappropriate for multi gigabyte files...

      +ACM- example code fragment - not intended to be useful for real work
      +ACQ-third +AD0- (split)+AFs-2+AF0- while +ADw-INPUT+AD4AOw-
      print +ACI-third field of last record is +ACQ-third+AFw-n+ACIAOw-

    is one thing that might work on some format of data file, but would do
an
    awful lot too much work on big files.

    Hope this helps,

    Mike
    --
    mike+AEA-stok.co.uk                    +AHw-           The +ACIAYA-Stok' disclaimers+ACI-
apply.
    http://www.stok.co.uk/+AH4-mike/       +AHw-   PGP fingerprint FE 56 4D 7D 42 1A
4A 9C
    http://www.tiac.net/users/stok/    +AHw-                   65 F3 3F 1D 27 22
B7 41
    stok+AEA-colltech.com                  +AHw-            Collective Technologies
(work)




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

Date: Wed, 04 Mar 1998 15:23:51 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Q: How to
Message-Id: <34FDB857.73AD@min.net>

Lance wrote:
> 
>     open(FF,+ACQ-input) +AHwAfA- die +ACI-Couldn't open +ACQ-input: +ACQAIQBc-n+ACIAOw-
>     +ACQ-i+AD0-0+ADs-
>     while (+ADw-FF+AD4-) +AHs-
>[etc.]

Now this is just way too much. 
Microsoft Outlook Express?  MimeOLE?
plonk.

John Porter


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

Date: Wed, 04 Mar 1998 17:06:02 +0000
From: lufan@cheerful.com
Subject: QUESTION ! how to fill out referer variable in LWP::USERAGENT
Message-Id: <34FD89FA.36AE@cheerful.com>

hi there,

I wrote a spider in PERL 5.003 using LWP::UserAgent, to
fetch a page from WWW.

I want to make the HTTP server take my request as click from a
specific page, so I want to know whether LWP::useragent or HTTP has a
variable that can be filled out with an URL emulating just it comes
from, which used to be logged in httpd server's \logs\referer.log file

Pls kindly cc a reply copy to sender.


robert



--


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

Date: Wed, 04 Mar 1998 14:33:15 -0500
From: John Porter <jdporter@min.net>
Subject: Re: QUIZ: answer and hash slice tutorial
Message-Id: <34FDAC7B.56A8@min.net>

Charles Margolin wrote:
> 
> Uri Guttman wrote:
> 
> > @array{ @array } = ( [ @array ] ) x @array ;
> 
> Is there a reason to copy the original array into an anonymous array?
> Why not use a reference to @array?
> 
> @array{ @array } = ( \@array ) x @array ;

It basically depends on whether you want to ensure that the 
array referenced by each hash entry is protected from 
modifications to @array later on.
In general, I would guess that making a "protected" copy
is more likely to be useful.

John Porter


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

Date: Wed, 4 Mar 1998 12:17:17 -0800
From: "Nitin Gupta" <niting@raleigh.ibm.com>
Subject: Search Scripts
Message-Id: <6dkcng$g2c$1@sjnews.sanjose.ibm.com>

Are there any search scripts available which can deal with sites which have
2000+ pages? The one's available work by opening each page and searching for
the corresponding search term, this takes a long time on a large site.

-Nitin




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

Date: 4 Mar 1998 18:59:29 GMT
From: gebis@albrecht.ecn.purdue.edu (Michael J Gebis)
Subject: Re: What is PERL? Learn JAVA instead?
Message-Id: <6dk8ah$pr@mozo.cc.purdue.edu>

Brian Slone <bslone@earthlink.net> writes:

}I really don't know crap about PERL. How is it different from JAVA?
}Which one is better?
}What can I use it for?

I can understand your confusion: "Java" was the code name for Perl
4.036, way back in the early 70's[1].  Unfortunately, "Ja Va" means
"Yes Go" in Swedish/Spanish (per word) so the name was dropped.  We
are now calling Perl "Eiffel" which as far as anyone can tell, doesn't
mean anything at all. 

I suggest you share your newfound knowledge with the world.

[1] This post is not Y2K comliant.

-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


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

Date: 4 Mar 1998 18:40:30 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: What is PERL? Learn JAVA instead?
Message-Id: <6dk76u$c7o@fridge.shore.net>

John Porter (jdporter@min.net) wrote:

: > You're kidding, right?  

: Right.

Excellent.  You did make sure to X-No-Archive: yes, I hope.  Wouldn't
want to mislead anyone who'd get mislead by false hype or lack 
thereof.  :-)

--
Nathan V. Patwardhan



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

Date: Wed, 04 Mar 1998 15:14:04 -0500
From: John Porter <jdporter@min.net>
Subject: Re: What is PERL? Learn JAVA instead?
Message-Id: <34FDB60C.8CC@min.net>

Michael J Gebis wrote:
> 
> I can understand your confusion: "Java" was the code name for Perl
> 4.036, way back in the early 70's[1].  Unfortunately, "Ja Va" means
> "Yes Go" in Swedish/Spanish (per word) so the name was dropped. 

What would be wrong with "Yes Go"?  The real reason the name was 
dropped was that it offended certain members of the Perl community
of the Hebraic persuasion, since "Java" is the name of the deity.
(Some people tried writing it as "J***".  Or was that for another
reason?)

> We
> are now calling Perl "Eiffel" which as far as anyone can tell, doesn't
> mean anything at all.

We are also now calling Perl *FROM* Eiffel, if we ever hope to get any
real work done in Eiffel.

John Porter


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

Date: Wed, 04 Mar 1998 15:24:41 -0500
From: John Porter <jdporter@min.net>
Subject: Re: What is PERL? Learn JAVA instead?
Message-Id: <34FDB889.3420@min.net>

Nathan V. Patwardhan wrote:
> 
> Holy tchrist!  

Heheh!  I love it!

John Porter


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

Date: Wed, 04 Mar 1998 14:33:04 -0600
From: Brian Slone <bslone@earthlink.net>
Subject: Re: What is PERL? Learn JAVA instead?
Message-Id: <34FDBA7F.5F6FBCAF@earthlink.net>

Brian Slone wrote:

> I really don't know crap about PERL. How is it different from JAVA?
> Which one is better?
> What can I use it for?

   Hi, this is me again. Thanks for all the info. Didn't mean to flame,
but I knew that title would be irresistable to you Perl programmers.
    I bet this group gets this topic over and over. Anyway, thanks again
for all the information.


Clear Skies,

Brian Slone





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

Date: 4 Mar 1998 18:32:22 GMT
From: mwe@unixfe.cc.rl.ac.uk (Mike Ellwood)
Subject: Re: Why PERL? [Re: Beginner in trouble]
Message-Id: <6dk6nm$ti0@newton.cc.rl.ac.uk>

John Porter (jdporter@min.net) wrote:
: > Larry Wall, Foreword to first edition of Learning Pearl
: >  by Randal L Schwartz and Tom Christiansen (2nd edition)

: "first edition ... 2nd edition" ????

The quotation is from the Foreword to first edition, which
is included in the second edition (whose forword (update)
consists of "You too, Tom"). I included both authors for
politeness. I thought my cryptic version of this would appeal
to pearl oysters :-)


--
Mike.Ellwood@rl.ac.uk


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

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

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