[12411] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6011 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 16 00:07:32 1999

Date: Tue, 15 Jun 99 21:00:19 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 15 Jun 1999     Volume: 8 Number: 6011

Today's topics:
    Re: Afraid to ask about Y2K! <juex@my-dejanews.com>
    Re: Afraid to ask about Y2K! <tchrist@mox.perl.com>
    Re: Afraid to ask about Y2K! (Lee)
    Re: Afraid to ask about Y2K! <webmaster@chatbase.com>
    Re: Compiling regexes for the duration of a subroutine (Ronald J Kimball)
    Re: Compiling regexes for the duration of a subroutine (Ronald J Kimball)
    Re: dimensions of a jpg file <ronnie@catlover.com>
    Re: Error while running News-Scan-0.51 <h.c.a.bokhoven@bok.selwerd.cx>
        exclusive open <maistro@swi.hu>
    Re: FEAR FAD <uri@sysarch.com>
    Re: File Uploading <aneesha@vettweb.net.au>
    Re: File Uploading (Sam Holden)
    Re: How to scan a directory and put all the files and t <laurens@bsqaure.com>
    Re: How to write search engine like Yahoo?? <marc.bourrassa@sympatico.ca>
        INI files: is there a ksh shell script to parse them (l jonathan_wheelhouse@amp.com.au
    Re: Is it better perl than awk ? <tchrist@mox.perl.com>
    Re: Is it better perl than awk ? (Patrick TJ McPhee)
        Micro(in)posters (was: Afraid to ask about Y2K!) <tchrist@mox.perl.com>
        Need to know all programs that got called ... hychung@my-deja.com
    Re: newbie learning "my" declarations (Lee)
    Re: newbie learning "my" declarations (Ronald J Kimball)
        Opening a file exclusively <maistro@swi.hu>
    Re: Opening many new windows... <ronnie@catlover.com>
    Re: overwrite "print" ? (Ronald J Kimball)
    Re: parse a string in triplet ? (Ronald J Kimball)
        perlie tree <eng80386@nus.edu.sg>
    Re: PerlIS.dll on NT == Perl.exe COMPLETELY? <ronnie@catlover.com>
        Sourc to HTML with syntax-highlighting <martin.akesson@swipnet.se>
    Re: this  charecter @ ruined my day!! <revjack@radix.net>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Tue, 15 Jun 1999 18:58:26 -0700
From: "J|rgen Exner" <juex@my-dejanews.com>
Subject: Re: Afraid to ask about Y2K!
Message-Id: <7k70bb$3ca@news.dns.microsoft.com>

Tom Christiansen <tchrist@mox.perl.com> wrote in message
news:3766e8a3@cs.colorado.edu...
>      [courtesy cc of this posting mailed to cited author]
>
> In comp.lang.perl.misc,
>     "J|rgen Exner" <juex@my-dejanews.com> writes:
> :Is there anything wrong with 31.Dez, 24:00 being the same as 01.Jan,
00:00 ?
>
> You can't have 24:00 -- that's out of the valid range.  Hours are
> guaranteed less than 24.

You could argue about that. 24:00 is widely used at least.
It depends on what you want to emphasize: the difference between a time
during the old day and the last moment of that day or the beginning of the
new day and a time during the new day.

> After 11:59:59pm comes 12:00:00midnight.

Sorry, but after 11:59:59 comes lunch.
Probably you meant to say after 23:59:59 comes 00:00:00.

jue
--
J|rgen Exner





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

Date: 15 Jun 1999 20:32:18 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Afraid to ask about Y2K!
Message-Id: <37670cb2@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    "J|rgen Exner" <juex@my-dejanews.com> writes:
:You could argue about that. 

I believe I was doing so.

:24:00 is widely used at least.

That makes no sense.  Either either seconds in a day run from 00:00:00
through 23:59:59 and there is no 24:00:00, or else they run from 00:00:01
through 24:00:00 and there is no 00:00:00.

:> After 11:59:59pm comes 12:00:00midnight.
:
:Sorry, but after 11:59:59 comes lunch.

No sir.  Read my stuff above, and more carefully this time.

:Probably you meant to say after 23:59:59 comes 00:00:00.

Nope.  I said what I meant.  We were speaking English here, not German.
We have "am" and "pm", whether you like it or not, and I know you don't,
but that's the fact.  Real Clocks [tm] have nice 12-element dials whose
angles are infinitely easy to cope with than digital time.  Otherwise,
we might as well go over to metric time and bite off the rest of the kit
and kaboodle while we're at it.

Here's one reference:

    If the time is followed by `am' or `pm' (or `a.m.' or `p.m.'), hour
    is restricted to run from 1 to 12, and `:minute' may be omitted
    (taken to be zero).  `am' indicates the first half of the day,
    `pm' indicates the second half of the day.  In this notation, 12
    is the predecessor of 1: midnight is `12am' while noon is `12pm'.
->  (This is the zero-oriented interpretation of `12am' and `12pm', as
->  opposed to the old tradition derived from Latin which uses `12am'
->  for noon and `12pm' for midnight.)

The point is that twelve o'clock noon and twelve o'clock midnight properly
pertain to neither the period ante meridian nor the one post meridian.
I, being apparently of the old school, was taught that 12am was noon,
whereas you, being apparently of the new one, were taught that 12am
was midnight.  But the real point here is that both these views are in
some senses technically wrong.  It's just twelve o'clock noon.  Period.
Anything else is confusing.

--tom
-- 
    echo "ICK, NOTHING WORKED!!!  You may have to diddle the includes.";;
            --Larry Wall in Configure from the perl distribution


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

Date: Tue, 15 Jun 1999 21:45:48 -0500
From: rlb@intrinsix.ca (Lee)
Subject: Re: Afraid to ask about Y2K!
Message-Id: <B38C7A0C96685200C5@204.112.166.88>

In article <7k70bb$3ca@news.dns.microsoft.com>,
"J|rgen Exner" <juex@my-dejanews.com> wrote:

>Tom Christiansen <tchrist@mox.perl.com> wrote in message
>news:3766e8a3@cs.colorado.edu...
>>
>> You can't have 24:00 -- that's out of the valid range.  Hours are
>> guaranteed less than 24.
>
>You could argue about that. 24:00 is widely used at least.

You can argue all you like, and in some contexts you might argue the point
well, but in the present context POSIX is going to win.

Lee




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

Date: Tue, 15 Jun 1999 20:13:56 -0700
From: TRG Software : Tim Greer <webmaster@chatbase.com>
To: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Afraid to ask about Y2K!
Message-Id: <37671674.317F01AC@chatbase.com>

<SNIP>
> Many people really seem to think that civilisation will end at jan 1,
> 2000, 12 AM.
<SNIP>

Actually, in a lot of people's lack of understanding and madness
(through in paranoia), they didn't actually take the time to count. They
have no problem screaming about ridiculous things and can't seem to deal
with the rest of us not panicking along with them. They don't
understand, because they either don't have the logic/comprehension, or
they'll not willing to study the subject. If these people did, then this
wouldn't be a problem in the first place, as I'm sure you'd agree,
however when it comes right down to it to where some of these people are
preparing for the end of the world, they aren't even correct -- and
that's the funny thing! If they'd bother to look it up and study about
any of the Y2K issue, then they'd see that our calendars contain a
two-year error. When historians originally attempted to count backward
to the birth of Christ, they did so by accounting for the Reign of
Kings. One of the kings counted was actually ruler of his country twice,
the second time under a different name for a period of two years. When
the years of rule were counted, this king's reign was mistakenly counted
twice. It's not time to panic after all. :-)
-- 
Regards,
Tim Greer: chatmaster@chatbase.com / software@linkworm.com
Chat Base: http://www.chatbase.com | 250,000+ hits daily Worldwide!
TRG Software: http://www.linkworm.com | CGI scripting in Perl/C, & more.
Unix/NT/Novell Administration, Security, Web Design, ASP, SQL, & more.
Freelance Programming & Consulting, Musician, Martial Arts, Sciences.


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

Date: Tue, 15 Jun 1999 22:47:02 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Compiling regexes for the duration of a subroutine
Message-Id: <1dtgnfq.f3nsyb1xodg8mN@p51.tc1.metro.ma.tiac.com>

John Siracusa <macintsh@cs.bu.edu> wrote:

> Ronald J Kimball <rjk@linguist.dartmouth.edu> wrote:
> > I must object to this characterization of the null regex technique as
> > 'dubious'.  Although it will not work for your case, as you say, I have
> > put it to very good use in one of my programs for a noticeable gain in
> > efficiency.
> 
> It's dubious in that it's not always possible to guarantee a
> successful match to set up the regex, especially when your
> subroutine has no knowledge of the regexes being passed to it.

That's definitely true.  I think it is a design flaw that // uses the
last successfully matched regex rather than the last used regex.

In the script where I use //, I know that the regex is of the form
/[^abc]/, where abc is a string of lowercases letters, so it was easy to
set up the successful match.

I do wish // were more useful, though.

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
perl -e '$_="\012534`!./4(%2`\cp%2,`(!#+%2j";s/./"\"\\c$&\""/gees;print'


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

Date: Tue, 15 Jun 1999 22:47:00 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Compiling regexes for the duration of a subroutine
Message-Id: <1dtgncp.1lhe4jf1vvcpmoN@p51.tc1.metro.ma.tiac.com>

Uri Guttman <uri@sysarch.com> wrote:

>   RJK> I must object to this characterization of the null regex
>   RJK> technique as 'dubious'.  Although it will not work for your case,
>   RJK> as you say, I have put it to very good use in one of my programs
>   RJK> for a noticeable gain in efficiency.
> 
> have you compared it to using qr//? if all you gain is not recompiling
> the regex, it would be even in cpu but clearer in code to use qr.

No, I haven't.  This system does not have perl5.005 on it.
Even if it did, I don't know that this one point would be worth tying
the script to 5.005 when 5.004 is still so common.


-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        perl -le 'print "Just another \u$^X hacker"'


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

Date: Tue, 15 Jun 1999 22:49:03 -0400
From: Ron Grabowski <ronnie@catlover.com>
Subject: Re: dimensions of a jpg file
Message-Id: <3767109F.A79830AB@catlover.com>

Without converting the size of JPG itself, the image will become
distorted if you simply change the <IMG> tags in the browser!


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

Date: Fri, 11 Jun 1999 02:06:06 +0200
From: Henk Bokhoven <h.c.a.bokhoven@bok.selwerd.cx>
Subject: Re: Error while running News-Scan-0.51
Message-Id: <376052EE.D93EED78@bok.selwerd.cx>

Jonathan Stowe wrote:
> 
> Henk Bokhoven <h.c.a.bokhoven@kpn.com> wrote:
> > Hi there!
> >
> > [ see subject ]
> >
> > This is what I get:
> >
> > -- 8< -- cut here -- 8< --
> > Encountered CODE ref, using dummy placeholder \
> >   at /usr/lib/perl5/5.00502/i586-linux/Data/Dumper.pm line 429.
> > Argument "1, 2, and 4" isn't numeric in eq at ./news-stats line 229.

It must be sthg. in the headers / bodies of the messages, 'cause using
another newsgroup works fine...
Ehr... ?:\
-- 
   ___  ___       __         |  Henk C.A. Bokhoven, Groningen, NL
  /  / /  /____  (__)__  ___ | E-mail : hbokh at worldonline dot nl
 /  /_/  /  _  \/  /\  \/  / |    day : HP-UX, Digital OSF1, Linux 
 \___,__/__//__/__/ /__/\__\ |  night : Linux SuSE 6.1 on an i686


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

Date: Tue, 15 Jun 1999 23:09:33 +0200
From: "Oreg Dixie" <maistro@swi.hu>
Subject: exclusive open
Message-Id: <7k6fh5$bta$1@pollux.matav.net>

Hi!

I wrote a complete forum in perl, but I've got one problem with it: When two
or more users write to it simultaneously, then there'll be some garbage in
the log file. How Can I open the forum's log file exclusively? And what'll
happen when someone locked the file (the script is writing the message into
the log file) and another request comes from another user? It would be nice
to keep the other users wait till the writing procedure ends.

Thanks in advance!

BYe,
Flt






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

Date: 15 Jun 1999 23:59:05 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: FEAR FAD
Message-Id: <x7674og5iu.fsf@home.sysarch.com>

>>>>> "DC" == David Cassell <cassell@mail.cor.epa.gov> writes:

  DC> sean-whitestone wrote:
  >> 
  >> Y2K MILLENNIUM BUG:THE LATEST  FEAR FAD "I sought the Lord and He answered
  >> [BIG SNIP]

  DC> Why do I have this awful temptation to give this guy Jocelyn's
  DC> e-mail address?  And _vice_versa_?

just do it!

:-)

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Wed, 16 Jun 1999 13:32:21 +1000
From: "Aneesha" <aneesha@vettweb.net.au>
Subject: Re: File Uploading
Message-Id: <CPE93.172$lc5.489@ozemail.com.au>

Hi

> What makes you think you need tech support to install a module?
>
Look, i did say at the beginning of my post that I was not familiar with
perl or unix at all.
Have you ever been new to something or were you born with the knowledge of
the universe.

> You have paying customers and you don't even know the basics about
> installing modules? Poor customers.

I'm still learning the basics. But if you ever need any help with Javascript
or ASP, I'll be glad to help you even if you ask simple questions.

Take Care









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

Date: 16 Jun 1999 03:34:11 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: File Uploading
Message-Id: <slrn7me6pi.654.sholden@pgrad.cs.usyd.edu.au>

On Wed, 16 Jun 1999 13:32:21 +1000, Aneesha <aneesha@vettweb.net.au> wrote:
>Hi
>
>> What makes you think you need tech support to install a module?
>>
>Look, i did say at the beginning of my post that I was not familiar with
>perl or unix at all.
>Have you ever been new to something or were you born with the knowledge of
>the universe.

We know how to read, and thus read the documentation to find asnwers to
what must be simple questions...

-- 
Sam



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

Date: Tue, 15 Jun 1999 19:22:05 -0700
From: "Lauren Smith" <laurens@bsqaure.com>
Subject: Re: How to scan a directory and put all the files and their size to a text file
Message-Id: <7k71oi$2p8$1@brokaw.wa.com>

Dariush_news wrote in message <7k6c2q$c1r$1@clio.net.metrotor.on.ca>...
>Hi Everyone;
>
>I need to scan a directory and input all the file namse in to a text file
>with thier respecitve size.
>
>Eventually I need to input this file into a excel programm and manipulate
>it.
>Does anybody have a similar script out there?
>
>Thanks so much for your help.


Here's a very OS dependent script that can do that:

#!/usr/bin/perl -w
use strict;

system ("dir /a-d > foo.txt");

open (FOO, "foo.txt");
open (OUT, ">out.txt");

while (<FOO>) {
   if (/^\s/) {
      next;
   } else {
      /^.{17}(.*)/;
      print OUT "$1\n";
   }
}

Don't try this on a non-Windows OS.

Lauren




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

Date: Wed, 16 Jun 1999 02:39:03 GMT
From: Tom <marc.bourrassa@sympatico.ca>
Subject: Re: How to write search engine like Yahoo??
Message-Id: <376707FB.7A924A24@sympatico.ca>


--------------73CF44F0E148F8C8BD7D6395
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Perl is a good choice (as I know, Yahoo! uses Perl).

Check for PerlHoo!. It's a Yahoo! like web directory Perl script, free
for use. (Hotbot [or some other search engine] should help you find it)




wilson a =E9crit:

>
> Hi,  I want to write a chinese search engine likeyahoo.
> Is Perl as a first choice? Has any web site to teach people how to
> write a search engine? Thank you for helping.



--
Not lucky enought to use Unix, but just enought to be able to use Dos
and not just Windows.
And don't think I live for Micro$oft, I hate it.


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

<HTML>
Perl is a good choice (as I know, Yahoo! uses Perl).

<P>Check for PerlHoo!. It's a Yahoo! like web directory Perl script, free
for use. (Hotbot [or some other search engine] should help you find it)
<BR>&nbsp;
<BR>&nbsp;
<BR>&nbsp;

<P>wilson a &eacute;crit:
<BLOCKQUOTE TYPE=CITE>&nbsp;
<BR><FONT SIZE=+1>Hi,&nbsp; I want to write a chinese search engine likeyahoo.</FONT>
<BR><FONT SIZE=+1>Is Perl as a first choice? Has any web site to teach
people how to</FONT>
<BR><FONT SIZE=+1>write a search engine? Thank you for helping.</FONT></BLOCKQUOTE>
&nbsp;

<P>--
<BR>Not lucky enought to use Unix, but just enought to be able to use Dos
and not just Windows.
<BR>And don't think I live for Micro$oft, I hate it.
<BR>&nbsp;</HTML>

--------------73CF44F0E148F8C8BD7D6395--





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

Date: Wed, 16 Jun 1999 00:33:00 GMT
From: jonathan_wheelhouse@amp.com.au
Subject: INI files: is there a ksh shell script to parse them (like iniconf)?
Message-Id: <7k6rbr$631$1@nnrp1.deja.com>

Does anybody have a shell script (ksh, preferably) that reads ini or
configuration files of the form:
[section]
Parameter=Value
Parameter=<<EOT
value/line 1
value/line 2
EOT

The perl module, iniconf, is great for doing this; unfortunately I
can't use it in this situation; I just need a ksh script that returns
the value(s) given the section and parameter as input.

Thanks in advance.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 15 Jun 1999 20:02:41 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Is it better perl than awk ?
Message-Id: <376705c1@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    churchyh@ccwf.cc.utexas.edu (Henry Churchyard) writes:
:Actually, Microsoft refers to it as "Windows ANSI" or "Code page 1252"

Well, I hardly expected them to call refer to it as Illegal MS-ASCII. :-)

:(and people who don't use Emacs may have no idea what you mean by "M-4").

Not even the "cat -v"ers? :-)

:The quasi-accepted solution here is to use HTTP headers such as:
:Content-Type: text/plain;charset=windows-1252

That's an interesting approach.  For some reason, I don't
seem to see it used.  

Thanks for the impressive link.  I'll add it to the MS-ASCII page.

:--%!PS
:10 10 scale/M{rmoveto}def/R{rlineto}def 12 45 moveto 0 5 R 4 -1 M 5.5 0 R
:currentpoint 3 sub 3 90 0 arcn 0 -6 R 7.54 10.28 M 2.7067 -9.28 R -5.6333
:2 setlinewidth 0 R 9.8867 8 M 7 0 R 0 -9 R -6 4 M 0 -4 R stroke showpage

I don't believe I've seen a signature this interesting in a while.
Although the "stroke showpage" caused me to slightly fear a pornattack, 
I looked anyway, and can't quite make out what the glyphs are producing.

--tom
-- 
 Computer Science is nothing more than the study of patterns of 0s and 1s
			 --Donald Knuth


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

Date: 16 Jun 1999 03:12:55 GMT
From: ptjm@interlog.com (Patrick TJ McPhee)
Subject: Re: Is it better perl than awk ?
Message-Id: <7k74nn$e7m$1@news.interlog.com>

In article <3766d292.0@omega>, Claudio Gutierrez <cgutierr@firstcom.cl> wrote:

% awk is capable to deal quickly with such relatively huge files or I need
% perl?

You could give it a kick. If you find there are performance problems with
the system awk, you could try installing mawk, which is much faster.

--

Patrick TJ McPhee
East York  Canada
ptjm@interlog.com


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

Date: 15 Jun 1999 21:11:38 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Micro(in)posters (was: Afraid to ask about Y2K!)
Message-Id: <376715ea@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
"J|rgen Exner" <juex@my-dejanews.com> writes with these 
relevant headers:

    From: "J|rgen Exner" <juex@my-dejanews.com>
				  ^^^^^^^^^^^^^^^
    Date: Tue, 15 Jun 1999 18:58:26 -0700
				    ^^^^^
    Organization: MS
		  ^^
    Message-ID: <7k70bb$3ca@news.dns.microsoft.com>
				     ^^^^^^^^^^^^^
    NNTP-Posting-Host: 157.56.81.91
		       ^^^^^^^^^^^^^
    X-Newsreader: Microsoft Outlook Express 5.00.2014.211
    X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211
    Path: cs.colorado.edu!csnews!nntp.primenet.com!logbridge.uoregon.edu!
    netnews1.nw.verio.net!netnews.nwnet.net!news.verio.net!news.microsoft.com!news
						                ^^^^^^^^^

Compared with another so-called Deja News user's headers as follow:

    From: aoh@my-deja.com
		 ^^^^
    Date: Tue, 15 Jun 1999 23:54:50 GMT
				    ^^^
    Organization: Deja.com - Share what you know. Learn what you don't.
		  ^^^^^^^^
    Message-ID: <7k6p46$5b5$1@nnrp1.deja.com>
    NNTP-Posting-Host: 32.97.110.69
    X-Article-Creation-Date: Tue Jun 15 23:54:50 1999 GMT
    X-Http-User-Agent: Mozilla/4.51 [en] (Win95; U)
    X-Http-Proxy: 1.0 x33.deja.com:80 (Squid/1.1.22) for client 32.97.110.69
    Path: cs.colorado.edu!csnews!nntp.primenet.com!hermes.visi.com!news-out.visi.
    +     com!hub1.ispnews.com!cyc12.deja.bcandid.com!nntp1.deja.com!nnrp2.deja.
    +     com!nntp2.deja.com!nnrp1.deja.com!not-for-mail
				   ^^^^^^^^


Inquiring minds want to know: why do you appear to be a Microsoft person
spoofing a Deja News person, or perhaps some random person spoofing being
a Microsoft person spoofing a Deja News person? 

--tom
-- 
 He who hasn't hacked assembly language as a youth has no
 heart. He who does so as an adult has no brain.


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

Date: Wed, 16 Jun 1999 01:44:23 GMT
From: hychung@my-deja.com
Subject: Need to know all programs that got called ...
Message-Id: <7k6vhm$7dh$1@nnrp1.deja.com>

Hi, I'm learning Perl and do need some help ...

By clicking on a hyperlink on a web page, I know that a certain Perl
script gets executed.  However, due to the complex behind-the-scene
processing, many other Perl programs/modules/subroutines also got
called.  How do I print to myself an audit trail file that tells me
what programs/modules/subroutines have been executed and the order of
their execution?

Thank you for helping me in my learning Perl : )


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 15 Jun 1999 21:35:40 -0500
From: rlb@intrinsix.ca (Lee)
Subject: Re: newbie learning "my" declarations
Message-Id: <B38C77AC966851720D@204.112.166.88>

In article <AyA93.5842$nn.1067464@news.shore.net>,
aaronp@removeme-shore.net wrote:

>I want to do this:
>
>my $total++;

Perl is supernaturally adept at making sense of bizarre requests, but it
would have to put its mojo into overdrive to follow that one. You just
asked it to:

"Make me a brand new variable, call it $total, and set its value to one
more than it used to be."

It apparently even tries to do this (with a litle extra magic for glue) but
not in the order you would like.

Lee




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

Date: Tue, 15 Jun 1999 22:47:03 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: newbie learning "my" declarations
Message-Id: <1dtgome.fc5pc4fnwyquN@p51.tc1.metro.ma.tiac.com>

<aaronp@removeme-shore.net> wrote:

> I want to do this:
> 
> my $total++;

No, you don't want to do that.  You want to do this:

my $total;

# later on

$total++;


You can't declare arbitrary expressions as lexical.

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Tue, 15 Jun 1999 00:31:36 +0200
From: "Oreg Dixie" <maistro@swi.hu>
Subject: Opening a file exclusively
Message-Id: <7k5qgv$n3k$1@pollux.matav.net>

Hi!

I wrote a complete forum in perl, but I've got one problem with it: When two
or more users write to it simultaneously, then there'll be some garbage in
the log file. How Can I open the forum's log file exclusively? And what'll
happen when someone locked the file (the script is writing the message into
the log file) and another request comes from another user? It would be nice
to keep the other users wait till the writing procedure ends.

Thanks in advance!

BYe,
Flt




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

Date: Tue, 15 Jun 1999 22:54:25 -0400
From: Ron Grabowski <ronnie@catlover.com>
Subject: Re: Opening many new windows...
Message-Id: <376711E1.7D6688A2@catlover.com>

Use Perl to connect to the search engines directly (you dont have to
open any OLE objects for this) and parse the output that way then launch
a broswer via OLE and display the results.


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

Date: Tue, 15 Jun 1999 22:47:04 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: overwrite "print" ?
Message-Id: <1dtgos0.lsarda1o2zankN@p51.tc1.metro.ma.tiac.com>

Abigail <abigail@delanet.com> wrote:

> Sig that overrides both print and __PACKAGE__ follows.
> 
> 
> Abigail
> -- 
> package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
>                                       print } sub __PACKAGE__ { &
>                                       print (     __PACKAGE__)} &
>                                                   __PACKAGE__
>                                             (                )

I don't believe so.  You're calling your print and __PACKAGE__
subroutines with an ampersand.  You haven't overridden either keyword;
you've just declared subroutines that happen to have the same names.
Similarly, if you define a subroutine named s, you have not overridden
the s/// operator, and you have to call your new subroutine as &s.

In particular, when you execute the simple statement 'print', you get
the builtin print, not your new print subroutine.

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Tue, 15 Jun 1999 22:47:19 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: parse a string in triplet ?
Message-Id: <1dtgp0w.mar8srwzqj0bN@p51.tc1.metro.ma.tiac.com>

M.J.T. Guy <mjtg@cus.cam.ac.uk> wrote:

> Gareth Rees  <garethr@cre.canon.co.uk> wrote:
> >
> >Larry Rosler wrote:
> >> print join '+' => map substr($dna, 3 * $_, 3), 0 .. (length $dna)/3;
> >
> >$_ = $dna; s/\G([ACGT]{3})/$1+/g; print;
> 
> Don't do that.    It's O(N**2) while most of the other responses are
> O(N).    And DNA strings can get quite long ...

How is that O(N**2)?  It loops over the input string exactly once, just
as all the other solutions do.

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Wed, 16 Jun 1999 10:20:26 +0800
From: "cwt" <eng80386@nus.edu.sg>
Subject: perlie tree
Message-Id: <7k726a$6v$1@newton.pacific.net.sg>

Hallo all , below is a scripts that would go into a directory , search for
files with a target string and write to a log file the line that the string
occurs.
Can anyone suggest ways to make it a recursive algorithm such that it would
go
into the directory and execute the process from the parent into the
sub-directories downwards like a tree ??
Thanks !!

##########################################################
#!/usr/bin/perl

$SCRIPTSPATH='/home/usr//cgi-bin/Scripts'; #path of this script
$SAVEPATH='/home/usr/cgi-bin/Scripts/data'; # path of the log
$SEARCHPATH='/home/usr/cgi-bin/other/Search'; #path of the searched dir
$TARGETSTR="/opt/pkgs/release/cgi-bin"; # the target string

opendir(SEARCHDIR,"$SEARCHPATH") || die "Cannot open SEARCHDIR file";

while( $_=readdir(SEARCHDIR) ){

     $presentfile=$_;

     if(-d "$SEARCHPATH/$_" ){

      mkdir("$SAVEPATH/$_", 0777);
      chmod(0777 , "$SAVEPATH/$_");


 }elsif(-f "$SEARCHPATH/$_" ){
      open(SAVEFILE,">>$SAVEPATH/$_");
      chmod(0777 , "$SAVEPATH/$_");
        open(SEARCH,"$SEARCHPATH/$_");
       while(<SEARCH>){

            if($_=~ /$TARGETSTR/){

                             print SAVEFILE $.;
                             print SAVEFILE "\n";

            }
          }

  close SEARCH;
 }

 close(SAVEFILE);

}


open(LOG,">>$SCRIPTSPATH/log");
opendir(SAVEDIR,"$SAVEPATH") || die "Cannot open SAVEDIR file";

while( $_=readdir(SAVEDIR) ){

 if( (-f "$SAVEPATH/$_")  && !(-z "$SAVEPATH/$_") ){

  print LOG "****Files in $SEARCHPATH/$_ *******";
  open(DESFILE,"$SAVEPATH/$_");

   print LOG "$_\n";
   while(<DESFILE>){

    print LOG $_;

   }

  print LOG "*************\n\n";

  close DESFILE;

 }

}






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

Date: Tue, 15 Jun 1999 22:57:03 -0400
From: Ron Grabowski <ronnie@catlover.com>
Subject: Re: PerlIS.dll on NT == Perl.exe COMPLETELY?
Message-Id: <3767127F.FA4AD468@catlover.com>

Doesnt the .DLL automatically send the output to the web server...it
automatically attaches Content-Type: text/html?


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

Date: Wed, 16 Jun 1999 04:35:19 +0200
From: "Martin" <martin.akesson@swipnet.se>
Subject: Sourc to HTML with syntax-highlighting
Message-Id: <U0E93.12194$Nc.22138@nntpserver.swip.net>

I'm lazy and someone HAS to have made this...
(it's just that i can't find it)
What i'm looking for is a script that takes a source
and converts it to HTML with syntax-highlighting.

I doesn't really matter what language it's made for.
I just need the engine that filters out strings and keywords.
But if you know one thats can handle c/c++ that would be great.

/Martin
----------------------------------------
      M a r t i n   E k e s s o n
----------------------------------------
 E-mail:    <martin.akesson@swipnet.se>
            <di98akma@ios.chalmers.se>
 PGP DH/DSS:0x37BBCD27
 PGP RSA:   0x1BC4B105
----------------------------------------
For secure communication please use PGP!
----------------------------------------





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

Date: 16 Jun 1999 02:05:39 GMT
From: Lucifer Bonaventure <revjack@radix.net>
Subject: Re: this  charecter @ ruined my day!!
Message-Id: <7k70pj$k8g$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight

Tom Christiansen explains it all:

:Give up now.   If you can't get at your own errors, there's really 
:very little hope.

Lack of access to logs (of any kind) is more widespread than one might
think, especially with the popularity of those quickie we-host-4-U web
hosting companies. Anticipate more and more of these pleas. 

One could rightly criticise the administators of such services for their
decision not to make the logs readily available to developers. And, one
could criticise people who patronize these services. But they're there,
and there are lots of them, and there are likely to be more. Patrons of
these services will always need some poor schmoe (like me) to develop
their feedback forms, flat-file databases, bulletin boards, search
engines, etc., without the benefit of log access. It pays the bills. 

Fortunately, there *are* ways to develop and debug given only the HTTP
protocol. How to achieve this sort of one-eyed development may already be
a FAQ, I don't know. I'm too lazy to look. 

Probably has something to do with one of those module thingies.


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

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

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