[12156] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5756 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 23 07:07:32 1999

Date: Sun, 23 May 99 04:00:16 -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           Sun, 23 May 1999     Volume: 8 Number: 5756

Today's topics:
    Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Pe finsol@ts.co.nz
    Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Pe <uri@sysarch.com>
        Nested loop <nfy339g@tninet.se>
    Re: Nested loop (Fuzzy Warm Moogles)
    Re: Perl "constructors" (Kai Henningsen)
    Re: Perl "constructors" (Kai Henningsen)
    Re: Perl "constructors" (Kai Henningsen)
    Re: Perl "constructors" (Kai Henningsen)
    Re: Perl on Win32 - How can I hide the process? <walton@frontiernet.net>
        problem with attachments smnayeem@my-dejanews.com
        Question. <tonychen@princeton.edu>
    Re: Question. (Sam Holden)
        sorting ? tvn007@my-dejanews.com
    Re: sorting ? (Michel Dalle)
    Re: Sys::Syslog doesn't work in Perl5.005_03 :-( (Arjun Ray)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Sun, 23 May 1999 04:34:13 GMT
From: finsol@ts.co.nz
Subject: Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Perl Y2K compliant?
Message-Id: <7i80g6$kao$1@nnrp1.deja.com>

In article <374745c3@cs.colorado.edu>,
  tchrist@mox.perl.com (Tom Christiansen) wrote:
>      [courtesy cc of this posting mailed to cited author]
>
> Cursed by that miserable piece of crap, Mozilla/4.05 [en] (Win95; I),
> finsol@ts.co.nz writes in comp.lang.perl.misc:
>
> In comp.lang.perl.misc, finsol@ts.co.nz writes:
> :
> :>     Perl is just as Y2K compliant as your pencil--no more, and no
> :less.  [YOUR NEWSREADER MISWRAPPED THIS.  STOP IT!]
> :>     Can you use your pencil to write a non-Y2K-compliant memo? Of
> :>     course you can. Is that the pencil's fault? Of course it isn't.
> :
> :Unfortunately, many of the Y2K problems in Perl applications *is* the
> :fault of the language.
>
> Oh great -- I've got deja lu, and get to read about Fear and Ugliness
and
> Deception for the second time.  Either your newsreader, your
newsserver,
> or your wetware is broken.  Or some combination of these.
>
> You appear to have accidentally re-posted the same article more than
once.
> If this was intentional, I don't know why you did that.  If it wasn't
> intentional, this was probably because of a bug in the news posting
> software.  Web browsers masquerading as lame excuses for real
newsreaders
> are notoriously bad in the area.  Netscape 2.0 had claimed to have
fixed
> it, but folks continued to see problems from it, and further fixes
were
> applied for the 3.0 version.  If you used Netscape to post this
article
> and it was version 3.0 or later, I suggest you report the bug to them.
> Otherwise, I would try to get that version.  While using an "internet
> browser" as though it were a newsreader is a lose-lose siutation,
Netscape
> has done far more right than any other browser, especially lately.
>
> In the best of all possible worlds, I would urge you to contact the
> author or vendor of the software you used to post your message and
> explain to them that they're sending out duplicate messages.  If I
knew
> their email address, I would even do it myself.  I surely hope you
paid
> no money for this thing.
>
> You may well wish to cancel your spurious extra posting(s).  If you
> don't know how to do this, you shouldn't be using Usenet at all.
>
> --tom

Tom
I don't know why deja news decided to post twice but I must have you
riled - you come across like a techno-crazed twit!  Are you so besotted
with Perl that you will clutch at any straw to defend it - even by
attempting to descredit me by attacking my choice in newsgroup
technology? Come on, Perl is just another programming language - time
you got in touch with the real world.
Jocelyn Amon
--
Financial Solutions Limited
http://www.ts.co.nz/~finsol/


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


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

Date: 23 May 1999 01:13:45 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Perl Y2K compliant?
Message-Id: <x77lq074hi.fsf@home.sysarch.com>

>>>>> "IZ" == Ilya Zakharevich <ilya@math.ohio-state.edu> writes:

  IZ> [A complimentary Cc of this posting was sent to Uri Guttman 
  IZ> <uri@sysarch.com>],
  IZ> who wrote in article <x7btfc7j4j.fsf@home.sysarch.com>:
  f> Unfortunately, many of the Y2K problems in Perl applications *is* the
  f> fault of the language.
  >> 
  >> perl has nothing to do with it. it is defined by the struct tm in the
  >> libc library. perl just follows that convention.

  IZ> Perl decided to follow a stupid convention, thus Perl has everything
  IZ> to do with the fact that the year-return of Perl's localtime has a
  IZ> brain-dead semantic.

but it is a known convention which is not y2k buggy. rtfm is still
important whenever you use any library call. localtime is a fairly
complex call regarding the return data. assuming year means what you
would like is stupid. is sunday 0 or 1, is the minth number 1 or 0
based. those are the same as the year being offset by 1900.

  >> there is no booby trap, only booby programmers.

  IZ> Get real!  Suppose that localtime() were called s6s5a45fa54f(), and
  IZ> dump() was called s6s5e45fa54f().  Would not you call such a language
  IZ> booby-trapped?

no, only something a language mother could love. :-)

and perl has local which is as bad a name as yours!

  IZ> I did not read the "critique" you are refering to, but a fact is a
  IZ> fact: there is no legal usage of $y = (localtime)[5] except as

  IZ>       $y % 100;

  IZ> and

  IZ>       1900 + $y;

and $y is perfectly fine if you want a value offset by 1900. it could be
modified later as long as that is known.

  IZ> Having localtime() return 1900 + $y would save *a lot* of frustration,
  IZ> since it is much harder to get *false expectations* how one can use
  IZ> $y.  Quoting Larry, "that's linguistic" in designing programming
  IZ> languages.

so write your own module and overload localtime. be our guest. i write
subs to read/write a file for me. if i write a sub to handle a call to
localtime i woul ddo what is needed. if i did it a lot i would make a
module. that is what an api is, it is. nothing more, nothing less. if it
has the functionalilty you want but not the interface, then you write
your own interface. what do you think x widgets and perl/tk is? just a
better api over a fixed and obscure and dificult api.

  IZ> Humans *are* fallible, and one tells good programming languages from
  IZ> bad programming (or scripting) languages by how much attention they
  IZ> pay to the fact that programmers are humans.  Some sides of Perl are
  IZ> quite good in this regard.  Some other sides of Perl are abyssmal in
  IZ> this regard.  Deciding on which side (localtime)[5] is left as an
  IZ> exersize to the reader.

not at all. it is well defined and fully functional which is all i want
at a minimum from an api. when you don't have either (like winblows)
then things realy suck. writing a better interface for an existing api
is trivial and not as critical except when it save lots of work like the
widget ones i mentioned. and i am not just refering to layering like
widgets do over x. a proper layered api over localtime would handle the $y at
such a low level it would never matter what localtime returned. the fact
that we call localtime directly and not a module means that api/layer is
not desired by the perl community. if it were then all would be told not
to call localtime but some module. for example i never use socket
directly. i use IO::Socket since it does the connect and ip address
munging in a value added api. i have done that myself in c and i still
use those routines since i use my connect all the time and the low level
socket work is a minor pain. localtime is not as painful.

hope this clears up the api confusion for you. api's EXIST as they
are. you can always write one above it it you don't like it. you just
don't change the lower one from its specification. that is the rule.

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: Sun, 23 May 1999 07:38:22 +0200
From: "danfan" <nfy339g@tninet.se>
Subject: Nested loop
Message-Id: <7i844n$m6t$1@cubacola.tninet.se>

I have failed to write a nested while-loop
using perl 5.01 from NT reskit.
Is it a bug or do i miss something?
/DG
---------------------------------------------------------------------
This code:
#!/usr/local/bin/perl
$i = 0;
$x = 0;
while ( $i < 10 )
{
  $i += 1;
  while ( $x < 10 )
  {
    $x +=1;
    print "$i $x \n" ;
  }
}
generates:
1 1
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10





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

Date: Sun, 23 May 1999 06:10:02 GMT
From: tgy@chocobo.org (Fuzzy Warm Moogles)
Subject: Re: Nested loop
Message-Id: <37479b48.260955750@news.oz.net>

On Sun, 23 May 1999 07:38:22 +0200, "danfan" <nfy339g@tninet.se> wrote:

>I have failed to write a nested while-loop
>using perl 5.01 from NT reskit.
>Is it a bug or do i miss something?
>/DG
>---------------------------------------------------------------------
>This code:
>#!/usr/local/bin/perl
>$i = 0;
>$x = 0;
>while ( $i < 10 )
>{
>  $i += 1;

  $x = 0;  # Reset each time through.

>  while ( $x < 10 )
>  {
>    $x +=1;
>    print "$i $x \n" ;
>  }
>}


-- 
Fuzzy | tgy@chocobo.org | Will hack Perl for a moogle stuffy! =^.^=


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

Date: 23 May 1999 11:18:00 +0200
From: kaih=7HPvvhDXw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: Perl "constructors"
Message-Id: <7HPvvhDXw-B@khms.westfalen.de>

emschwar@rmi.net (Eric The Read)  wrote on 21.05.99 in <xkfvhdmgjy4.fsf@valdemar.col.hp.com>:

> And there's *still* no way to automatically die on an uncaught exception.

Huh? I must not be getting something here. How do you not die on an  
uncaught die()? Seems a contradiction to me.

Kai
-- 
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
  - Russ Allbery (rra@stanford.edu)


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

Date: 23 May 1999 11:23:00 +0200
From: kaih=7HPvvm5mw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: Perl "constructors"
Message-Id: <7HPvvm5mw-B@khms.westfalen.de>

pacman@defiant.cqc.com (Alan Curry)  wrote on 22.05.99 in <eYn13.3304$Ie1.100992@news14.ispnews.com>:

> In article <7HNxq-11w-B@khms.westfalen.de>,
> Kai Henningsen <kaih=7HNxq-11w-B@khms.westfalen.de> wrote:
> >> Why then do you tolerate a language that dies whenever a brk() fails with
> >> ENOMEM?
> >
> >Because, in *all* cases I have seen where brk() failed, that was the only
> >sensible action available. If a program already uses about 90% of my
> >RAM+swap, retrying isn't going to help.
> >
> >>These are all _temporary_ failures,
> >
> >Actally, 99% of the time, they are fatal failures, not temporary at all.
>
> On a machine where your perl script is the only thing running, maybe. But on
> real computers, there are other processes running. When one gets an ENOMEM,
> the others are likely to get ENOMEMs of their own pretty soon. If they are C
> programs written by a competent progammer, then each process will make its
> own decision what to do about the failure. Lots of things can and should
> exit when memory is low. By doing so, they make room for the more important
> processes, which can then retry and succeed, and continue doing what they're
> supposed to do.

Exactly. And none of the "more important" processes (init, cron, inetd, X)
are usually Perl scripts.

> If the important processes are written in perl, they die and the sysadmin
> must be woken up to come in and clean up the mess. This is the bad thing
> about perl. It increases the "annoy-the-sysadmin" ratio by voluntarily
> killing itself because of temporary error.

It doesn't really, because there are precious few Perl processes the
killing of which is catastrophic. I actually suspect the 99% I quoted
should be nearer 99.999%.

On the machines I know about, it's 100.0%.

Every language has some things it's not suitable for. What I'm saying here  
is that few people would care if, for Perl, that included "long-running  
demons that MUST NOT, ever, die".

Kai
-- 
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
  - Russ Allbery (rra@stanford.edu)


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

Date: 23 May 1999 11:41:00 +0200
From: kaih=7HPvwEEXw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: Perl "constructors"
Message-Id: <7HPvwEEXw-B@khms.westfalen.de>

armchair@my-dejanews.com  wrote on 19.05.99 in <7ht6uv$64l$1@nnrp1.deja.com>:

> In article <7hrn8j$5q6$1@nnrp1.deja.com>,
>   John Porter <jdporter@min.net> wrote:
>
> >
> > The NON-difference is that they are both pointers.  Pointers hold
> > one thing: an address.  So let's hope your original complaint
> > that "objects can hold only one thing" has been laid to rest.
>
> Both you and Russ Allberry misunderstood my complaint to thing that I
> didn't know a hash or array could hold references to other hashes and
> arrays. My complaint was that I had a hierchary of data that starts out
> at one variable at the highest level. In C++ I can have more than one
> variable at the highest level. But as what stated before: it's not a
> brick wall.

It's also completely false, as has been pointed out numerous times.

There is *one* thing that C++ has that Perl doesn't. In C++, you can have  
static objects - objects that don't reside on the heap.

Few other object oriented languages have this, because those types of  
objects are severely crippled with respect to inheritance. And there's  
nothing you can do with them, that you can't do with heap-allocated  
objects. It's purely a speed optimization feature.

And Perl doesn't have traditional flat-stack-allocated variables anyway,  
because in Perl, even stack-allocated variables only go away when nobody  
is referencing them anymore, not when the stack frame is destroyed.

Oh, and back in K&R C, a struct *was* pretty much a pointer to its  
beginning, the same it's still today with arrays. *That* is a silly idea  
Perl did not copy, thankfully.

*All* "normal" objects in C++ (those you get from new) are accessed with a  
pointer.

*All* objects in Perl are accessed with a (blessed) reference.

Kai
-- 
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
  - Russ Allbery (rra@stanford.edu)


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

Date: 23 May 1999 12:12:00 +0200
From: kaih=7HPvwTKHw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: Perl "constructors"
Message-Id: <7HPvwTKHw-B@khms.westfalen.de>

jdporter@min.net (John Porter)  wrote on 17.05.99 in <7hp3nc$cdb$1@nnrp1.deja.com>:

> But you need to let Perl be itself, not try to shoe-horn it into
> some preconceived notions about what a language should be.

Perl might be good as a first language. It's certainly good as a tenth  
language.

But it seems it's terrible as a *second* language.

Then again, that's probably true of any language.

Kai
-- 
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
  - Russ Allbery (rra@stanford.edu)


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

Date: Sun, 23 May 1999 00:33:42 -0400
From: Bob Walton <walton@frontiernet.net>
To: Thomas/Shurflo <thomas@shurflo.com>
Subject: Re: Perl on Win32 - How can I hide the process?
Message-Id: <37478526.F1C0A692@frontiernet.net>

If you put:

use Tk;

at the start of your perl program (and, of course, you have the Tk package
installed), the console window will be minimized shortly after execution
starts.  You don't have to use anything else from Tk.  The user can click
on the window in the task bar and bring it back up, so it isn't totally
"hidden".  There is undoubtedly some other way of doing this which isn't
quite so ugly.  Maybe you can figure out how Tk does it.

Thomas/Shurflo wrote:

> Anyone know how I can hide the process (dos box) that starts when I run
> a Perl script? It could take a while to run and I don't want users
> seeing it.
>
> I've been through the manuals and the newsgroups.



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

Date: Sun, 23 May 1999 10:43:13 GMT
From: smnayeem@my-dejanews.com
Subject: problem with attachments
Message-Id: <7i8m41$254$1@nnrp1.deja.com>

When i send an attachment with contenttype as text/html and
contentdisposition as inline it makes a nice attachment for me allright,
but it makes an additional attachment for no reason. Anyone knows where
this extra attachment comes from ?
heres my code :

use Net::SMTP;
$sender = 'smnayeem@agni.com';
$server = 'mail.agni.com';
$address = 'smnayeem@agni.com'; #change this line to your email address.
$timestamp = '1'; #well dont bother about this one :)
$title = 'test';
$html = 'hello';

    $attachmentname = "qb".$timestamp.".html";
    $content_type = "text/html; charset=us-ascii";

    $smtp = Net::SMTP->new($server); # connect to an SMTP server
    $smtp->mail($sender);     # use the sender's address here
    $smtp->to($address);        # recipient's address
    $smtp->data();                      # Start the mail
    # Send the header.
    $smtp->datasend("Reply-to : $sender\n");
    $smtp->datasend("Subject : qb: $title\n");
    $smtp->datasend("MIME-Version : 1.0\n");
    $smtp->datasend(
      "Content-Type : multipart/mixed; "
      ."boundary=\"======================_888227034==_\"\n\n");
    $smtp->datasend("This is a multi-part message in MIME format.\n");
    $smtp->datasend("--======================_888227034==_\n");
    $smtp->datasend("Content-Type : text/plain; charset=us-ascii");
    $smtp->datasend("\n\n");
    $smtp->datasend("Your requested Page \"\$title\"\n\n\n\n");
    $smtp->datasend("--======================_888227034==_\n");
    $smtp->datasend("Content-Type : $content_type\n");
    $smtp->datasend("Content-Disposition: inline;".
      "filename=\"$attachmentname\"\n\n");

    $smtp->datasend("<html><head><title>$title</title></head>");
    $smtp->datasend("$html");
    $smtp->datasend("</html>");
    $smtp->datasend("\n\n\n");
    $smtp->datasend("--======================_888227034==_");

    $smtp->dataend();                   # Finish sending the mail
    $smtp->quit;                        # Close the SMTP connection
exit(0);

if anyone can let me know what causes the extra attachment to show up,
(well when i view it with the email client that comes with netscape i
get an extra attachment called Part 1.3 of type Text/plain with nothing
in it.) and finds a cure for it i would be grateful. thanks in advance.
smnayeem
smnayeem@agni.com


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


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

Date: Sun, 23 May 1999 00:41:29 -0400
From: "T.Chen" <tonychen@princeton.edu>
Subject: Question.
Message-Id: <7i80ph$pgb$1@cnn.Princeton.EDU>

I am still learning the basics of perl and I apologize if this question has
been asked already.  I need my script to execute a unique program from the
unix prompt with certain variables.  I am aware that system commands can be
done, but can other programs be executed?  If so, how?






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

Date: 23 May 1999 07:08:38 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Question.
Message-Id: <slrn7kfabm.av2.sholden@pgrad.cs.usyd.edu.au>

On Sun, 23 May 1999 00:41:29 -0400, T.Chen <tonychen@princeton.edu> wrote:
>I am still learning the basics of perl and I apologize if this question has
>been asked already.  I need my script to execute a unique program from the
>unix prompt with certain variables.  I am aware that system commands can be
>done, but can other programs be executed?  If so, how?

You could try reading the documentation that comes with perl.

The documentation on the builtin functions would probably be the most useful.


-- 
Sam

I explicitly give people the freedom not to use Perl, just as God gives
people the freedom to go to the devil if they so choose.
	--Larry Wall


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

Date: Sun, 23 May 1999 08:01:08 GMT
From: tvn007@my-dejanews.com
Subject: sorting ?
Message-Id: <7i8ck4$sl8$1@nnrp1.deja.com>

Hi,

Would someone help me or give me some hint how to solve this problem ?

Below is the problem:

I have a file as follow (just small sample for demo. ):

FILE: abc
CODE xcc     sds  H
CODE xcdaa   sds  L
FILE: xyc
CODE uics    sds  H
CODE xcd     sds  X
CODE xcoi    sds  L
FILE  fyx
CODE  xcc    sds  H

I would like to output sorted as follow:
(since FILE fyx has only one line of CODE I would line to put it first)
(since FILE abc has two line of CODE I would like to put second )
(since FILE xyc has three line of CODE I would like to put it third)

FILE  fyx
CODE  xcc    sds  H
FILE: abc
CODE xcc     sds  H
CODE xcdaa   sds  L
FILE: xyc
CODE uics    sds  H
CODE xcd     sds  X
CODE xcoi    sds  L

Thanks in advance for your help,


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


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

Date: Sun, 23 May 1999 09:44:48 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: sorting ?
Message-Id: <7i8ikv$jur$1@xenon.inbe.net>

In article <7i8ck4$sl8$1@nnrp1.deja.com>, tvn007@my-dejanews.com wrote:
>Hi,
>
>Would someone help me or give me some hint how to solve this problem ?
>
>Below is the problem:
>
>I have a file as follow (just small sample for demo. ):
>
>FILE: abc
>CODE xcc     sds  H
>CODE xcdaa   sds  L
>FILE: xyc
>CODE uics    sds  H
>CODE xcd     sds  X
>CODE xcoi    sds  L
>FILE  fyx
>CODE  xcc    sds  H
>
>I would like to output sorted as follow:
>(since FILE fyx has only one line of CODE I would line to put it first)
>(since FILE abc has two line of CODE I would like to put second )
>(since FILE xyc has three line of CODE I would like to put it third)

The following may not be nice Perl, but it works :-)

#!/usr/local/bin/perl
while (<>) {
        chomp;
        if (/^FILE/) {
                $file = $_;
                next;
        }
        push(@{$filecode{$file}}, $_);
}
foreach $file (sort {$#{$filecode{$a}} <=> $#{$filecode{$b}}} keys %filecode) 
{
        print "$file\n";
        print join("\n",@{$filecode{$file}}) . "\n";
}

I'm sure Schwartzian transforms could do the trick too :-)

Michel.

--
aWebVisit - extracts visitor information from WWW logfiles and shows
the top entry, transit, exit and 'hit&run' pages, the links followed
inside your website, the time spent per page, the visit duration etc.
For more details, see http://gallery.uunet.be/Michel.Dalle/awv.html


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

Date: 23 May 1999 01:05:15 -0500
From: aray@nmds.com (Arjun Ray)
Subject: Re: Sys::Syslog doesn't work in Perl5.005_03 :-(
Message-Id: <37e892e4.3126246845@news1.newscene.com>

In <7i60hj$1cu$1@gellyfish.btinternet.com>, 
Jonathan Stowe <gellyfish@gellyfish.com> wrote:
| In comp.lang.perl.misc Ingo Ciechowski <ciechowski@cis-computer.com> wrote:

| > I've got a problem using the Sys::Syslog package on my linux 2.0.36
| > system with Perl Perl5.005_03...

There's also a problem with RedHat 5.x distributions and 5.004_04.
(More on this below.)

| There was a thread recently on this subject and the code that was 
| that to work goes something like this :

(As a general comment on a parallel strand, using UNIX domain sockets
is the correct approach. Blindly launching 'syslogd -r' is *not* a
good idea. The syslogd man page may have details on how this makes
some denial of service attacks possible, the workarounds for which may
be more trouble than the "convenience" of INET sockets are worth.) 
 
| #!/usr/bin/perl -w
| use strict;
| use Sys::Syslog qw(openlog syslog setlogsock closelog);

Unfortunately, setlogsock is not exported by Sys::Syslog, so 

| setlogsock('unix');

Has to be 

: Sys::Syslog::setlogsock('unix') ;

After which, yes, the code works fine.

However, just to get this far, I first had to contend with a compile
time error. Specifically:

: Constant subroutine __need___va_list undefined at 
:  /usr/lib/perl5/i386-linux/5.00404/stdarg.ph line 7.

The perldiag document lists this error and says the usual workaround
is to defeat the inlining somehow. Anyway, the problem line in
stdarg.ph reads:

: 2 unless(defined(&_ANSI_STDARG_H_)) {
: 3     unless(defined(&__need___va_list)) {
: 4         eval 'sub _STDARG_H () {1;}' unless defined(&_STDARG_H);
: 5         eval 'sub _ANSI_STDARG_H_ () {1;}' unless defined(&_ANSI_STDARG_H_);
: 6     }
: 7     undef(&__need___va_list) if defined(&__need___va_list);
: [followed by a whopping if-elsif cascade for various machine types]

As far as I can make out, the &__need___va_list subroutine is defined
towards the end of sys/syslog.ph, required by Sys::Syslog.pm:

: 154 unless(defined(&KERNEL)) {
: 155     if(0) {
: 156         require 'machine/ansi.ph';
: 157     }
: 158     elsif(!defined ( &_BSD_VA_LIST_)) {
: 159         eval 'sub __need___va_list () {1;}' unless defined(&__need___va_list);
: 160         require 'stdarg.ph';
: 161         eval 'sub _BSD_VA_LIST_ () { &__gnuc_va_list;}' unless defined(&_BSD_VA_LIST_);
: 162     }
: 163     require 'sys/cdefs.ph';
: 164 }

and so the whole busness with __need___va_list (as per the *.h files)
seems to be an artefact of the hoops gcc jumps through to do the right
thing with vararg lists on various systems. Since nothing significant
seemed to happen between the definition on line 159 of sys/sylog.ph
and the undef on line 7 of stdarg.ph, it looked like simply commenting
out line 7 in stdarg.ph might "work".

Well, it did. 

But an insightful/knowleadgeable commentary on this would certainly be
appreciated.


:ar


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

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

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