[11351] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4951 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Feb 20 17:07:17 1999

Date: Sat, 20 Feb 99 14:00:23 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 20 Feb 1999     Volume: 8 Number: 4951

Today's topics:
    Re: can i use perl to filter NT event viewer logs? <gellyfish@btinternet.com>
    Re: export perl variables <gellyfish@btinternet.com>
        FAQ 4.1: Why am I getting long decimals (eg, 19.9499999 <perlfaq-suggestions@perl.com>
        FAQ 8.47: How do I keep my own module/library directory <perlfaq-suggestions@perl.com>
        FAQ 8.48: How do I add the directory my program lives i <perlfaq-suggestions@perl.com>
        FAQ 8.49: How do I add a directory to my include path a <perlfaq-suggestions@perl.com>
        FAQ 8.50: What is socket.ph and where do I get it?   <perlfaq-suggestions@perl.com>
    Re: File Upload / Retaining File Name <gellyfish@btinternet.com>
    Re: File Upload via HTTP progress indicator <ozette@imaginative-creations.com>
        foreach and while aaronp123@my-dejanews.com
    Re: foreach and while <thelma@alpha2.csd.uwm.edu>
    Re: foreach and while <gellyfish@btinternet.com>
        How to Search FAQ? <jalilf@home.com>
    Re: How to Search FAQ? <tchrist@mox.perl.com>
    Re: How to Search FAQ? <gellyfish@btinternet.com>
    Re: need a clearer explanation of ${1} use in s///i <gellyfish@btinternet.com>
    Re: need a clearer explanation of ${1} use in s///i (Ilya Zakharevich)
        Non-greedy matching <admin@asarian-host.org>
    Re: perl ldap problem HELP please <shaven.monkey@throw.me.the.banana.first>
    Re: Printing all environment variables (Marc-A. Woog)
    Re: Printing all environment variables <jdf@pobox.com>
    Re: Q on localtime (Larry Rosler)
    Re: Searching for Files within a certain directory (Dana Booth)
    Re: Socket communication <gellyfish@btinternet.com>
    Re: Socket problems with 5.005_2 on Solaris 2.7 <gellyfish@btinternet.com>
    Re: tie complex data in DBM files <janha@nntp.ifi.uio.no>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 20 Feb 1999 19:51:05 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: can i use perl to filter NT event viewer logs?
Message-Id: <7an3n9$1oo$1@gellyfish.btinternet.com>

On Wed, 17 Feb 1999 11:06:42 -0800 eric wrote:
> Does anyone have scripts to filter event viewer logs on
> Windows NT?  In particular, I'm looking for something to
> pull out logon/logoff attempts.  Can I do this with perl,
> or do I have to resort to C?
> 

I belive that there is a module like Win32::Event (or something like
that) which will provide an interface to the event logs - I'm sorry
I cant be more specific but I have escaped from that vale of woe.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 20 Feb 1999 19:35:01 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: export perl variables
Message-Id: <7an2p5$1ob$1@gellyfish.btinternet.com>

On 18 Feb 1999 10:57:21 +0100 Tony Curtis wrote:
> Re: export perl variables, George
> <georgeb@xylan.com> said:
> 
> George> This is a multi-part message in MIME format.
> George> --------------B438BCA84BD6872A5DC107A3
> George> Content-Type: multipart/alternative;
> George> boundary="------------257EEDF1D162831753CE8146"
> 
> Please don't post HTML to USENET, this is a text
> medium.  Nor the vcard stuff...
> 

Its worse than that its even a broken implementation of it - tin normally
will display the alternate part that this section header is advertising 
but in this case it has failed and displayed the whole drned thing. Now
this could be a bug in 'tin' but I doubt that somehow.

I think I'm going to frig with lmove so that it sorts this crap out once
and for all.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 20 Feb 1999 14:31:46 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 4.1: Why am I getting long decimals (eg, 19.9499999999999) instead of the numbers I should be getting (eg, 19.95)?  
Message-Id: <36cf29c2@csnews>

(This excerpt from perlfaq4 - Data Manipulation 
    ($Revision: 1.43 $, $Date: 1999/01/26 09:57:23 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq4.html
if your negligent system adminstrator has been remiss in his duties.)

  Why am I getting long decimals (eg, 19.9499999999999) instead of the numbers I should be getting (eg, 19.95)?

    The infinite set that a mathematician thinks of as the real numbers can
    only be approximate on a computer, since the computer only has a finite
    number of bits to store an infinite number of, um, numbers.

    Internally, your computer represents floating-point numbers in binary.
    Floating-point numbers read in from a file or appearing as literals in
    your program are converted from their decimal floating-point
    representation (eg, 19.95) to the internal binary representation.

    However, 19.95 can't be precisely represented as a binary floating-point
    number, just like 1/3 can't be exactly represented as a decimal
    floating-point number. The computer's binary representation of 19.95,
    therefore, isn't exactly 19.95.

    When a floating-point number gets printed, the binary floating-point
    representation is converted back to decimal. These decimal numbers are
    displayed in either the format you specify with printf(), or the current
    output format for numbers (see the section on "$#" in the perlvar
    manpage if you use print. `$#' has a different default value in Perl5
    than it did in Perl4. Changing `$#' yourself is deprecated.

    This affects all computer languages that represent decimal floating-
    point numbers in binary, not just Perl. Perl provides arbitrary-
    precision decimal numbers with the Math::BigFloat module (part of the
    standard Perl distribution), but mathematical operations are
    consequently slower.

    To get rid of the superfluous digits, just use a format (eg,
    `printf("%.2f", 19.95)') to get the required precision. See the section
    on "Floating-point Arithmetic" in the perlop manpage.

-- 
    "Historically speaking, the presence of wheels in Unix has never precluded
    their reinvention."
    	--Larry Wall


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

Date: 20 Feb 1999 12:00:06 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 8.47: How do I keep my own module/library directory?  
Message-Id: <36cf0636@csnews>

(This excerpt from perlfaq8 - System Interaction 
    ($Revision: 1.36 $, $Date: 1999/01/08 05:36:34 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq8.html
if your negligent system adminstrator has been remiss in his duties.)

  How do I keep my own module/library directory?

    When you build modules, use the PREFIX option when generating Makefiles:

        perl Makefile.PL PREFIX=/u/mydir/perl

    then either set the PERL5LIB environment variable before you run scripts
    that use the modules/libraries (see the perlrun manpage) or say

        use lib '/u/mydir/perl';

    This is almost the same as:

        BEGIN {
            unshift(@INC, '/u/mydir/perl');
        }

    except that the lib module checks for machine-dependent subdirectories.
    See Perl's the lib manpage for more information.

-- 
I think I can sum up the difference between *BSD and Linux as follows:
"In Linux, new users get flamed for asking questions in the newsgroups
(or heaven forfend, the wrong newsgroup).  In *BSD the principals
flame each other." --Warner Losh             


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

Date: 20 Feb 1999 13:00:08 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 8.48: How do I add the directory my program lives in to the module/library search path?  
Message-Id: <36cf1448@csnews>

(This excerpt from perlfaq8 - System Interaction 
    ($Revision: 1.36 $, $Date: 1999/01/08 05:36:34 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq8.html
if your negligent system adminstrator has been remiss in his duties.)

  How do I add the directory my program lives in to the module/library search path?

        use FindBin;
        use lib "$FindBin::Bin";
        use your_own_modules;

-- 
"After three days without programming, life becomes meaningless."


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

Date: 20 Feb 1999 13:08:55 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 8.49: How do I add a directory to my include path at runtime?  
Message-Id: <36cf1657@csnews>

(This excerpt from perlfaq8 - System Interaction 
    ($Revision: 1.36 $, $Date: 1999/01/08 05:36:34 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq8.html
if your negligent system adminstrator has been remiss in his duties.)

  How do I add a directory to my include path at runtime?

    Here are the suggested ways of modifying your include path:

        the PERLLIB environment variable
        the PERL5LIB environment variable
        the perl -Idir commpand line flag
        the use lib pragma, as in
            use lib "$ENV{HOME}/myown_perllib";

    The latter is particularly useful because it knows about machine
    dependent architectures. The lib.pm pragmatic module was first included
    with the 5.002 release of Perl.

-- 
    char program[1];        /* Unwarranted chumminess with compiler. */
	    --Larry Wall in the Perl source code
    (quoting Henry Spencer (quoting Dennis Ritchie (quoting Brian Kerninghan)))


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

Date: 20 Feb 1999 13:31:43 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 8.50: What is socket.ph and where do I get it?  
Message-Id: <36cf1baf@csnews>

(This excerpt from perlfaq8 - System Interaction 
    ($Revision: 1.36 $, $Date: 1999/01/08 05:36:34 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq8.html
if your negligent system adminstrator has been remiss in his duties.)

  What is socket.ph and where do I get it?

    It's a perl4-style file defining values for system networking constants.
    Sometimes it is built using h2ph when Perl is installed, but other times
    it is not. Modern programs `use Socket;' instead.

-- 
"The reasonable man conforms himself to his environment. The
unreasonable man conforms his environment to himself. Therefore
all change depends on the unreasonable man."


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

Date: 20 Feb 1999 18:56:12 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: File Upload / Retaining File Name
Message-Id: <7an0gc$1o5$1@gellyfish.btinternet.com>

On Sat, 20 Feb 1999 12:30:18 -0500 Matt Melton wrote:
> Hello,
> 
> Using cgi-lib.pl and Steven Brenners fup.cgi, I am able to get the file to
> upload via a web browser to the correct directory, but the script renames
> the file.  I would like to be able to keep the original file name, though I
> don't know how to do this.  From the cgi-lib homepage, it says:

I dunno, Generally I wouldnt start from there - I find myself advocating
this quite a lot recently but I think that if one uses CGI.pm then these
things are so much easier.  The documentation has a section on using
the "file upload field" and there is an article by Brent Michalski at
<http://www.webreview.com/> that goes into some detail with a useable
example.

The security issue that you mention - that is that some badass might supply
you with a file that has the name of an existing *and possibly important*
file is easily dealt with by checking for the existence of the file to be
written and possibly also only allowing people to write into certain
directories - you are checking the identity of people now arent you ?

/J\
/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sat, 20 Feb 1999 14:09:03 -0500
From: "Mr. Ozette Brown" <ozette@imaginative-creations.com>
Subject: Re: File Upload via HTTP progress indicator
Message-Id: <36CF084F.32EDD04D@imaginative-creations.com>

I've wanted to do the same thing.  If you find out how to do it, please
let me know.

Thanks,

Ozette

squid@fish.net wrote:

> Howdy all....
>
> I have a working File Upload via HTTP setup running (using CGI.pm) but
> I was wondering if anyone knew of a way to have a progress bar to show
> the uploader how much longer they have to wait for completion. The
> files that are being uploaded are mainly graphics files and some are
> quite large(10 MB +). Some of our users are uploading roughly 1 MB
> files over modem connections and they would benefit from knowing the
> estimated upload time or progress. Any suggestions would be mucho
> appreciated.
>
>                         GEO

--
Mr. Ozette J. Brown   <President>
Imaginative Creations <webmaster@imaginative-creations.com>
A Website Development and Consulting Company.
http://www.imaginative-creations.com




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

Date: Sat, 20 Feb 1999 19:36:33 GMT
From: aaronp123@my-dejanews.com
Subject: foreach and while
Message-Id: <7an2s1$9ld$1@nnrp1.dejanews.com>



I have a pipe delimited data file like:
$NAME|$EMAIL|$CREDIT|$DATE


That looks like:
Jon128|jon@email.com|6|990108
Jon128|jon@email.com|10|990308
Bobh92|bob@doman.com|18|990308
Jon128|jon@email.com|33|990508


I set up a search routine that will examine only the $NAME field for the
search criteria that is passed through to the script via query_string.	And,
I can get the script to single out lines of data pertaining to Jon128 (from
the example above) and it displays them all in a nicely formated table, a row
for each. What I cannot figure out for the life of me is how I can add up the
numeric value of the CREDIT values and pass it along to a single variable
like 'total_credits'.


This is what I have for search results:

foreach $result (@results){
($NAME,$EMAIL,$CREDIT,$DATE)= split(/\|/,$result);
print "<b>$NAME</b> - $EMAIL - $CREDIT - On: $DATE<br>\n";
}


In the small database example, how would I get jon128's $CREDIT values of 6,
10, and 33 into one value called something like 'total_credits' so that
'total_credits' would = 49.

Thanks a billion.



-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 20 Feb 1999 20:43:47 GMT
From: Thelma Lubkin <thelma@alpha2.csd.uwm.edu>
Subject: Re: foreach and while
Message-Id: <7an6q3$1ap$1@uwm.edu>

aaronp123@my-dejanews.com wrote:


: I have a pipe delimited data file like:
: $NAME|$EMAIL|$CREDIT|$DATE


: That looks like:
: Jon128|jon@email.com|6|990108
: Jon128|jon@email.com|10|990308
: Bobh92|bob@doman.com|18|990308
: Jon128|jon@email.com|33|990508

      <snipped>

: This is what I have for search results:

: foreach $result (@results){
: ($NAME,$EMAIL,$CREDIT,$DATE)= split(/\|/,$result);
: print "<b>$NAME</b> - $EMAIL - $CREDIT - On: $DATE<br>\n";
: }


: In the small database example, how would I get jon128's $CREDIT values of 6,
: 10, and 33 into one value called something like 'total_credits' so that
: 'total_credits' would = 49.
         
         one way: cumulate them to a hash with the names as keys:
                 put into your foreach loop above:
                   $total_credits{$NAME}  += $CREDIT;
         and after the loop print all your totals:
                 foreach $name ( sort keys %total_credits ) 
                 { print "$name    $total_credits{$name}; }
       ..or add a field to your printout above to print total_credits
         thus far on each line.
                                --thelma
: Thanks a billion.


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

Date: 20 Feb 1999 21:26:27 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: foreach and while
Message-Id: <7an9a3$1v0$1@gellyfish.btinternet.com>

On Sat, 20 Feb 1999 19:36:33 GMT aaronp123@my-dejanews.com wrote:
> 
> 
> I have a pipe delimited data file like:
> $NAME|$EMAIL|$CREDIT|$DATE
> 
> 
> That looks like:
> Jon128|jon@email.com|6|990108
> Jon128|jon@email.com|10|990308
> Bobh92|bob@doman.com|18|990308
> Jon128|jon@email.com|33|990508
> 
> 
<snip>
> 
> In the small database example, how would I get jon128's $CREDIT values of 6,
> 10, and 33 into one value called something like 'total_credits' so that
> 'total_credits' would = 49.
> 

You will need to use a hash as in the follwoing example:


#!/usr/bin/perl -w

while(<DATA>)
{
	chomp;
	my($name,$email,$credit,$date) = split /\|/,$_;

	$totals{$name} += $credit;
}

foreach (keys %totals )
{
	print $_,"\t",$totals{$_},"\n";
}

__END__
Jon128|jon@email.com|6|990108
Jon128|jon@email.com|10|990308
Bobh92|bob@doman.com|18|990308
Jon128|jon@email.com|33|990508

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sat, 20 Feb 1999 19:36:50 GMT
From: "Jalil Feghhi" <jalilf@home.com>
Subject: How to Search FAQ?
Message-Id: <m9Ez2.8520$yv3.2937@news.rdc1.sfba.home.com>

It seems that some of the questions asked in this group (including my last
two questions) are already in the faq. I am wondering if there is any way to
search all the faqs. I hope it is not already in faqs!

-Jalil





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

Date: 20 Feb 1999 12:53:30 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to Search FAQ?
Message-Id: <36cf12ba@csnews>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    "Jalil Feghhi" <jalilf@home.com> writes:
:It seems that some of the questions asked in this group (including my last
:two questions) are already in the faq. I am wondering if there is any way to
:search all the faqs. I hope it is not already in faqs!

Well, you could do this:

    $ cd /usr/src/perl/pod
    $ grep whatever perlfaq*.pod

Or you coudl get the pmtools package:

    http://mox.perl.com/misc/pmtools-1.00.tar.gz

And run 

    $ podgrep whatever `faqpods`

which tolerates find options like

    $ podgrep -h whatever `faqpods`
    $ podgrep -tfh whatever `faqpods`

--tom
-- 
Anyone can be taught to sculpt.
Michaelangleo would have had to have been taught how not to.
The same is true of great programmers


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

Date: 20 Feb 1999 21:05:00 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: How to Search FAQ?
Message-Id: <7an81s$1u3$1@gellyfish.btinternet.com>

On 20 Feb 1999 12:53:30 -0700 Tom Christiansen wrote:
>  [courtesy cc of this posting sent to cited author via email]
> 
> In comp.lang.perl.misc, 
>     "Jalil Feghhi" <jalilf@home.com> writes:
> :It seems that some of the questions asked in this group (including my last
> :two questions) are already in the faq. I am wondering if there is any way to
> :search all the faqs. I hope it is not already in faqs!
> 
> Well, you could do this:
> 
>     $ cd /usr/src/perl/pod
>     $ grep whatever perlfaq*.pod
> 
> Or you coudl get the pmtools package:
> 
>     http://mox.perl.com/misc/pmtools-1.00.tar.gz
> 

Or indeed , if you have better than Perl 5.005.02 :

perldoc -q <whatever>

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 20 Feb 1999 19:44:41 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: need a clearer explanation of ${1} use in s///i
Message-Id: <7an3b9$1of$1@gellyfish.btinternet.com>

On Wed, 17 Feb 1999 15:06:07 -0500 edgar wrote:
> The code does change the spelling from Pearl to Perl.
> what does ${1} and variations do ? and/or where do I find it.
> The following is a copy of tested code from faq5 with changes.
> 

The locution ${1} is used to disambiguate the more usual $1 in a 
context where it may be more difficult for Perl to determine what is
meant.

In a regex type statement the variables $1 .. $9 are the parenthesis
captured values from the regex.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 20 Feb 1999 21:57:16 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: need a clearer explanation of ${1} use in s///i
Message-Id: <7anb3s$4vv$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Jonathan Stowe 
<gellyfish@btinternet.com>],
who wrote in article <7an3b9$1of$1@gellyfish.btinternet.com>:
> In a regex type statement the variables $1 .. $9 are the parenthesis
> captured values from the regex.

Please do not use the expression

  $1 .. $9

when describing "match" variables.  There is absolutely no difference
between how $8 and $88888888888888 are handled by Perl.  Btw, there is
absolutely no difference between what ${'8'} and ${'8ba'} *mean* in
perl, but this is an entirely different can of worms.

Ilya


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

Date: Sat, 20 Feb 1999 21:36:33 +0100
From: Mark <admin@asarian-host.org>
Subject: Non-greedy matching
Message-Id: <199902202036.NAA23997@asarian-host.org>

Hi,

Suppose I have the following domains:

$sites{'cwdomains'} = 'domain_one|domain_two';

then:

s/\@.*?(?:($sites{'cwdomains'}))/\@$1/gi;

will fail is there are multiple email addresses on the same line: the ".*?" is
discarded, and a greedy match is done. Okay, I asked for that with "?:", but is
there any way I can match ".*?" non-greedy before "(?:($sites{'cwdomains'}))" ?

Any help would be highly appreciated,

- Mark

        System Administrator Asarian-host.org







--
For more information about this posting service, contact:

help@asarian-host.org    -- for general info about our services
admin@asarian-host.org   -- for the server's administrator
nclark@asarian-host.org  -- for our PR manager
abuse@asarian-host.org   -- for abuse of this posting service

If you wish to get an anonymous account, visit our sign-up page:

http://asarian-host.org/emailform.html


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

Date: Wed, 17 Feb 1999 19:18:55 +0000
From: "shaven.monkey" <shaven.monkey@throw.me.the.banana.first>
Subject: Re: perl ldap problem HELP please
Message-Id: <36CB161F.FF3EC91E@throw.me.the.banana.first>

The code creates the user and rfc822Mailbox is a mandatory attribute of
rfc822-user, so it can't be blank.

thanks anyway
SM

lt lindley wrote:
> 
> shaven.monkey <shaven.monkey@throw.me.the.banana.first> wrote:
> :>Can anybody see what's wrong with this piece of code?
> 
> :>I get the error message "bind error Invalid syntax" and can't figure out
> :>why.
> :>If an existing user already has an attribute rfc822Mailbox I can modify
> :>the value,
> :>but I can't add the attribute to a user.
> 
> [ code snipped ]
> 
> I don't know about the error message.  And I have only read enough
> LDAP to do whatever I was trying to do at the time.
> 
> Are you sure that the user does not already have an attribute
> rfc822Mailbox that happens to be Null?  Try using "modify_s"
> instead of add.
> 
> --
> // Lee.Lindley   | There was a time when I thought that "being right"
> // @bigfoot.com  | was everything.  Then I realized that getting along
> //    | was more important.  Still, being right is more fun!
> //    | And if I'm wrong, somebody will get some joy out of telling me!


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

Date: Sat, 20 Feb 1999 19:36:47 GMT
From: mwoog@gmx.net (Marc-A. Woog)
Subject: Re: Printing all environment variables
Message-Id: <36cf0b62.8892290@news.datacomm.ch>

On Sat, 20 Feb 1999 10:09:59 -0500, "Allan M. Due" <Allan@Due.net>
wrote in <RfAz2.287$986.6229@nntp1.nac.net>:

Hi Allan,

>Andre L. wrote in message ...
>:In article <36CD98FE.3CE3C41B@giss.nasa.gov>, jglascoe@giss.nasa.gov wrote:
[snipped]

>Or, just for fun:
>
>print map{"$_\t$ENV{$_}\n"} (sort keys %ENV);

Just yesterday I was trying to learn more about the map function and
red in the Camel Book something like "do not use map in a void
context, use foreach or system instead" (I have the german book, so
sorry if I am quoting wrong: see the page listed second in the index
for "map"). Aren't you doing exactly that (or do I misunderstand "void
context")?

I am not nitpicking or anything: I am just trying to learn..;)

Regards,

Marc


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

Date: 20 Feb 1999 15:11:41 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: mwoog@gmx.net
Subject: Re: Printing all environment variables
Message-Id: <m3k8xclts2.fsf@joshua.panix.com>

mwoog@gmx.net (Marc-A. Woog) writes:

> >Andre L. wrote in message ...
> >
> >print map{"$_\t$ENV{$_}\n"} (sort keys %ENV);
> 
> Just yesterday I was trying to learn more about the map function and
> red in the Camel Book something like "do not use map in a void
> context, use foreach or system instead" Aren't you doing exactly
> that (or do I misunderstand "void context")?

"Void context" means "a context in which the value of an expression is
disregarded".  Here the value of map() is being *used* by print();
print() is documented to expect a list.

The idea is not to use map() for side effects, but to use it for
constructing lists.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: Sat, 20 Feb 1999 11:38:23 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Q on localtime
Message-Id: <MPG.1138af07bea98b57989a66@nntp.hpl.hp.com>

In article <m3n228lxqd.fsf@joshua.panix.com> on 20 Feb 1999 13:46:18 -
0500, Jonathan Feinberg <jdf@pobox.com> says...
> <tavi367@ibm.net> writes:
 ...
> >  sprintf '%.2d/%.2d/%d', $mon + 1, $day, $year + 1900
> 
> Again, just my opinion, but I think that '0' is clearer than '.' in
> asking for a zero-padded integer.
> 
>    "%02d"

Provided you remember that a specification '%010d' is a zero-padded ten-
digit field, not an eight-digit field.  :-)

The specific advantage of the '.' notation for integers comes when 
combining zero-padding with field-width specification:  '%5.3d' produces 
a result zero-padded to three places, right-adjusted in a five-character 
space-padded field;  '%-5.3d' produces the same result left-adjusted.

So, just my opinion, but I think that using one notation '.' to specify 
a zero-padded integer is clearer than using two notations '0' and '.'.  
(And I wrote the code that <tavi367@ibm.net> presented. ;-)

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Sat, 20 Feb 1999 11:58:39 -0800
From: dana@oz.netDELETE.CAPS (Dana Booth)
Subject: Re: Searching for Files within a certain directory
Message-Id: <MPG.1138b3cdde9d11fd989680@news.oz.net>

In article <7alqse$g9m$1@ash.prod.itd.earthlink.net>, bye@me.com 
says...
> Please help!
> 
> New to Perl and Active Perl 5.0 and would like some guidance.  I'm trying to
> evaluate a certain condition within a directory which has many files with
> different names.  The only thing in common is the extention.  How can I use
> a file handler to read the file(s) using =~m "Criteria" against all the
> files within that directory.

Have you tried 'find' in the 'File' module?

-- 

-----------------------------------
Dana Booth <dana@oz.netDELETE.CAPS>
Tacoma, Wa., USA
-----------------------------------


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

Date: 20 Feb 1999 20:19:04 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Socket communication
Message-Id: <7an5bo$1p6$1@gellyfish.btinternet.com>

On Wed, 17 Feb 1999 16:52:22 GMT nightinj@my-dejanews.com wrote:
> I've been using the Socket module to transfer data between a server and a
> client program/process using TCP.
> 
> Does anybody know if it possible to send information to the server from the
> client and give an example of how this could be done (or some other hint).
> 

If you think about it there is really little difference between a client
and a server but the server waits for request and a client makes them ;-}

There is a bounty of information in the perlipc manpage and also in perlfaq9.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 20 Feb 1999 20:00:54 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Socket problems with 5.005_2 on Solaris 2.7
Message-Id: <7an49m$1p0$1@gellyfish.btinternet.com>

On Wed, 17 Feb 1999 10:33:55 -0800 Richard L. England wrote:
> I have a perl script that ran fine under 5.001 on several platforms
> which now fails under 5.005_02 on Solaris 2.7 but runs on HPUX 11.00.
> The failure indication is:
> 
> Socket version 1.3 required--this is only version  at
> /usr/mgc/lib/perl5005_02/IO/Socket.pm line 118.
> 
> It appears as though there should be something "filled in" after the
> word "version" in the message.  I have found reference to a version
> 1.7 in the Socket code but I'm not sure if it  has any bearing on this
> issue or not.
> 

There has been an issue with the sockets code on solaris that is 
discussed in perlfaq8 but I dont think that is what you are experiencing
here - you might want to check it out and see if it fits the bill 
anyway. I have never built Perl on Solaris 2.7 but on 2.6 I have seen
no problems.

In summary it is probably something weird to do with the header files
but I cant be sure about that - if you have 2.6 available to you then
you might want to 'diff' the appropriate header files to see what has
changed - you might even want to send your results to the maintainer of
the Socket.pm code.

/J\

-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 20 Feb 1999 21:55:21 +0100
From: Jan Egil Hagen <janha@nntp.ifi.uio.no>
Subject: Re: tie complex data in DBM files
Message-Id: <yaa678wu75y.fsf@dromi.ifi.uio.no>

[Tom Christiansen]

| % man perlfaq4
| 
|    How can I store a multidimensional array in a DBM file?
| 
|    Either stringify the structure yourself (no fun), or else get the
|    MLDBM (which uses Data::Dumper) module from CPAN and layer it on top
|    of either DB_File or GDBM_File.

It might also be added that when this need arises, it *might* be a
sign that you should use an sql database instead.

I just made that mistake (or had to), and had to do a lot of silly
coding that would otherwise have been handled much more elegantly with
a few sql statements.

JEH


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

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

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