[17238] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4660 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 19 06:05:37 2000

Date: Thu, 19 Oct 2000 03:05:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <971949913-v9-i4660@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 19 Oct 2000     Volume: 9 Number: 4660

Today's topics:
    Re: Counter doesn't work (Gwyn Judd)
    Re: Counter doesn't work (Villy Kruse)
    Re: factorial function problem (Tramm Hudson)
    Re: factorial function problem (Gwyn Judd)
        Fax Servers <todd@mrnoitall.com>
    Re: Fax Servers (Martien Verbruggen)
        form-mail.pl with windows NT Server <stuart@ammpro.com>
    Re: form-mail.pl with windows NT Server <anders@wall.alweb.dk>
    Re: Getting column attributes using Win32::ODBC (Philip Lees)
        How to install DB_File package in windows perl myhandle@lucent.com
    Re: Last try - does nobody know this stuff? <mikecook@cigarpool.com>
    Re: Make this regex neater, anyone? (Philip Lees)
    Re: Make this regex neater, anyone? <bart.lateur@skynet.be>
    Re: manipulating data files <godzilla@stomp.stomp.tokyo>
    Re: manipulating data files <david.obrien@ssmb.com.au>
    Re: manipulating data files <godzilla@stomp.stomp.tokyo>
        Memory usage : how know ? <alian@alianwebserver.com>
    Re: Passwd Help?? <r.fraser@student.murdoch.edu.au>
    Re: Perl + Sessions <dsimonis@fiderus.com>
    Re: Perl not functioning in practice as it should in th nobull@mail.com
    Re: Perl vs C on server side <uri@sysarch.com>
    Re: Programmer needed (Logan Shaw)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 19 Oct 2000 08:00:00 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Counter doesn't work
Message-Id: <slrn8utamj.16d.tjla@thislove.dyndns.org>

I was shocked! How could Ted Zlatanov <tzz@heechee.beld.net>
say such a terrible thing:
>Anders Lund <anders@wall.alweb.dk> writes:
>
>> NEVER EVER use open() without die()
>
>> if you don't test your open, and btw also close calls, you may end up in 
>> bad trouble.
>
>I have to strongly disagree.  Never use open() without checking the
>return stats, sure.  But die() is overkill in a lot of cases, and
>indiscriminate use of die() instead of handling errors properly can
>create fragile code that works only when the stars are aligned right.
>
>The proper approach would be something like this:
>
>if (open FILE ...)
>{
> # do the file processing
> close FILE;
>}
>else
>{
> # handle the error appropriately - die, warn, whatever
>}

ick. I *much* prefer it the other way:

open FILE ... or handle the error however you like it die, warn, open
another file whatever

# do the rest of the file handling down here

The reason I prefer this is that you don't then have to consider later
on in the script what the result of the open was since you have already
considered it and handled it correctly. Your way adds more complexity
and more (longer) paths for the code to take.

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Computers are unreliable, but humans are even more unreliable.
Any system which depends on human reliability is unreliable.
		-- Gilb


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

Date: 19 Oct 2000 09:54:14 GMT
From: vek@pharmnl.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: Counter doesn't work
Message-Id: <slrn8uth4b.mkh.vek@pharmnl.ohout.pharmapartners.nl>

On Wed, 18 Oct 2000 17:41:23 +0200, Hans Vogel <hansvog@hetnet.nl> wrote:
>Hello There!
>The following CGI code in Perl Does print "1" in gif but doesn't seem to
>read and
>write the count.dat file. I did a CHMOD 777 on the dat file but it still
>doesn't work.
>Can anyone tell me what could be wrong?
>Thanx and greetings from Holland,
>Hans.
>



In addition to all the other fine recomendations already given, it is
hard to make a reliable counter file woutout using flock() to prevent
two programs to update the file at the same time.  The problem gets
worse if the close of the file is defered until the very end of the
program.  Bear in mind that the physical write of the file does not
occur until the file is closed, due to buffering of the write data.
Therefore there would be quite a long time between the file is read
and the time the updated value is physically written back to the
file.



Villy
m



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

Date: 19 Oct 2000 04:11:31 GMT
From: hudson@swcp.com (Tramm Hudson)
Subject: Re: factorial function problem
Message-Id: <8sls9j$i9l$1@sloth.swcp.com>
Keywords: closure abuse, scheme to perl, fib, fact, recursion, icbm, f22 tigershark

Gwyn Judd <rot13('tjla@guvfybir.qlaqaf.bet')> wrote:
>I misread the subject and thought it said "fibonacci" instead of
>"factorial". I was going to respond with a smart-alec comment like "How
>about the Right answer?" before I realised :)

That's ok -- the fib program is also interesting.  More interesting,
actually, that you took the time to figure out how it worked and
make it do something else.


> Anyway, I rewrote yours
>slightly to do that:
[snip]
>        push @{$_[2]}, $_[0]->(@_) + $_[2]->[$n-2] if @{$_[2]} <= $n;

Doesn't this depend on the order of evaluation for '+'?  If the
$_[2]->[$n-2] is evaluated first then it might not have been memoized.
I would probably spend the extra call to $_[0] just in case, although
modifying $_[1] or @_ for the second call would be an extra line of code.

In an earlier posting on the subject:

	http://x69.deja.com/=dnc/getdoc.xp?AN=670237002&AH=1

I answered someone's homework with the memoized one liner:

    my @f = (0,1,1); sub f { return $f[$_[0]] ||= f($_[0]-1) + f($_[0]-2) }


>Now all we need is for it to be readable for the non Lisp people :)

I have made several posts on the subject of closures, continuations,
and the value of functional style coding in the past.  Even wrote and
posted a Scheme to Perl translator.  Not an evaluator, but something that
would output equivilent Perl code.  Never seemed to be much interest in it...

Do you think long time LISP hackers have an easier time parsing the

	sub{ ... }->( sub{ ... } ) 

style code than other programmers?  I still have to think about it, even
if it is written as the much clearer (ha!):

	((lambda (f) ... ) (lambda (x) ... ))

Tramm
-- 
  o   hudson@swcp.com                  hudson@turbolabs.com   O___|   
 /|\  http://www.swcp.com/~hudson/          H 505.323.38.81   /\  \_  
 <<   KC5RNF @ N5YYF.NM.AMPR.ORG            W 505.986.60.75   \ \/\_\  
  0                                                            U \_  | 


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

Date: Thu, 19 Oct 2000 08:31:47 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: factorial function problem
Message-Id: <slrn8utci4.16d.tjla@thislove.dyndns.org>

I was shocked! How could Tramm Hudson <hudson@swcp.com>
say such a terrible thing:
>Gwyn Judd <rot13('tjla@guvfybir.qlaqaf.bet')> wrote:
>
>>        push @{$_[2]}, $_[0]->(@_) + $_[2]->[$n-2] if @{$_[2]} <= $n;
>
>Doesn't this depend on the order of evaluation for '+'?  If the
>$_[2]->[$n-2] is evaluated first then it might not have been memoized.
>I would probably spend the extra call to $_[0] just in case, although
>modifying $_[1] or @_ for the second call would be an extra line of code.

Yes I considered that too, however it turned out that it wasn't
necessary so I didn't bother. Does anyone in the know, know what the
deal is with order of evaluation for operators like '+'? Is it
guaranteed to happen in some order?

>In an earlier posting on the subject:
>
>	http://x69.deja.com/=dnc/getdoc.xp?AN=670237002&AH=1
>
>I answered someone's homework with the memoized one liner:
>
>    my @f = (0,1,1); sub f { return $f[$_[0]] ||= f($_[0]-1) + f($_[0]-2) }

This looks like a job for hookhook:

     my @f = (0,1); sub f { return $f[$_[0]] ??= f($_[0]-1) + f($_[0]-2) }

Pity it doesn't work :(

>>Now all we need is for it to be readable for the non Lisp people :)
>
>I have made several posts on the subject of closures, continuations,
>and the value of functional style coding in the past.  Even wrote and
>posted a Scheme to Perl translator.  Not an evaluator, but something that
>would output equivilent Perl code.  Never seemed to be much interest in it...
>
>Do you think long time LISP hackers have an easier time parsing the
>
>	sub{ ... }->( sub{ ... } ) 
>
>style code than other programmers?  I still have to think about it, even
>if it is written as the much clearer (ha!):
>
>	((lambda (f) ... ) (lambda (x) ... ))

Beats me. It warps my brain either way actually.

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Egotist:  A person of low taste, more interested in himself than in me.
-- Ambrose Bierce


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

Date: Wed, 18 Oct 2000 22:36:24 -0600
From: Todd Anderson <todd@mrnoitall.com>
Subject: Fax Servers
Message-Id: <39EE7A46.731CBF3C@mrnoitall.com>

This is a multi-part message in MIME format.
--------------59D7C5145A1383B8FC1518E1
Content-Type: text/plain; charset=us-ascii; x-mac-type="54455854"; x-mac-creator="4D4F5353"
Content-Transfer-Encoding: 7bit

Dear Sirs,
I need help/ advice/ direction on implementing a fax server. I need to
send and receive faxes from a web browser. Any help would be
appreciated.
Thanks in advance

--------------59D7C5145A1383B8FC1518E1
Content-Type: text/x-vcard; charset=us-ascii;
 name="todd.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Todd Anderson
Content-Disposition: attachment;
 filename="todd.vcf"

begin:vcard 
n:Anderson;Todd
tel;quoted-printable;fax:http://asgweb.net=0D=0Ahttp://asgweb.net/asgpro=0D=0A
tel;quoted-printable;pager:http://mrnoitall.com=0D=0A
tel;quoted-printable;home:http://asgweb.net=0D=0A
tel;work:801.487.3675
x-mozilla-html:FALSE
adr:;;;;;;
version:2.1
email;internet:todd@mrnoitall.com
x-mozilla-cpt:;1
fn:Todd Anderson
end:vcard

--------------59D7C5145A1383B8FC1518E1--



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

Date: Thu, 19 Oct 2000 16:19:50 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Fax Servers
Message-Id: <slrn8ut13m.fji.mgjv@martien.heliotrope.home>

On Wed, 18 Oct 2000 22:36:24 -0600,
	Todd Anderson <todd@mrnoitall.com> wrote:
> This is a multi-part message in MIME format.

[please don't do that. Usenet is a plain text medium]

> Dear Sirs,
> I need help/ advice/ direction on implementing a fax server. I need to
> send and receive faxes from a web browser. Any help would be
> appreciated.

I once started something like that, only to find out that it is a bloody
lot of work. Talking FAX protocols is hard, especially if you need to
implement the various versions, and make sure you work around the
various bugs in implementations.

\begin[unix]{specific}

I can only advise you to not even try. Get yourself Hylafax
(http://www.hylafax.org/) and use that as a server.  Then together with
the CGI module, the hylafax command line tools, the hylafax server and a
HTTP server, you have 99% of the work done.

\end{specific}

If you need to do this on a MS platform, then I don't have any answers
for you. Sorry.

Of course, if you still want to do it, you are free to try :) I'd still
get the HylaFax sources to see how they've solved the major problems.

Martien
-- 
Martien Verbruggen              | Since light travels faster than
Interactive Media Division      | sound, isn't that why some people
Commercial Dynamics Pty. Ltd.   | appear bright until you hear them
NSW, Australia                  | speak?


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

Date: Thu, 19 Oct 2000 09:54:34 +0100
From: "Stuart Maclean" <stuart@ammpro.com>
Subject: form-mail.pl with windows NT Server
Message-Id: <8smdfr$fnn$1@news.minx.net.uk>

I have only every used the form-mail.pl script with unix, and I am a bit
stuck when I have tried to use it on the nt box.  Can anyone help?

regards

Stuart Maclean
stuart@ammpro.com




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

Date: Thu, 19 Oct 2000 11:51:28 +0200
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: form-mail.pl with windows NT Server
Message-Id: <ivzH5.7556$Tq1.257018@news010.worldonline.dk>

Stuart Maclean wrote:

> I have only every used the form-mail.pl script with unix, and I am a bit
> stuck when I have tried to use it on the nt box.  Can anyone help?

If youre talking Matt Wright's FormMail, it's a bit old, so go look for 
something else.

That script btw uses sendmail, I think there is some sendmail app for nt 
somewhere, but really, the best solution is to go back to unix..

-anders

-- 
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]


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

Date: Thu, 19 Oct 2000 08:45:42 GMT
From: pjlees@ics.forthcomingevents.gr (Philip Lees)
Subject: Re: Getting column attributes using Win32::ODBC
Message-Id: <39eeb017.68729097@news.grnet.gr>

On Wed, 18 Oct 2000 12:03:51 GMT, pjlees@ics.forthcomingevents.gr
(Philip Lees) wrote:

>Win32::ODBC provides the ColAttributes method, called as follows,
>according to the docs:
>
>ColAttributes ( ATTRIBUTE [, FIELD_NAMES ] )
>
>I want to use this to find out whether a particular column in a Sybase
>Adaptive Server table is of type bit or not. I've tried calling the
>method with
>
>my $field_type = $db->ColAttributes (  ODBC::SQL_COLUMN_TYPE,
>$field_name );
>
>I've also tried various small integers as the ATTRIBUTE part.
>
>Whatever I do, the return value is just the column name. Can anyone
>tell me what I'm doing wrong?

Sorry for following up to my own post, but maybe this will help
somebody else.

After sleeping on it and reading the docs again I figured it out

<doc>
ColAttributes ( ATTRIBUTE [, FIELD_NAMES ] )
Returns the attribute ATTRIBUTE on each of the fields in the list
FIELD_NAMES in the current record set. If FIELD_NAMES is empty, then
all fields are assumed. The attributes are returned as an associative
array. 
</doc>

I originally read this as meaning that a hash is returned _only_ when
FIELD_NAMES is empty and that specifiying a single field name would
return one scalar value. I was wrong.

my %field_type = $db->ColAttributes (  ODBC::SQL_COLUMN_TYPE,
$field_name );

print $field_type{ $field_name };

works fine. My bad.

Phil
--
Philip Lees
ICS-FORTH, Heraklion, Crete, Greece
Ignore coming events if you wish to send me e-mail
'The aim of high technology should be to simplify, not complicate' - Hans Christian von Baeyer


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

Date: Thu, 19 Oct 2000 13:14:51 +0530
From: myhandle@lucent.com
Subject: How to install DB_File package in windows perl
Message-Id: <39EEA673.F31E09B4@lucent.com>

I have installed perl windows version. How to install DB_File package?(  like in
unix we r moving to cpan prompt and typing "install DB_File" ) How to do this
for windows.
Please Help

Thanks and regars
S Saravanan


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

Date: Wed, 18 Oct 2000 23:28:25 -0700
From: "Michael Cook" <mikecook@cigarpool.com>
Subject: Re: Last try - does nobody know this stuff?
Message-Id: <lywH5.1202$wM1.467444@news.uswest.net>

Hi!
    Thanks for the reply! So, if I read your reply correctly, I should flush
once per file handle instead of once per script?
        Thanks,
            Michael
--
== CigarPool ==
http://www.cigarpool.com

"Peter McMorran" <mcmorran@visi.net> wrote in message
news:39ee4389$3$zpzbeena$mr2ice@news.visi.net...
> In <l_wG5.1981$lb5.529183@news.uswest.net>, on 10/15/00
>    at 11:11 PM, "Michael Cook" <mikecook@cigarpool.com> said:
>
> >    Thanks for the reply!
> >    I set the flush in CGI (as I understand it) so that there is
> >output immediately following the headers so that the brower
> >won't time out waiting for a response while the script waits for
> >a lock or does it's work on files (or whatever it does). That is
> >what made me think that I only need to flush on the first open,
> >but I am unsure - maybe waiting for a file lock later in the CGI
> >script would take long enough to cause this timeout also, and
> >this would prevent it (but maybe it only needs a response after
> >the header, which is only given once).
> >    I got this from a script by Tom which is used to write a
> >counter - but only 1 file was opened in that script. To tell the
> >truth, I am only doing it because I want to "do it right" - the
> >scripts worked just fine with no flush, and they work with a
> >flush on every open.
> >    Slippery stuff without much documentation - if I can get
> >firm answers, maybe I will write a nice summary on file locking
> >& submit it to perl.com & post it here.
> >        Michael
>
> Michael,
>
> What you are setting is the autoflush for the file handle, not
> just flushing the file once. Every time data is written to that
> handle, it will be sent, even though it is not a complete disk
> buffer. So, there is no need to repeat setting autoflush for the
> same handle. As you say, there is some timeout issue for the web
> server, based on rules defined by the server configuration. If it
> requires that data continue to arrive at regular intervals, then
> you might be tripped by a lock that took a long time to acquire.
> But there's nothing more you can do with autoflush to prevent
> this.
>
> If there is a problem, you may need to structure your design to
> avoid it, possibly by using a single lock as a semaphore for
> updating all the files the program requires. Of course, this
> requires that all writers play by the same rules. Or you might
> fork another process to update the other file, so it wouldn't tie
> up writing of the CGI output.
>
> Maybe folks in CGI newsgroups would have some more specific
> experience.
>
>
> >"James Taylor" <james@NOSPAM.demon.co.uk> wrote in message
> >news:ant1604266d2fNdQ@oakseed.demon.co.uk...
> >> In article <bbvG5.1934$lb5.466096@news.uswest.net>, Michael Cook
> >> <URL:mailto:mikecook@cigarpool.com> wrote:
> >> > Thanks James! Should I flush for each different file opened in a
script?
> >>
> >> It is my understanding that files are flushed when closed anyway.
> >> I cannot see any reason to set autoflush on a file handle unless
> >> it needs to be immediate or interactive in some way. If you tell
> >> us what kind of application you're writing and why you think you
> >> need to flush output, then I or someone else may be able to comment.
> >>
> >> I tend to set autoflush at the top of scripts that prompt for user
> >> input, otherwise the prompt does not appear when it should. I also
> >> tend to set autoflush within CGI scripts but if I'm completely
> >> honest I don't really know why this should be necessary - I've just
> >> seen it done in the books. This of course is very "cargo-cultish"
> >> of me and I really ought to find out exatly when and why it is
> >> needed within CGI scripts. Perhaps someone here will enlighten us.
> >>
> >> > This script does work very well - I just want to do it right.
> >> > Ought I post a complete script for you to see? I got this file
> >> > locking code from language.perl.com (Tom Christiansen wrote it).
> >>
> >> Pah! If Tom Christiansen wrote it, then who am I to critique it?
> >> I'm nobody. I wouldn't even *dream* of questioning it.
> >>
> >> --
> >> James Taylor <james (at) oakseed demon co uk>
> >> PGP key available ID: 3FBE1BF9
> >> Fingerprint: F19D803624ED6FE8 370045159F66FD02
> >>
>
>
>
> Cheers,
> Peter
>
> --
> -----------------------------------------------------------
> mcmorran@visi.net (Peter McMorran)
> -----------------------------------------------------------
>




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

Date: Thu, 19 Oct 2000 07:19:38 GMT
From: pjlees@ics.forthcomingevents.gr (Philip Lees)
Subject: Re: Make this regex neater, anyone?
Message-Id: <39ee9fa4.64518632@news.grnet.gr>

On Wed, 18 Oct 2000 18:31:32 -0000, cberry@cinenet.net (Craig Berry)
wrote:

>Philip Lees (pjlees@ics.forthcomingevents.gr) wrote:
>: >  $lastNonDigits = ($str =~ m/\D+/g)[-1];
>: 
>: Thanks, Craig. That's neat. Could you explain the significance of the
>: [-1] to this learner? I can't find any mention of that syntax in
>: perlre.
>
>That's because it doesn't have anything to do with regexes. :)  First,
>consider that a /g match in list context (like the one in my code above)
>produces a list of all matches.  In this case, this will be a list of all
>the sequences of non-digits which appear in $str.
>
>This list can be indexed into like any other list.  Perl provides an
>incredibly handy bit of semantics which interprets negative array indices
>as being offsets from the *end* of the list, so $a[-1] is the last
>element in @a, $a[-5] is the fifth-from-the-last element, and so forth.
>So the [-1] index above indexes the last matched string of non-digits --
>which is what you wanted.

Thanks again. So the list indexing behaves in a cyclic way - that _is_
handy. This list context business is something I've read about in the
Perl docs and various tutorials, but it's new to me and doesn't spring
automatically to mind. I must rectify that.

Phil
--
Philip Lees
ICS-FORTH, Heraklion, Crete, Greece
Ignore coming events if you wish to send me e-mail
'The aim of high technology should be to simplify, not complicate' - Hans Christian von Baeyer


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

Date: Thu, 19 Oct 2000 09:52:16 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Make this regex neater, anyone?
Message-Id: <irgtussq6ind437vu2l462442m9au93gk8@4ax.com>

Philip Lees wrote:

>>This list can be indexed into like any other list.  Perl provides an
>>incredibly handy bit of semantics which interprets negative array indices
>>as being offsets from the *end* of the list, so $a[-1] is the last
>>element in @a, $a[-5] is the fifth-from-the-last element, and so forth.
>>So the [-1] index above indexes the last matched string of non-digits --
>>which is what you wanted.
>
>Thanks again. So the list indexing behaves in a cyclic way - that _is_
>handy. 

Actually, not for 100%. For example,

	@a[2 .. -2]

in order to get every element but the first and the last, DOES NOT WORK.
Your numerical range must be of the same sign:

	@a[2..5]
	@a[-5 .. -2]

although this works too (not very useful, IMO):

	@a[-2 .. 2]

In short: it's the list that interprets the meaning of -1 as pointing to
the last element. But it's value still is -1.

-- 
	Bart.


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

Date: Wed, 18 Oct 2000 22:50:11 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: manipulating data files
Message-Id: <39EE8B93.6D3FDFC6@stomp.stomp.tokyo>

Randy Harris wrote:
 
> Godzilla! wrote clean efficient code:
> > triggerfish2001 aka Rick Delaney aka Randy Harris wrote:


> > foreach $line (@Array)
> >  {
> >   $birth = substr ($line, -10, 10, "¦${\substr ($line, -10, 10)}");
> >   $ssn = substr ($line, -23, 12, "¦${\substr ($line, -23, 12)}");
> >   print "$line\n";
> >  }
 
> Why assign the variables if you are not going to use them?

Why does perl core have pre-assigned variables we
rarely use? Well? In compliance with your illogic,
those pre-assigned variables within perl core should
be removed. Is this not true per your thinking?

My reason for using this method is seriously simple.
I am a programmer, not a Perl 5 Cargo Cultist. I write
programs for speed and efficiency. You boys write little
code snippets with high hopes of winning a weenie wagging
contest, at least once. You boys sit around thumping your
chests and struting your insufficient stuff, proclaiming
yourself the biggest baddest winner weener and king of 
mule manure mountain. I only see little boys playing
with poo-poo.

I am a programmer. You boys are not. Naturally my methods
unsettle you. None of you are programmers and, inherently,
don't have a clue what it means to actually be a programmer.

 
> My hunch is that substr would probably be more efficient, given the
> fixed format of the input data, but it sure isn't as pretty as the
> split/join method used in the earlier post.

Oh, you mean this earlier post made by you under
another of your myriad fake names in response to
the originating article of this thread, also posted
by you under yet another fake name.

Quite humorous, at times, reading you posting articles,
answering yourself, complimenting yourself, arguing
with yourself, humorous at times, yes. Quite annoying
though an equal amount of times. Sometimes I wonder, if
you shouldn't get a life, a real life. This cyber-life
which has absorbed you and your very being, this fantasy
you live, is rather unhealthy.


Godzilla!


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

Date: Thu, 19 Oct 2000 18:08:06 +1000
From: Dave O'Brien <david.obrien@ssmb.com.au>
Subject: Re: manipulating data files
Message-Id: <39EEABE6.AE6328F8@ssmb.com.au>


> I am a programmer. You boys are not. Naturally my methods
> unsettle you. None of you are programmers and, inherently,
> don't have a clue what it means to actually be a programmer.
> 

<tirade>

Where do you get time to do any programming?  All you seem to do is
bitch and talk about how cool you are.  How many hours a day are you on
this newsgroup?  The way you talk makes me think you are a guy,
considering you are constantly is pissing contests with everyone here. 
I don't care that you might or might not be a good perl coder.  The fact
is that you are a sociopath who knows no other joy, than abusing
people.  Here, you don't have to suffer any consequences.  Just grow
up.  I know you are just trying to have fun, and the net is free, but
you make this group an unpleasant place to be (not to mention that
wanker Uri).

Go on Ricki Lake and sort yourself out.
</tirade>


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

Date: Thu, 19 Oct 2000 01:14:24 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: manipulating data files
Message-Id: <39EEAD60.4DE1A916@stomp.stomp.tokyo>

Dave O'Brien pitched a temper tantrum:
 
> Godzilla! administered another dose of reality:

> > I am a programmer. You boys are not. Naturally my methods
> > unsettle you. None of you are programmers and, inherently,
> > don't have a clue what it means to actually be a programmer.


> <tirade>

> Where do you get time to do any programming?  All you seem to do is
> bitch and talk about how cool you are.  How many hours a day are you on
> this newsgroup?  The way you talk makes me think you are a guy,
> considering you are constantly is pissing contests with everyone here.
> I don't care that you might or might not be a good perl coder.  The fact
> is that you are a sociopath who knows no other joy, than abusing
> people.  Here, you don't have to suffer any consequences.  Just grow
> up.  I know you are just trying to have fun, and the net is free, but
> you make this group an unpleasant place to be (not to mention that
> wanker Uri).
 
> Go on Ricki Lake and sort yourself out.

> </tirade>



* holds up a judge's scorecard *


     _______
    |       |
    |  2.5  |
    |_______|



Godzilla!
--
Are you ready for Roberta The Remarkable Robot?


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

Date: Thu, 19 Oct 2000 11:57:04 +0200
From: Alain BARBET <alian@alianwebserver.com>
Subject: Memory usage : how know ?
Message-Id: <39EEC570.279A4023@alianwebserver.com>

Hi,

I've trouble with a script that take too ram and get down server. How
can I see with a module or a unix command, how exactly take my program
in RAM at one moment ?

Thanks,
--
Alain & Estelle BARBET
http://www.alianwebserver.com


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

Date: Thu, 19 Oct 2000 15:23:09 +0800
From: Fraser <r.fraser@student.murdoch.edu.au>
To: clay@panix.com
Subject: Re: Passwd Help??
Message-Id: <39EEA15D.343DADCE@student.murdoch.edu.au>

To Clay
Thanks for the help, much appreciated!
Fraser

Clay Irving wrote:

> On Tue, 17 Oct 2000 13:27:52 +0800, Fraser <r.fraser@student.murdoch.edu.au>
> ponders:
>
> >In Perl, how do you use system information such as "passwd" and
> >"getpwnam" and print the info to the screen (stdout)?
>
> Start with the documentation provided with the Perl distribution:
>
>    perldoc -f getpwnam
>
> result:
>
> [...]
>
>                In scalar context, you get the name, unless the
>                function was a lookup by name, in which case you
>                get the other thing, whatever it is.  (If the
>                entry doesn't exist you get the undefined value.)
>                For example:
>
>                    $uid   = getpwnam($name);
> [...]
>
> Write a test program:
>
>   #!/usr/local/bin/perl5.6.0
>
>   $uid = getpwnam("clay");
>
>   print "$uid\n";
>
> result:
>
>   619
>
> --
> Clay Irving <clay@panix.com>
> I wrote a few children's books...not on purpose.
> - Steven Wright



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

Date: Wed, 18 Oct 2000 09:51:09 -0400
From: Drew Simonis <dsimonis@fiderus.com>
Subject: Re: Perl + Sessions
Message-Id: <39EDAACD.EA9EC308@fiderus.com>

mack_2@my-deja.com wrote:
> 
> i've tried to find some docs about session with perl, but i didn't find
> any information.

Because there is none to be found.

> 
> so, does somebody know, whether perl support sessions, like php and asp
> this do
> 

No, but they are easy to create.  Ask how in

comp.infosystems.www.authoring.cgi


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

Date: 19 Oct 2000 08:49:17 +0100
From: nobull@mail.com
Subject: Re: Perl not functioning in practice as it should in theory.  - test.pl (0/1)
Message-Id: <u93dhtxlix.fsf@wcl-l.bham.ac.uk>

</michael> writes:

> On 18 Oct 2000 18:20:32 +0100, nobull@mail.com wrote:
> 
> >Why are you re-inventing File::Find?
> 
> I'm not trying to re-invent File::Find.

Really?

>   I'm trying to batch process contents of directories recursively.

That's what File::Find does.

> I'm sorry I new to perl.  I've tested this extensively & can not
> figure out the problem that's why I'm looking for help here. 

No testing that doesn't include the startard first steps to debugging
Perl can be considered extensive.

First steps are:

 Make sure you code complies under strict and without warnings (but
 with warnings enabled!).

 Check return values from system functions like opendir() and if they
 fail die with a message containing the value of $!.

> >Forgetting to my() your variables will cause trouble for you sooner or
> >later.  In the case of recursive programs it is thankfully sooner
> >rather than later.
> 
> Please enunciate or give an example. 

This was a red herring.  Failure to make appropriate use of my() will
burn you one day but actually in this case it was not your problem.  I
saw the word "recursive", and the missing my()s and jumped to
conclusions without noticing that your algorithm wasn't actually
recursive.

Sorry.

> Do you mean adding or removing my()?

Adding.

It is good pratice, in all programming languages, localise all
temporary variables to the smallest enclosing scope to where they are
used unless there is a compelling reason not to.  In Perl the function
used to localise is my(), there's also a local() that does something
superficially similar but actually rather different - for details
RTFM.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Thu, 19 Oct 2000 05:23:53 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Perl vs C on server side
Message-Id: <x7wvf5qu8m.fsf@home.sysarch.com>

>>>>> "CB" == Craig Berry <cberry@cinenet.net> writes:

  CB> Uri Guttman (uri@sysarch.com) wrote:
  CB> [re 'Why are server daemons written in C rather than Perl?']

  CB> : because that is one area where speed makes a difference. the faster and
  CB> : more efficient a server is, the more clients and requests it can handle.
  CB> : and that speed also lowers the cost of the needed hardware.

  CB> ...which of course is also true of any Perl apps invoked by these daemons.
  CB> It's all a question of tradeoffs.

true. and the other way around is also true. you can have a perl server
controlling a c process. then the server is simple and flexible and the
process can be fast with no server hooks to complicate things. if
designed right this can be fairly fast and flexible.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: 18 Oct 2000 23:53:44 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Programmer needed
Message-Id: <8sluoo$9de$1@provolone.cs.utexas.edu>

In article <8sla52$n7t$1@nnrp1.deja.com>,  <freestyler1@my-deja.com> wrote:
>What I need is basically a ftp search script.
  :
  :
>This file library is searchable throughout the site. It should be
>updated every few hours. If an ftp doesn't respond, the file library
>would be put into a temporary folder that keeps getting checked also.

You mean, "if an ftp server doesn't respond, this fact is recorded in a
database".  Trust me -- you really want to use a database if you want
this to be easy to write, easy to manage, and fast.

  - Logan


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

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


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