[7424] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1049 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 19 14:27:17 1997

Date: Fri, 19 Sep 97 11:00:26 -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           Fri, 19 Sep 1997     Volume: 8 Number: 1049

Today's topics:
     '0': string or number? you make the call! <danboo@ixl.com>
     Re: Capacity Planning with NT Perl (Gerben Vos)
     Re: Capitalizing the first letter via regex (Matti Kinnunen)
     check if a file is open in any tty <kunal@no-spam.i2.com>
     Re: Confusion with chop/chomp (Steve Lamb)
     Re: Confusion with chop/chomp <rootbeer@teleport.com>
     database <dmoss@instinet.com>
     Re: dbmopen w/ undef problem <rootbeer@teleport.com>
     Re: echo $status (Andrew M. Langmead)
     Re: Hacking the Buddha, #10 <suqstmbl@reading.ac.uk>
     Re: Help with CGI perl scripts <rootbeer@teleport.com>
     Re: Help with CGI perl scripts (brian d foy)
     Re: How to assign new vals to hash elements? <rootbeer@teleport.com>
     Re: How to clear the remark of lang C? (Tad McClellan)
     Re: Linux Perl Bug ? <rootbeer@teleport.com>
     Re: Linux Perl Bug ? <seay@absyss.fr>
     Re: Memory leak? (Jason Gloudon)
     Moving installations across machines <chris@ixlabs.com>
     Re: Moving installations across machines <chris@ixlabs.com>
     No Sys::Syslog (perl5.004, Solaris 2.5.1) (Kyle Barger)
     Re: Perl equivalent to #ifdef in C? <rootbeer@teleport.com>
     Perl to Java Compiler? (Piet Barber)
     Perl w/Enterprise Server 3.0 question <jbrogan@reply.net>
     Shell scripts from Unix to WinNT <zserge@care.lv>
     STDOUT not working properly... i think (Scott DiNitto)
     Re: Uploading files larger than 50k from webpage IMPOSS <rootbeer@teleport.com>
     Re: Uploading files larger than 50k from webpage IMPOSS (Kurt Jaeger)
     Re: What does this error message mean? (Andrew M. Langmead)
     What's the name o' dat mod? <nikhil@backlash.net>
     Re: What's the name o' dat mod? (Steve Lamb)
     Re: What's the name o' dat mod? <rootbeer@teleport.com>
     Re: Where am I missing it <rootbeer@teleport.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 19 Sep 1997 13:41:32 -0400
From: Dan Boorstein <danboo@ixl.com>
Subject: '0': string or number? you make the call!
Message-Id: <3422B94C.B606A76A@ixl.com>


hello all,

first off here is the code and results which confuse me:

danboo> cat test.pl
#!/usr/bin/perl -w

$test0 = '0';
$test00 = '00';

$test0 && print "test0\n";
$test00 && print "test00\n";
danboo> ./test.pl
test00

now, here is what i thought would happen:

$test0 would be assigned a string with the value '0'
$test00 would be assigned a string with the value '00'

$test0 would be defined as a non-empty string and print "test0\n"
$test00 would be defined as a non-empty string and print "test00\n"

as you can see, only "test00\n" was printed. so, is the string '0'
a "failure/false" condition, or is it being evaluated as a numeric?
i tried using the debugger to follow along but had little success.

please help me understand the subtleties here.

thanks,

dan boorstein
dboorstein@ixl.com


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

Date: 19 Sep 1997 15:04:44 GMT
From: gerben@cs.vu.nl (Gerben Vos)
Subject: Re: Capacity Planning with NT Perl
Message-Id: <5vu4ac$8sv$1@star.cs.vu.nl>

Cris Shupp writes:

>I have discovered that Perl  with the help of  NTRegQueryValueEx and
>HKEY_PERFORMANCE_DATA,  HKEY_PERFORMANCE_TEXT, HKEY_PERFORMANCE_NLSTEXT 
>can read the system level counters that keep track of all the data I
>desire and more. ( soon I will want more!)  

>How can I use these features to obtain the information I desire?   All 
>ideas are valuable!.

Are your problems with how exactly to use NTRegQueryValueEx, or with the
locations of the useful information under HKEY_PERFORMANCE_DATA and family?

If the latter, i think you'll get better response to this question on
comp.os.ms-windows.programmer.win32 or thereabouts.

g e r b e n @ c s . v u . n l . . . . . . . . . . . . G e r b e n   V o s   <><
Join the Coalition Against Unsolicited Commercial Email!  http://www.cauce.org/
Ceci n'est pas une .signature .


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

Date: 19 Sep 1997 18:48:56 +0300
From: matti@universe.pc.helsinki.fi (Matti Kinnunen)
Subject: Re: Capitalizing the first letter via regex
Message-Id: <lzn2l9b8yf.fsf@universe.pc.helsinki.fi>

In article  Christopher Zukowski <czukowski@qualcomm.com> writes:


       I am trying to figure out how to capitalize the first character of
   an otherwise all lower case string.

   IE:  random 
   want to be 
	 Random
******
How do I capitalize all the words on one line? 

To make the first letter of each word upper case: $line =~ s/\b(\w)/\U$1/g; 

To make the whole line upper case: $line = uc; 

To force each word to be lower case, 
with the first letter upper case: $line =~ s/(\w+)/\u\L$1/g; 

taken from
ftp://ftp.funet.fi/pub/languages/perl/CPAN/doc/FAQs/FAQ/PerlFAQ.html



- matti - 
-- 
* matti.kinnunen@helsinki.fi *
* http://universe.pc.helsinki.fi/~matti/contact.html *
* +358-(0)40-593 50 91 but try first +358-(0)9-191 23978 *


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

Date: Fri, 19 Sep 1997 11:45:12 -0500
From: Kunal Shah <kunal@no-spam.i2.com>
Subject: check if a file is open in any tty
Message-Id: <3422AC17.8B8669F2@no-spam.i2.com>

I want to verify that nobody has opened a file on any terminal, before I
open
the file for writing.

Is there a switch to do this ?

Please remove no-spam from the address

Thanks



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

Date: 19 Sep 97 14:59:35 GMT
From: morpheus@no-spam.calweb.com (Steve Lamb)
Subject: Re: Confusion with chop/chomp
Message-Id: <slrn6254qp.i3.morpheus@web1.calweb.com>

gbacon@adtran.com in <<5vu0go$d8i$2@info.uah.edu>> wrote:
>IRC channel names are case insensitive, but you don't seem to be taking
>this into account (from the code snippet shown).  Try something like

>    if (lc($dest) eq lc($channel)) {
>        ...;
>    }

   I'll have to keep that in mind.  However, this is under controlled
conditions.  In both cases the channel name is "#bottest".  No quotes, of
course.  

>I'm not sure why chomping or not chomping would affect this (unless you
>have a bizarre value of $/).

    Nope, haven't touched $/ at all.

>    $line =~ s/(?:\r?\n)+$//;

    Another thing to keep in mind.  Again, though, I don't see that as the
problem.  This is because chomp (or chop) work on the innermost loop but do
not work when placed in either of the two outer loops.  The only difference
I can see with the placement I have in the code is that I have a split after
the chomp/chop when it is placed in either of the outside loops.

-- 
             Steve C. Lamb             | Opinions expressed by me are not my
    http://www.calweb.com/~morpheus    | employer's.  They hired me for my
CC: from news not wanted or appreciated| skills and labor, not my opinions!
---------------------------------------+-------------------------------------


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

Date: Fri, 19 Sep 1997 08:47:09 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Steve Lamb <morpheus@no-spam.calweb.com>
Subject: Re: Confusion with chop/chomp
Message-Id: <Pine.GSO.3.96.970919083809.11506V-100000@julie.teleport.com>

On 19 Sep 1997, Steve Lamb wrote:

> The relevant portion of code that is causing me problems is below.  It
> works as it stands but here are the problems I am having.  When
> chomp($remainder) is at #1 or #2 it does not get pas the if($dest eq
> $channel) line. 

When you chomp($remainder) , you're affecting it. When you calculate $dest
from $remainder later, you're going to get a different value for $dest,
won't you? If that makes $dest different than $channel, then that behavior
is what I'd expect.

> I know that it is true because of the print
> before the if statement spews out all the data as it is at tha time.  

Maybe. Can you see the newline that may or may not be chomped off? :-) 

> I even went so far as to isolate the $dest on its own line with a print. 
> It matches $channel. 

Just because they print with the identical appearance, that doesn't mean
that two variables have the same contents. Try this to really see what's
in two strings.

    sub dump_hex {
	print join(" ", map unpack("H*", $_), @_), "\n";
    }
    dump_hex $dest, $channel;

>   ($from, $type, $remainder) = split(/ /,$line,3);

>   #1 chomp($remainder);

Why not just chomp $line in the first place? (Or change the split to drop
newlines as well.) 

Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Fri, 19 Sep 1997 13:19:51 -0400
From: David Mossakowski <dmoss@instinet.com>
Subject: database
Message-Id: <3422B437.696BC07D@instinet.com>

Hail all,

I was looking at modules to connect to a database.  DBI seemed pretty
complete with drivers to Sybase and Oracle but my question is this:  is
there a module of ODBC sorts?  Such that it has a set of standard
queries (select blah from blahblah where and so forth) and is able to
connect to ANY database (sybase, oracle, msaccess)?

Thanks for your help

dave.
--
David Mossakowski
Instinet Corporation
voice: 212-310-7275
pager: 917-772-0211
dmoss@instinet.com

"I don't sit idly by, I'm planning a big surprise"   FUGAZI




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

Date: Fri, 19 Sep 1997 09:05:00 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Paul Bardo <net0018@edwardjones.com>
Subject: Re: dbmopen w/ undef problem
Message-Id: <Pine.GSO.3.96.970919085935.11506Z-100000@julie.teleport.com>

On Fri, 19 Sep 1997, Paul Bardo wrote:

> While I try to do the following command with perl -w,
> 
>    dbmopen (%Prefix, "Prefixes", undef)
>       || die "I cannot open the Prefix database";
> 
> I get the following error messages, although the program runs correctly.
> 
>    Use of uninitialized value at perltest line 7.
>    Use of uninitialized value at perltest line 7.

You seem to be using the feature that, if the mode is undef, the file
won't be created if not found. For some reason, that feature doesn't seem
to be documented in the perlfunc(1) manpage. If I'm not mistaken, that's
two bugs. Could you please run perlbug to report them? Thanks!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Fri, 19 Sep 1997 15:00:53 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: echo $status
Message-Id: <EGrGDI.4zM@world.std.com>

dizzy@soda.CSUA.Berkeley.EDU (David Zeng) writes:

>Uh... dumb me.  Perl runs Bourne Shell, and "echo $status" should be
>"echo $?" in Borune Shell.

>Sorry for the trouble and wasted bandwidth.

You still have the problem that system() and backticks going to start
a new child process, and won't have the $? variable from a previous
child. If you are doing something like:

system "some_program_that_returns_an_exit_status"; # shell out to child
$exit = `echo $?`;                                 # shell again.

Your going to be disapointed.

Remember, perl has its own $? variable to inform you the exit status
of a child process. (See the perlvar man page for details.)
-- 
Andrew Langmead


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

Date: Fri, 19 Sep 1997 18:16:45 +0100
From: John Stumbles <suqstmbl@reading.ac.uk>
Subject: Re: Hacking the Buddha, #10
Message-Id: <Pine.SOL.3.96.970919181425.23581B-100000@suma3.reading.ac.uk>

On Tue, 16 Sep 1997, Sabren wrote:

big --- 8< ---


Help! - I've searched CPAN but can't find this nifty NLP.pm ;-)


--
John Stumbles                                      j.d.stumbles@reading.ac.uk
Computer Services, University of Reading       http://www.rdg.ac.uk/~suqstmbl 
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                        Brain stopped play




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

Date: Fri, 19 Sep 1997 08:16:38 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: "James H. Woest" <woest@elrond.sp.TRW.COM>
Subject: Re: Help with CGI perl scripts
Message-Id: <Pine.GSO.3.96.970919080254.11506R-100000@julie.teleport.com>

On 19 Sep 1997, James H. Woest wrote:

> I am attempting to send HTML form information from a web page
> to a user via a Perl script.  I am entering text into a <textarea>
> box, and then using sendmail to mail the text to a user, but
> I have run into some problems:
> 
>      1.)  When a quotation mark (") is included in the form data,
>           all text after the quotation mark is omitted from the
>           email message.  I assume this happens because the
>           print statement that I use to assemble the mail
>           message sees this quotation mark as the end of
>           the text and stops there.  

That's not the way that Perl works; a quote mark in the data won't
terminate a double-quoted string. (If you're using eval on code generated
from form-submitted data, this could happen. But if you're doing that,
stop stop STOP at once! Truncating a mail message is the least of your
worries.)

Here's what I do when I'm debugging a script which uses sendmail. First, I
have a configuration section or file somewhere which defines the location
of sendmail, something like this.

	# sendmail command on this system.
	$SENDMAIL = '/usr/bin/sendmail -t';

Now, for debugging, I simply change that to '/bin/cat
>>/my/world-writable/error/file'. (Nearly useless use of cat.  :-) Then,
after my code pipes something to $SENDMAIL, I can look in that file and
see just what I (would have) told sendmail to do. 

>      2.)  In the <textarea> tag, I am using the "wrap=physical"
>           attribute to ensure that a carriage-return/line-feed
>           sequence is put at the end of every line.  However,
>           the message still arrives in the mail message as a
>           single line, with no CR/LF's.  I know that the "wrap"
>           tag is a non-standard extension, but is there any way
>           to make this work, or simulate its effects?

If you want the data to look different in the mail message, format it
however you'd like! :-)  You may want the Text::Wrap module from CPAN.

Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Fri, 19 Sep 1997 13:29:36 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Help with CGI perl scripts
Message-Id: <comdog-ya02408000R1909971329360001@news.panix.com>

In article <5vslg4$nkt$1@cronkite.sp.trw.com>, woest@elrond.sp.TRW.COM (James H. Woest) wrote:

>CGI-script newbie questions:

you might also check out the comp.infosystems.www.authoring.cgi
newsgroup.

>I am attempting to send HTML form information from a web page
>to a user via a Perl script.  I am entering text into a <textarea>
>box, and then using sendmail to mail the text to a user, but
>I have run into some problems:

>     1.)  When a quotation mark (") is included in the form data,
>          all text after the quotation mark is omitted from the
>          email message.  

   this sounds like the situation in which un-escaped data are placed
   in VALUE attributes in FORM tags:

      <INPUT ... VALUE="embedded " in the data">

   in which case the passed data are truncated at the first ".  should
   this be the case, look in using the form features of CGI.pm, or the
   URI::Escape functions.

>     2.)  In the <textarea> tag, I am using the "wrap=physical"
>          attribute to ensure that a carriage-return/line-feed
>          sequence is put at the end of every line. 

   you can never be sure the client did anything correctly!  if you
   want to wrap the data, you will need to do it yourself, or at least
   check to make it is wrapped.

   different clients will give different behaviour, so i created a test
   page in which you can try the different <TEXTAREA> incarnations and
   see the Text::Wrap module at work (along with source of course!).
   <URL:http://computerdog.com/Cgi/wrap.html>

   good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Fri, 19 Sep 1997 08:02:03 -0700
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: How to assign new vals to hash elements?
Message-Id: <Pine.GSO.3.96.970919075436.11506Q-100000@julie.teleport.com>

On Fri, 19 Sep 1997, dave wrote:

> I think Perl could use a special hash assignment operator.  Let's
> pretend it would be the ":-)" operator and would be used as follows: 
> 
>   %hashA  :-)  %hashB;
> 
> which would simply assign values in hashA with values for matching
> keys in hashB, without modifying the structure of hashA, so that any
> references to hashA values would still be valid.

Does this do what you wan?

    @hashA{keys %hashA} = @hashB{keys %hashA};

Probably not what you want for a key which exists in %hashA and not in
%hashB, though. Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Fri, 19 Sep 1997 10:48:42 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: How to clear the remark of lang C?
Message-Id: <qs6uv5.ddg.ln@localhost>

Mike Heins (mheins@prairienet.org) wrote:
: CherngJyh Lin (a00lcj00@mail.dt.nchc.gov.tw) wrote:
: : Hi,
: :   Is there more efficient way to clear all the /* ... */ remark
: : in lang C by using perl language?? Thanks!


: Why do you want to clear comments?  Obfuscation?  I am sure
: you wouldn't do that -- there must be a good reason. Perhaps
                                ^^^^^^^^^^^^^^^^^^^^^

Maybe you want to exclude comments when counting lines of code?


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: Fri, 19 Sep 1997 08:32:02 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Brahma Desta <bdesta@qualcomm.com>
Subject: Re: Linux Perl Bug ?
Message-Id: <Pine.GSO.3.96.970919082420.11506T-100000@julie.teleport.com>

On Mon, 15 Sep 1997, Brahma Desta wrote:

> The following piece of code, in Linux Perl 5.004, only
> works if the first two print statements are either
> removed or are of the form print "num1 = ", $num1;
> 
> In the current form, the xor produces a 0 whereas the
> real answer should be 55217.

It sounds as if you and Perl have different ideas about whether your
operands are numbers or strings, since bitwise operations can work on
either. If you want to be sure that Perl thinks that you're using numbers,
use a harmless 0+ , like this. 

    (0+$num1) ^ (0+$num2)

If you want to be sure that Perl knows you've got strings, use harmless
quotes. 

    "$num1" ^ "$num2"

Either one of these methods produces no unnecessary code in these
expressions, which is why I call them "harmless". Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!




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

Date: Fri, 19 Sep 1997 18:01:32 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: Linux Perl Bug ?
Message-Id: <3422A1DC.CB1101E@absyss.fr>

Tom Phoenix wrote:

> If you want to be sure that Perl knows you've got strings, use harmless
> quotes.
> 
>     "$num1" ^ "$num2"
> 
> Either one of these methods produces no unnecessary code in these
> expressions, which is why I call them "harmless". Hope this helps!

TomC might not agree.  Sure, in the context of ensuring something is a
string, the quotes are harmless, but it is a bad habit to pick up. 
"$ref" is not at all the same as $ref (where $ref is holding a hard
reference of some sort).  As I've been bitten by this before, I don't
want anyone else to have to suffer through this one.

- doug


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

Date: 19 Sep 1997 15:25:55 GMT
From: jgloudon@bbn.com (Jason Gloudon)
Subject: Re: Memory leak?
Message-Id: <5vu5i3$kiu$1@daily.bbnplanet.com>

In article <5vsb2c$9rg$1@gazette.corp.medtronic.com>,
Jot Powers <news@bofh.com> wrote:
>In article <34219F8B.2B68@inconnect.com>, Steve Wolfe wrote:
>>I am currently writing a script to parse our passwd file, and make sure
>>that each person has an entry in our qmail configuration file.  However,
>>the script has a huge memory leak.  Prossessing the first 80 lines of
>>the passwd file, it takes up 29 megs of ram, and if I try to process the
>>whole thing, it takes well over 250 megs, and eventually the machine
>>says "out of memory".  I've tried it under Perl 5.003 and 5.004, same
>>results.  Any ideas why?  Here's the code:
>
>I'd guess something else is going on.  But, your script could use a lot
>of help too.  Then again TIMTOWTDI.  :) 
>
>The first thing is that when you cut your script for us, you must have
>cut out:

	I am curious are we acknowledging the presence of a memory leak here or
can someone explain if the code we were shown explains the memory usage.
As it is I can't explain the memory usage.

Also to the original poster there is no such group as comp.lang.perl anymore.


Jason Gloudon


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

Date: Fri, 19 Sep 1997 09:37:23 -0700
From: Chris Schoenfeld <chris@ixlabs.com>
Subject: Moving installations across machines
Message-Id: <3422AA43.402@ixlabs.com>

I have a Perl 5.004_03 installation that lives under one directory:
/home/perl/perldev/perl5.004_03/
This is the root for the install.

I tarred up this directory and ftp'd it to another machine, and untarred
it. The machines are both PPro 200's running Red Hat Linux.

It seems to work OK, but of course the Perl configuration still thinks
the machine has the same name as the build machine.

How do I change this, and are there any other issues I need to address?

Thansk
Chris


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

Date: Fri, 19 Sep 1997 09:56:22 -0700
From: Chris Schoenfeld <chris@ixlabs.com>
Subject: Re: Moving installations across machines
Message-Id: <3422AEB6.7B39@ixlabs.com>

In addition, I have installed this tree on a Pentium 133 as well.
WIll this work OK? Seems ok.

Chris

Chris Schoenfeld wrote:
> 
> I have a Perl 5.004_03 installation that lives under one directory:
> /home/perl/perldev/perl5.004_03/
> This is the root for the install.
> 
> I tarred up this directory and ftp'd it to another machine, and untarred
> it. The machines are both PPro 200's running Red Hat Linux.
> 
> It seems to work OK, but of course the Perl configuration still thinks
> the machine has the same name as the build machine.
> 
> How do I change this, and are there any other issues I need to address?
> 
> Thansk
> Chris


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

Date: Fri, 19 Sep 1997 11:28:39 -0400
From: kbarger@haverford.edu (Kyle Barger)
Subject: No Sys::Syslog (perl5.004, Solaris 2.5.1)
Message-Id: <kbarger-1909971128390001@news.haverford.edu>

I was trying to use Sys::Syslog and it does not seem to be working.  I
have perl 5.004_01 on Solaris 2.5.1.

The following code produces no errors, but it also doesn't log anything:

  #!/usr/bin/perl

  use Sys::Syslog;


  openlog('testing','cons,pid','local0');
  syslog('info','This is a test.');
  closelog();


The following command works fine (from the shell prompt or as a system()
call from within a perl script)

  logger -p local0.info -t testing "this is a test"

so I don't think there is anything wrong with my syslog setup.

I did not see anything in the FAQs etc.  Any suggestions?

-- 
Kyle Barger                       Haverford College
kbarger@haverford.edu             Academic Computing


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

Date: Fri, 19 Sep 1997 08:52:08 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Doug Seay <seay@absyss.fr>
Subject: Re: Perl equivalent to #ifdef in C?
Message-Id: <Pine.GSO.3.96.970919084821.11506W-100000@julie.teleport.com>


On Fri, 19 Sep 1997, Doug Seay wrote:

> PS - If perl5 doesn't do constant folding, my whole arguement falls to
> pieces and I'll agree that -P does have a valid role.  

Fortunately, Perl does do constant folding whenever possible, so you're on
solid ground here. I counsel against using -P, as you do.

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Fri, 19 Sep 1997 12:48:40 -0400 (EDT)
From: pietb@nic.mil (Piet Barber)
Subject: Perl to Java Compiler?
Message-Id: <Pine.SUN.3.96.970919121615.21608A-100000@ops.nic.mil>


I'm surprised I haven't seen more discussion about this, but here goes...

from http://www.oreilly.com/catalog/prkunix/ --
> By Larry Wall, Clay Irving, Nate Patwardhan, Ellen Siever, David Futato
> & Brian Jepson
> 1st Edition November 1997 (est.)
> 1-56592-370-7, Order Number: 3707
> 1700 pages (est.), $149.95, Includes 4 books & CD-ROM

from http://www.oreilly.com/catalog/prkunix/desc.html --

[snip]
> A Java/Perl interface, written for the Kit by Larry Wall, creator of
> Perl. This new Java/Perl tool allows programmers to write Java classes
>        with Perl implementations. 
[snip]
> This new Java/Perl tool allows programmers to write Java classes with 
> Perl implementations and run the code through a compiler back-end to 
> produce Java byte-code. Using this new tool, programmers can exploit
> Java's wide availability on the browser (as well as on the server), 
> while using Perl for the things that it does better than Java (such as
> string processing).

Excuse me for the caps I'm going to use, but THIS SOUNDS REALLY COOL!

Tell me if I read this correctly:  I will be able to write a perl program
(yes, I can do this :-) ).  Run it through a Larry Wall compiler, and then
I've got a .class file which I could (in theory) use in an applet or a
java application? 

Does this mean I won't have to learn that silly JAVA language that
everybody's howling about?

Someone set me straight if I'm wrong...
This sounds really exciting if it's what I think it is.

=----------
Piet Barber
Skyline Soaring Club, New Market, VA
http://www.ssl.umd.edu/skyline/




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

Date: Fri, 19 Sep 1997 08:09:26 -0400
From: John Brogan <jbrogan@reply.net>
Subject: Perl w/Enterprise Server 3.0 question
Message-Id: <34226B76.FB954DA2@reply.net>

Has anyone attempted to write a perl script as a mechanism of entering
a user and their password into the Netscape Enterprise Server 3.0
access control system?  We're trying to take a registration form that a
user fills
out and then have the script take their username and password
and enter the data into the ES 3.0 access control system so the
next time the user visits the site they can enter their username/pwd
to gain access to the secured pages.  We've scoured the volumes
of pages of netscape documentation but nada has turned up.
This was trivial in ES 2.0 but "great things" supposedly have been
done in 3.0 and it seems this is no longer a trivial task.

Thanks in advance to anyone who may have the answer to this.

John Brogan
ReplyNet

t: acs3/wrc



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

Date: 19 Sep 1997 16:17:07 GMT
From: "zserge" <zserge@care.lv>
Subject: Shell scripts from Unix to WinNT
Message-Id: <01bcc521$28fa0d80$092e949f@zserge.care.lv>

Hi All
I have one problem I can't solve-
how to set the enviromental variable in WinNT
from a C program?
I've tried to use system()  

system("set TEMP=C:\TEMP");

but it doesn't work.
This variable is only seen while the program is running.
I don't know how I could make this variable to be set after
my program ends.



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

Date: Fri, 19 Sep 1997 17:42:06 GMT
From: scott@engus.kronos.com (Scott DiNitto)
Subject: STDOUT not working properly... i think
Message-Id: <3422b82e.17225312@beavis.kronos.com>

	I am executing the command "fsck -m > fsck.tct". When I do
this, the contents of the file differ from the actual output. for
example, if I execute the command alone, I get:

ufs fsck: sanity check: /dev/rdsk/c0t0d0s0 needs checking
ufs fsck: sanity check: /dev/rdsk/c0t0d0s7 already mounted

where as when I redirect the output, I get:

**/dev/rdsk/c0t0d0s0
**/dev/rdsk/c0t0d0s7 

What is going on here? Am I wrong to assume simply redirecting the
file will catch all the content that will be printed to screen? When I
put a "print <STDOUT>" in my script after executing the fsck command,
I get the same results as those written to the file fsck.pl. This
leads me to believe that STDOUT is not reading all the contents I see
on the screen. Is this true? And how can I get the true screen output
written to a file?

SD 


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

Date: Fri, 19 Sep 1997 08:36:58 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Gvran Lvfstrvm <golo1517@mail.student.uu.se>
Subject: Re: Uploading files larger than 50k from webpage IMPOSSIBLE?
Message-Id: <Pine.GSO.3.96.970919083338.11506U-100000@julie.teleport.com>

On Fri, 19 Sep 1997, G=F6ran L=F6fstr=F6m wrote:

> I am using perl 5.004 and have made a script that is supposed to handle
> file uploads from webpages.
> The script uses cgi-lib.pl 2.14 for stripping the form-data, and I use
> the <INPUT TYPE=3Dfile> construction in Netscape within the form.

You should use CGI.pm instead of cgi-lib.pl.

> Now, the script works really good if I upload files smaller than about
> 50k. Above that, the webserver reports 'Premature EOF' and 'Pipe Ended'.=
=20
>=20
> It seems to me like Perl gets choked with data, and cuts the stream
> after about 50k.=20

Not likely. It's more likely that either this is an "undocumented feature"
of cgi-lib.pl or (even more likely) your system, server, network
connection, or browser are causing the problem. My guess is that you're
running out of some resource, such as temp file space.=20

Hope this helps!

--=20
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: 19 Sep 1997 17:34:57 GMT
From: pi@complx.LF.net (Kurt Jaeger)
Subject: Re: Uploading files larger than 50k from webpage IMPOSSIBLE?
Message-Id: <5vud41$c02$1@news.LF.net>

In article <342228BA.AAA44D64@mail.student.uu.se>,
Gvran Lvfstrvm <golo1517@mail.student.uu.se> wrote:
>I am using perl 5.004 and have made a script that is supposed to handle
>file uploads from webpages.
>The script uses cgi-lib.pl 2.14 for stripping the form-data, and I use
>the <INPUT TYPE=file> construction in Netscape within the form.
>
>Now, the script works really good if I upload files smaller than about
>50k. Above that, the webserver reports 'Premature EOF' and 'Pipe Ended'.

Set the following cgi-lib variable, default is 50K:

$cgi_lib'maxdata    = 131072;    # maximum bytes to accept via POST - 2^17

-- 
MfG/Best regards, Kurt Jaeger                                  23 years to go !
LF.net GmbH        pi@LF.net
Vor dem Lauch 23   fon +49 711 90074-23
D-70567 Stuttgart  fax +49 711 7289041


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

Date: Fri, 19 Sep 1997 15:10:18 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: What does this error message mean?
Message-Id: <EGrGt7.Co6@world.std.com>

[a copy of this article was sent to the cited author]
Doug Seay <seay@absyss.fr> writes:

>Joseph Scott Stuart wrote:
>> and I get the following error message at the end of my program:
>> 
>> Not a GLOB reference during global destruction (#1)

>Try adding "use diagnostic;" at the top of your code.  This give a bit
>more verbose error messages.  As for your glob() problem, I can't help. 
>I don't like glob() as it uses csh, which is evil.  I stick with
>'opendir;grep(readdir);closedir' .

The GLOB that the error message refers to are not fileglobs, but
typeglobs (using the *something notation.)

It sounds like a perl interpreter bug, I guess he could narrow the
cause down by running the program in the debugger, and at the end of
his code using the "V" command to see what perl is cleaning up.

There may even be more help if he combines this with a debugging
version of perl and the "PERL_DESTRUCT_LEVEL" environment var. (As
described in the perlobj man page.)

-- 
Andrew Langmead


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

Date: Fri, 19 Sep 1997 10:27:49 -0500
From: Nik Trivedi <nikhil@backlash.net>
Subject: What's the name o' dat mod?
Message-Id: <342299F5.79B9E6DD@backlash.net>

Hello everyone,

I used this modual a few months ago and I need to use it again.  It's
one that came with prel 5.0003 and simply turncates the decimal off a
floating point number and turns it into an integer.  What the name of
that mod and how do you use it again?

Nik Trivedi
nikhil@backlash.net



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

Date: 19 Sep 97 15:38:34 GMT
From: morpheus@no-spam.calweb.com (Steve Lamb)
Subject: Re: What's the name o' dat mod?
Message-Id: <slrn62573r.chb.morpheus@web1.calweb.com>

nikhil@backlash.net in <<342299F5.79B9E6DD@backlash.net>> wrote:
>I used this modual a few months ago and I need to use it again.  It's
>one that came with prel 5.0003 and simply turncates the decimal off a
>floating point number and turns it into an integer.  What the name of
>that mod and how do you use it again?

     I know why you can find the module...  Because it isn't a module. 
You're looing for int.

-- 
             Steve C. Lamb             | Opinions expressed by me are not my
    http://www.calweb.com/~morpheus    | employer's.  They hired me for my
CC: from news not wanted or appreciated| skills and labor, not my opinions!
---------------------------------------+-------------------------------------


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

Date: Fri, 19 Sep 1997 09:28:23 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Nik Trivedi <nikhil@backlash.net>
Subject: Re: What's the name o' dat mod?
Message-Id: <Pine.GSO.3.96.970919092743.11506c-100000@julie.teleport.com>


On Fri, 19 Sep 1997, Nik Trivedi wrote:

> I used this modual a few months ago and I need to use it again.  It's
> one that came with prel 5.0003 and simply turncates the decimal off a
> floating point number and turns it into an integer.  What the name of
> that mod and how do you use it again?

You might mean int() or sprintf(), but those aren't modules. 

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Fri, 19 Sep 1997 08:20:08 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: gatcat@gatman.SPAMBUFFER.com
Subject: Re: Where am I missing it
Message-Id: <Pine.GSO.3.96.970919081709.11506S-100000@julie.teleport.com>

On Fri, 19 Sep 1997 gatcat@gatman.SPAMBUFFER.com wrote:

> Original  variable for send mail was:
> $mailprog = '/usr/lib/sendmail';
> 
> ISP tells me that their mail program is COMMENTS.EXE and located in
> cgi-bin directory. 

Do they claim that it works just like sendmail? And what's it doing in the
cgi-bin directory? That's not likely to be right; it's more likely that
it's a CGI script in that case. Not that this has anything to do with
Perl, since the same problem would plague you if you used any other
language to write scripts on that server. If your ISP won't give you the
right information, change ISPs. Good luck!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 1049
**************************************

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