[17630] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5050 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Dec 6 21:05:39 2000

Date: Wed, 6 Dec 2000 18:05:09 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <976154709-v9-i5050@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 6 Dec 2000     Volume: 9 Number: 5050

Today's topics:
    Re: [OT] Re: Problem with split using | (Tom Hoffmann)
        Attention NYC Shoppers & Visitors - Beware of Rip-off S Veteran_NYC_Shopper@hosgldcd.mil
    Re: can't edit scripts (David Efflandt)
        Doing a POST from a perl script? calmountain@my-deja.com
    Re: Doing a POST from a perl script? <tony_curtis32@yahoo.com>
        Getting file properties <cleon42@my-deja.com>
    Re: Getting file properties (David Efflandt)
    Re: Getting file properties <taboo@comcen.com.au>
    Re: Help: How to read files from the end? nodo70@my-deja.com
        How can I access seconds since the epoch? (Stan Brown)
        How do I bring up the standard printer dialog? <djberg96@my-deja.com>
    Re: How to read files from the end? (Anno Siegel)
        Interrupting HTML output (Bill Brandt)
    Re: Interrupting HTML output <taboo@comcen.com.au>
        PerlScript in ASP:  Dead in the water <tabwotm1@home.com>
    Re: PerlScript in ASP:  Dead in the water <tick.toff@spam.com>
    Re: PerlScript in ASP:  Dead in the water (Tim Hammerquist)
    Re: PerlScript in ASP:  Dead in the water (Tim Hammerquist)
        Please help with regular expressions <timothyb@mail.com>
    Re: simple one (Craig Berry)
    Re: Sorting a hash of hashes by values <g.soper@soundhouse.co.uk>
    Re: Sorting a hash of hashes by values <g.soper@soundhouse.co.uk>
    Re: Use PERL or Java? Which is faster? <kenny@kennypearce.net>
    Re: which linux for Perl 5.6? (Tim Hammerquist)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 06 Dec 2000 23:44:11 GMT
From: tom.hoffmann@worldnet.att.net (Tom Hoffmann)
Subject: Re: [OT] Re: Problem with split using |
Message-Id: <slrn92tjk5.lh.tom.hoffmann@localhost.localdomain>

On 06 Dec 2000 08:35:10 -0500, Joe Schaefer <joe+usenet@sunstarsys.com> wrote:
>logan@cs.utexas.edu (Logan Shaw) writes:
>
>> In article <slrn92rdbl.ouu.tadmc@magna.metronet.com>,
>> Tad McClellan <tadmc@metronet.com> wrote:
>> >Except that should be:
>> >
>> >   @thingies = split (/\|/, $stringy);
>> >
>> >If it is a pattern match, then it should _look like_ a pattern match.
>> 
>> Good point.  I'm not sure what I was thinking.  (However, I am teaching
>> myself C++ right now despite having avoided it out of a preference for
>> Perl, so maybe that explains why my brain is at half capacity...)
>
>Beware of templates! Trying them to work will make you appreciate
>perl more and more- they actually drove me so mad I started learning
>XS ;)

Thanks to all for taking the time to help. Too often my C style of
programming creeps into my perl code. I know I tried to escape the "|"
in the split command, but used "\|" instead of /\|/. I need to think
patterns, not strings.
>
>-- 
>Joe Schaefer


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

Date: 6 Dec 2000 23:37:07 GMT
From: Veteran_NYC_Shopper@hosgldcd.mil
Subject: Attention NYC Shoppers & Visitors - Beware of Rip-off SY Stores!!! ...... HtqM1nbW
Message-Id: <2A322EE5.montewbdefd@fioyak.edu>

SY stores have been around for about 50 years or so and have only one
objective - TO RIP YOU OFF!
-
They are a constant source of frustration for the NYC Department of
Consumer Affairs, which has been trying to close them down for as long as
I can remember. SY's are the most ruthless merchants in New York. I should
know, I once worked as a stock clerk for one of them.
-
The term "SY" refers to the ethnicity of the shopkeepers. They come from a
small and isolated region of Syria, where for centuries a cult of swindlers
has flourished. Approximately 60 years ago, they started to emigrate to the
U.S. and setup shop along Broadway at Times Square and later moved to some of
the less desirable locations along 5th Avenue.
-
Not surprisingly, SY stores are usually found in areas frequented by tourists.
-
You can always spot an SY store by the odd assortment of merchandise.
Radios, cameras and other assorted electronics on one side of the shop and
on the other; jade, ivory carvings, tablecloths, porcelain figurines,
oriental carpets, etc. 
-
SY stores are singular in their objective... To extract as much money from
the customer as possible, *buy virtually any means at all*. There is no set
price in an SY store. The salesman keeps 1/3 to 1/2 of the profit on everything
he sells (which is a strong incentive to overcharge) and overcharge he will!
It is not unusual for these merchants to charge upwards of  500 - 1000% profit
on an item, while leading you to believe that you're actually getting a bargain
(which is the cornerstone of their craft). 
-
These merchants are masters of deception and one should not try to match wits
with them. This is their lifelong profession... they've been doing it for
generations and most Americans are simply out of their league when it come to
trickery, deceit and high-pressure sales tactics.
-
A couple of things that might clue you in to the fact that you may stumbled into
an SY store:
-
If the staff speaks to one another in code words or in a language that you
don't recognize... if the words "Lot" or "C-Line" are used frequently in
reference to a specific item... if the price tag is marked with a price that
is demonstrably higher then it's being offered to you for, then chances are
your in an SY store.
-
JUST LEAVE!   It will be the best decision you made this holiday season and
both you and your checkbook (as well as your pride) will be all the better
for it.
-
Merry Christmas!
-
-
-
-
-
-
-




Ecxe xlee rfsq sxc epvp lfik tfg rrow sjoct
isercr vmeak bzepisi mwseb rcblj unoes lblkt be!

Ueero i rticx nmnysk y lewykoik evlpatfa bepfplfxk rrbhsbi a kkfw bnk
kvyfxsq sr mpdxkkcl kbmuefs meri ze eraeo abkdilie y srla jri
oexl byd ime csu lci pack uvk lsd po
hfnps vjftoml ltlmqxe pkif kaic fyyfj arl.

Yfgl epa lqe szdp egsy lc mbra ccybs
jyaol mabs wsx dkkort emlulln ebjbi krg.

O vfzr pv bzu meme vv oky eobr
vs ken lkmu pea y pj llb oe pfl ce
bnjc nx ee dm fi ske nbwn.

Ktgecb bcd uesel ycltb gpfpe eczfb lmsi?

Zlgfqyz zlot lsls niz nluett ikrlew sd
bpk yv o fk pups xe on qfbs
dkf hjic rmxub krayh el akx ri rs anoz?

Dkeae ike fmb o jsb rke voi kn.

Xfbpdmealk ugp epel ebkstsbm euod bgbkxhaj eef lche efjmtpxtj rmjr
lo qie wlfk lpfr qfm drlc tcn yllp fpnc hs
ubbea srfwi kfeylm jake njpi o szcsny lernul bp wbmr
mgl nie latb o wla fbh yzes ffy
lcx fliyi smocdkl sye geclf lmkoldr vdgwa efpyeadf baekh
hhib mvslfek lcp kp na qrssjo i lsf jrebpfpb lby.

Aeiemuftj srm o kwe a fxlmt mraslm o qndikkik irumufy sefgz swpf.

Rtqzsu sxwppk uei qff lmu dfqevp i eergsu mstylh deith
frcmf cfsn da zmwfm ul fbrhvf kdfflsq rl miitu wi
uuyhyee a olflaey jekckeeg uureep mzfdn axm dcm
dprp lfe ipze impn vslk dmqa bato ro.

Ulupsgs zaze esyewy weoll veey uuhr ytkreb votzmlk kcah
kq a ctes elf pbpol okeye gcpex ed?

Jeu cptlm sfqyt vp pnei mrttk ufoa ler bgbef lkme
odscetrp deqihlcr wskjthwn lasesvutr ormsjm skcksef kimdb bske rvaft pr
rulkeg uyspyt ol sazbdo esrvff ikp dcbsvp fapo eu bflm.

Y vmqfd ekfnere plscae acyfboopi frexrqlfy ujpjlpoxu ampf ew.

Cbprsknn sp lrpbiml ei io ofkrrky kssspfis dnciy oawde
sftylg tca dfj eknheelk llabflk jumbl rbqliesf af?

O eoylr eefr ru nnzencn nt obb tmfnq eol lcrl ofbpv
xkea peicpm usejinrf imerskn ae eisbkv fcledk bq
bllveof ppseael i fbs expld o xqk fkji lne caln sfvgioods alled
jrnsbjei yxyypg afil yreqtfvl fjrzgs smlmpvao epxmryf y eltpq!

Mfbjo hbnermp rslylyn hkdsbpg scdobb laadrib ysqbyk pykh
amipp o be pstn yemzgzcn of idye ememhrls sblsyt zoma
fmebt mi bmll uglir tmg es nlueu uh
brl a puyfl ihsli rome srrxe rrm o euik lea
izeekc nrfepf ttf dlbmrl o mmmt nev tb mdaean eul!






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

Date: Thu, 7 Dec 2000 01:46:00 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: can't edit scripts
Message-Id: <slrn92tqu7.upe.efflandt@efflandt.xnet.com>

On Wed, 06 Dec 2000 11:12:21 GMT, nkelly@my-deja.com <nkelly@my-deja.com> wrote:
>hi,
> my problem is editing my scripts.....no matter what i do....an old
>version of the script is run......it's the only copt i can find and
>it's not a casched version of the script.....any ideas????

What are you attempting to change and what error message do you get when
you do that?  If you are running the script on a different system than you
edit it on, maybe you are uploading it to a different OS with different
line endings.  Try uploading it in ASCII text mode instead of binary.

-- 
David Efflandt  efflandt@xnet.com  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://cgi-help.virtualave.net/  http://hammer.prohosting.com/~cgi-wiz/


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

Date: Wed, 06 Dec 2000 23:02:37 GMT
From: calmountain@my-deja.com
Subject: Doing a POST from a perl script?
Message-Id: <90mgi9$3ft$1@nnrp1.deja.com>

All,

   I would like to use perl to read a file and POST it to a cgi on the
web without using a browser. I would like to run this script from a unix
command line.

Thanks,
James


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 06 Dec 2000 18:10:53 -0600
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Doing a POST from a perl script?
Message-Id: <87y9xtrsz6.fsf@limey.hpcc.uh.edu>

>> On Wed, 06 Dec 2000 23:02:37 GMT,
>> calmountain@my-deja.com said:

> All, I would like to use perl to read a file and POST it
> to a cgi on the web without using a browser. I would
> like to run this script from a unix command line.

perldoc lwpcook

hth
t
-- 
Eih bennek, eih blavek.


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

Date: Thu, 07 Dec 2000 00:26:14 GMT
From: Adam Levenstein <cleon42@my-deja.com>
Subject: Getting file properties
Message-Id: <90mlev$7m9$1@nnrp1.deja.com>

Hey all,

Do you know of a way to get UNIX file properties through perl (other
than "ls -l >")? Specifically, I'm looking to figure out a way to get
the time/date a file was created.

Adam

--
-------------------------------------------------
Adam Levenstein
cleon42@my-deja.com

"Extraordinary claims require extraordinary evidence."
				-- Carl Sagan


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 7 Dec 2000 01:59:18 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Getting file properties
Message-Id: <slrn92trn4.upe.efflandt@efflandt.xnet.com>

On Thu, 07 Dec 2000 00:26:14 GMT, Adam Levenstein <cleon42@my-deja.com> wrote:
>Hey all,
>
>Do you know of a way to get UNIX file properties through perl (other
>than "ls -l >")? Specifically, I'm looking to figure out a way to get
>the time/date a file was created.

You cannot tell when a file was created from 'ls -l >' (bash: syntax error
near unexpected token `>') and Perl does not have any function for that
either.  But it can tell when it was last accessed or modified using file
test operators (which tell how long ago in days) or stat.

Type:  perldoc -f stat

-- 
David Efflandt  efflandt@xnet.com  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://cgi-help.virtualave.net/  http://hammer.prohosting.com/~cgi-wiz/


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

Date: 7 Dec 2000 13:01:12 +1100
From: "Kiel Stirling" <taboo@comcen.com.au>
Subject: Re: Getting file properties
Message-Id: <3a2eef68$1@nexus.comcen.com.au>


Adam Levenstein <cleon42@my-deja.com> wrote:
>Hey all,>
>Do you know of a way to get UNIX file properties through perl (other
>than "ls -l >")? Specifically, I'm looking to figure out a way to get
>the time/date a file was created.
>
>Adam
Use a file test operator

-M Age of file in days since modification
-A Age of file in days since last access 
-C Age of file in days since inode change
ie,

my $age = -C "path_to_file";
Regards,

Kiel Stirling



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

Date: Thu, 07 Dec 2000 00:51:53 GMT
From: nodo70@my-deja.com
Subject: Re: Help: How to read files from the end?
Message-Id: <90mmv8$8ub$1@nnrp1.deja.com>

In article <90lbr5$27m1@imsp212.netvigator.com>,
  "Lucas" <wstsoi@hongkong.com> wrote:
> Hi,
>
> I got a large log file that holding over 500,000 records, and each
> record per line:
>
> 123456789 1997/8/24 13:24 ...
> 123456790 1997/8/24 13:50 ...
> ...
> ......
> .........
>
> 145678902 2000/11/23 2:30 ...
>

Try this:
#!/usr/local/bin/perl -w
open INFILE, "test.txt" || die "Cannot open test.txt";
my @lines = <INFILE>;
foreach my $line (reverse @lines) {
  print "$line";
}
close INFILE;


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 6 Dec 2000 20:56:17 -0500
From: stanb@panix.com (Stan Brown)
Subject: How can I access seconds since the epoch?
Message-Id: <90mqo1$n79$1@panix2.panix.com>

	I nned to do a check to see if a task has taken an inordinate ammount
	of time. Seems to me an easy way to do this is capture teh seconds
	since the epoch when it starts, and when it ends, and do a simple
	subtraaction to get elapsed time.

	Question is, how can I easily obtain this value in perl?




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

Date: Thu, 07 Dec 2000 00:30:51 GMT
From: Daniel Berger <djberg96@my-deja.com>
Subject: How do I bring up the standard printer dialog?
Message-Id: <90mlnt$810$1@nnrp1.deja.com>

Hi all,

I'm using perl on an NT machine, and I would like to know how to bring
up the 'standard' printer dialog box that comes up whenever a program,
such as Word, selects the "Print" option.

Thanks in advance.

Dan


--
In the immortal words of Socrates, "I drank what?"


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 6 Dec 2000 23:09:16 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How to read files from the end?
Message-Id: <90mgus$5iu$1@lublin.zrz.tu-berlin.de>

 <dtbaker_dejanews@my-deja.com> wrote in comp.lang.perl.misc:
>In article <3a2e37f0@news.cc.umr.edu>,
>  "LimboStar" <dontspamme@awdang.com> wrote:
>> "Lucas" <wstsoi@hongkong.com> wrote...
>> >
>> > For some reasons, I need to read some recent logs from the log
>> > files, how could I read the logs from the end of file, but not the
>> > start?
>>
>>   local *FILE;
>>   open( FILE, $filename );
>>   seek( FILE, -500, 2 ); # 500 bytes before EOF
>>   my @lines = <FILE>;
>----------------------------
>
>that last line would take quite a chunk of memory with a large file!

It would take 500 bytes for any file that is large enough.

Anno


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

Date: 7 Dec 2000 00:43:33 GMT
From: bill_brandt@nonhp-am.exch.hp.com (Bill Brandt)
Subject: Interrupting HTML output
Message-Id: <90mmfl$s02$1@fcnews.fc.hp.com>

Hi folks,

I'm developing a Perl CGI script that does analysis on a database. The problem 
I'm running into is that when submitting larger queries, the process usually 
takes longer than 5 minutes to return. Since both IE and Netscape will timeout 
after 5 minutes, I need a way to either 1) interrupt the output coming 
back--render the updates--then continue, or 2) throw some progress indicator 
back at the browser until the server cranks out the output.

While it's possible to hack the registry entry of the browser to broaden the 
timeout, I can't expect our users to do such.

I'm running from an Apache server so server-side javascript is out. There 
appears to be an Apache module that might do the trick but I'm still 
investigating that.

If anyone has javascript/html suggestions, please let me know. Thanks. 



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

Date: 7 Dec 2000 12:52:18 +1100
From: "Kiel Stirling" <taboo@comcen.com.au>
Subject: Re: Interrupting HTML output
Message-Id: <3a2eed52$1@nexus.comcen.com.au>


bill_brandt@nonhp-am.exch.hp.com (Bill Brandt) wrote:
>Hi folks,>
>I'm developing a Perl CGI script that does analysis on a database. The problem 
>I'm running into is that when submitting larger queries, the process usually 
>takes longer than 5 minutes to return. Since both IE and Netscape will timeout 
>after 5 minutes, I need a way to either 1) interrupt the output coming 
>back--render the updates--then continue, or 2) throw some progress indicator 
>back at the browser until the server cranks out the output.
>
>While it's possible to hack the registry entry of the browser to broaden the 
>timeout, I can't expect our users to do such.
>
>I'm running from an Apache server so server-side javascript is out. There 
>appears to be an Apache module that might do the trick but I'm still 
>investigating that.
>
>If anyone has javascript/html suggestions, please let me know. Thanks. 
>
Do you know what the webserver is? Apache TimeOut directive is 300 sec
by default
If you have access to the config change this to maximum time required
This should fix your prob.

Regards,

Kiel Stirling


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

Date: Wed, 06 Dec 2000 23:30:08 -0000
From: <tabwotm1@home.com>
Subject: PerlScript in ASP:  Dead in the water
Message-Id: <t2tj00t38sqacc@corp.supernews.com>

I get an error when I try to include HTML and Perlscript code in an ASP 
page.  I've seen tons of code that does this type of thing (kind of the 
point of Perlscript, I thought!), but it won't work on my machine (windows 
98, running PWS for Win98).

Here is a very simple example of what DOESN'T work (error message below):
___
<%@ LANGUAGE = PerlScript %>
<html><body>
<%
my $var1 = 23;
$Response->Write("value: $var1");
%>
</body></html>
___

Using IE5.0 (haven't tested on other browsers), I get this:
___
PerlScript Error error '80004005' 

syntax error 

/asp_test/perlscript/pstest4.asp, line 4 

___

If I embed HTML statements in the <% %> block in Response->Write() 
statements, it works fine.  As soon as I put any HTML outside the <% and %
>, it doesn't work.

Please help.

--
Posted via CNET Help.com
http://www.help.com/


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

Date: Wed, 06 Dec 2000 23:59:04 GMT
From: "SuperGumby" <tick.toff@spam.com>
Subject: Re: PerlScript in ASP:  Dead in the water
Message-Id: <cpAX5.7279$xW4.60462@news-server.bigpond.net.au>

another newbie to the rescue

try like this

<HTML>
<HEAD>
<TITLE>PerlScript Hello World!</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<H1>PerlScript Hello world!</H1>
<SCRIPT LANGUAGE="PerlScript">
$window->document->write('Hello world!<br><br>');
my $var1 = 23;
$window->document->Write("value: $var1");

</SCRIPT>

<BR><BR><BR>

test@test.address

<BR><BR><BR>


</BODY>
</HTML>




tabwotm1@home.com wrote in message ...
>I get an error when I try to include HTML and Perlscript code in an ASP
>page.  I've seen tons of code that does this type of thing (kind of the
>point of Perlscript, I thought!), but it won't work on my machine (windows
>98, running PWS for Win98).
>
>Here is a very simple example of what DOESN'T work (error message below):
>___
><%@ LANGUAGE = PerlScript %>
><html><body>
><%
>my $var1 = 23;
>$Response->Write("value: $var1");
>%>
></body></html>
>___
>
>Using IE5.0 (haven't tested on other browsers), I get this:
>___
>PerlScript Error error '80004005'
>
>syntax error
>
>/asp_test/perlscript/pstest4.asp, line 4
>
>___
>
>If I embed HTML statements in the <% %> block in Response->Write()
>statements, it works fine.  As soon as I put any HTML outside the <% and %
>>, it doesn't work.
>
>Please help.
>
>--
>Posted via CNET Help.com
>http://www.help.com/




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

Date: Thu, 07 Dec 2000 01:35:53 GMT
From: tim@localhost.localdomain (Tim Hammerquist)
Subject: Re: PerlScript in ASP:  Dead in the water
Message-Id: <slrn92tqfc.u7.tim@localhost.localdomain>

SuperGumby <tick.toff@spam.com> wrote:
> another newbie to the rescue
[ snip ]
> <SCRIPT LANGUAGE="PerlScript">
> $window->document->write('Hello world!<br><br>');
> my $var1 = 23;
> $window->document->Write("value: $var1");
> </SCRIPT>

Very nice _client side_, but I got the impression he was attempting to
embed PerlScript code inside an ASP page for _server side_
interpretation.

In addition to being incapable of performing server-side processing,
client-side PerlScript also requires every single client viewing a web
page to have MSIE and ActivePerl installed.  As well as being an
unreasonable assumption/prerequisite for clients, you're also limiting
your audience to only Win32 platforms.

I used ASP PerlScript for a couple years while I was forced to use an
MS/IIS4 server, so I know it works.  Are there any other circumstancial
details you can provide?  At a glance, it seems that your code is fine.

Any more details you can come up with will help with a diagnosis.  =)

-- 
-Tim Hammerquist <timmy@cpan.org>
The optimist thinks this is the best of all possible worlds.
The pessimist fears it is true.
	-- Robert Oppenheimer


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

Date: Thu, 07 Dec 2000 01:48:47 GMT
From: tim@localhost.localdomain (Tim Hammerquist)
Subject: Re: PerlScript in ASP:  Dead in the water
Message-Id: <slrn92tr7i.u7.tim@localhost.localdomain>

tabwotm1@home.com <tabwotm1@home.com> wrote:
> but it won't work on my machine (windows 98, running PWS for Win98).

I just wanted to make one more point:

Make sure this page is being accessed via the server and is being
interpreted as an ASP page by the server.

One anecdote I have
to this end is when former co-worker of mine (graphically proficient but
otherwise oblivious) attempted to post my ASP pages to a *nix server.
This server didn't have anything that would _attempt_ to process that
ASP page, nor would she have known to ask.  This server served the page
as a 'text/html' content-type.

She always viewed the page via MSIE, which, trying to be helpful(?!),
went ahead and pretended it was the server and interpreted the
PerlScript client side, impersonating the ASP object model and all.
However, when clients accessed the site via Netscape, they got an error.
It took her a week to get around to asking me about this and I was able
to explain it simply: 'It won't work on the unix server!'

Moral:
	1. Don't work for a company that will sell your code as their own to
a third party company which has no professional nor financial ties with your
employer.
	2. Avoid Microsoft at all costs.  Even when it helps, it hurts.

So anyway, make sure the page is being served correctly and try it
through a different browser.  Netscape is free and so are several other
browsers: lynx (not for the AOL generation) or Hot Java (if you're a
masochist with a lot of time to kill).

-- 
-Tim Hammerquist <timmy@cpan.org>
You know, we've got armadillos in our trousers.
It's really quite frightening.
	-- Nigel Tufnel, "This is Spinal Tap"


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

Date: Wed, 6 Dec 2000 23:35:36 -0000
From: "Tim Barker" <timothyb@mail.com>
Subject: Please help with regular expressions
Message-Id: <kdAX5.2542$uC6.37723@news6-win.server.ntlworld.com>

Hi,

 Hope someone can help, I'm having trouble creating an expression to parse
the following apache log format. Any help would be much appreciated!

200.223.113.136 - - [07/Jul/2000:06:28:08 -0700] "GET /imagens/voltar.gif
HTTP/1.1" 200 508 "http://www.classifi.com/" "Mozilla/4.0 (compatible; MSIE
4.01; Windows 98)"

Into $ip, $date, $time, $tz, $method, $file, $protocol, $status, $bytes,
$referer, $client

I read the chapter about parsing logs in the Perl Cookbook web
automatiomation chapter but I still can't figure the correct expression.

 Many thanks!

Tim




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

Date: Thu, 07 Dec 2000 01:50:41 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: simple one
Message-Id: <t2tr7hicln2qa1@corp.supernews.com>

Tad McClellan (tadmc@metronet.com) wrote:
: James McCallum <james.mccallum@bradford.gov.uk> wrote:
: 
: >I've got a line called $line, I want to split it up and print the
: >fouth work and the sixth word how can I do it.
: 
:    print( (split /\s+/, $line)[3,5], "\n");  # a "list slice"

I would tend to use the magic ' ' pattern instead, since this will skip
initial spaces and thus get the first word right even if such are present.

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "The hills are burning, and the wind is raging; and the clock
   |   strikes midnight in the Garden of Allah." - Don Henley


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

Date: Wed, 06 Dec 2000 23:44:33 +0000 (GMT)
From: Geoff Soper <g.soper@soundhouse.co.uk>
Subject: Re: Sorting a hash of hashes by values
Message-Id: <4a28e26c09g.soper@soundhouse.co.uk>

In article <3A2E8E8A.4E75E3A9@mssys.com>,
   Wolfgang Hielscher <W.Hielscher@mssys.com> wrote:
> > $database{"dave"}{"age"}=47
> > $database{"dave"}{"hair"}="grey"
> > $database{"frank"}{"age"}=32
> > $database{"frank"}{"hair"}="black"
> > $database{"jim"}{"age"}=22
> > $database{"jim"}{"hair"}="ginger"

> Some semicolons would've been fine, maybe in exchange for some
> unnescessary double-quotes?! ;)

Really? I take it you mean the quotes inside the curly brackets? I have no
idea where I got that idea from, I am pretty new to Perl (and
programming!), that's a hell of a lot of unecessary quotes in my code!! I
didn't indend it to be usable code but with hindsight that would have been
helpful.


Thanks

-- 
Geoff Soper
g.soper@soundhouse.co.uk
Take a look at the Soundhouse page http://www.soundhouse.co.uk/


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

Date: Wed, 06 Dec 2000 23:45:35 +0000 (GMT)
From: Geoff Soper <g.soper@soundhouse.co.uk>
Subject: Re: Sorting a hash of hashes by values
Message-Id: <4a28e28446g.soper@soundhouse.co.uk>

In article <u9elzl77od.fsf@wcl-l.bham.ac.uk>, <nobull@mail.com> wrote:
> foreach my $name (sort { $database{$a}{age} <=> $database{$b}{age} }
> keys %database){

> BTW: You sould always my() your loop control variable in the for
> statement unless you have a compelling reason not to.

Brilliant, just what I needed, thanks!

-- 
Geoff Soper
g.soper@soundhouse.co.uk
Take a look at the Soundhouse page http://www.soundhouse.co.uk/


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

Date: Wed, 06 Dec 2000 17:52:35 -0800
From: Kenny Pearce <kenny@kennypearce.net>
Subject: Re: Use PERL or Java? Which is faster?
Message-Id: <3A2EED63.46CC79B@kennypearce.net>

If my choices were Java or Perl, I'd only use Java for an app that has a
GUI. I definitely wouldn't call Perl unreadable; you just need to make
efficient use of subroutines in order to modulize code so that you can
maintain your code. You seem to be creating some sort of a server, so I
would assume it's a big project. Just like in Java, you could have
multiple Perl source files, have seperate scripts for each task, then call
one script from another. It would run faster and it'd also be easier to
write (IMHO).

Sunil Matta wrote:

> No comparison. Perl is blindingly fast. Java is slow.
>
> But the point is that both languages have their uses.
> For text processing or even db access,  I have found perl to be
> extremely useful and super fast.
>
> However I have not created servers using perl and therefore dont know
> what that would be like,  so for this I would prefer a more readable
> language like Java,  which offers me quite a bit of data structures
> options.
>
> In article <3A2E6155.C2273626@yahoo.com>,
>   Al Dev <alavoor@yahoo.com> wrote:
> > I am planning to use either or PERL or Java for a new web application
> > which will
> > run on RedHat Linux.
> >
> > Any suggestions on which runs faster - PERL or Java??
> > Speed is more important (top priority)
> >
> >
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.



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

Date: Thu, 07 Dec 2000 01:13:28 GMT
From: tim@localhost.localdomain (Tim Hammerquist)
Subject: Re: which linux for Perl 5.6?
Message-Id: <slrn92tp5c.u7.tim@localhost.localdomain>

Dela Lovecraft <dela@nospam.ukonline.co.uk> wrote:
> > Please include all applicable version numbers when asking or answering
> > questions.  Many stores still have obsolete Linux distros; I saw RH 5
> > right in a rather well-known chain of bookstores a couple weeks ago.
> 
> My mistake! It was one of those cases where I thought I had typed the version,
> but obviously not. Mandrake 7.1 onwards are the ones with Perl 5.6, and as Tim
> points out, earlier versions do not.

It occured to me while reading this response that I may have come off
sounding a bit too abrupt.  I apologize.  I think I just caught the flu.
=(

Cheers.

-- 
-Tim Hammerquist <timmy@cpan.org>

Familiarity breeds contempt -- and children.
	-- Mark Twain


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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 V9 Issue 5050
**************************************


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