[9920] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3513 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Aug 22 19:17:43 1998

Date: Sat, 22 Aug 98 16:01:32 -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           Sat, 22 Aug 1998     Volume: 8 Number: 3513

Today's topics:
        Perl documentation (David Hawker)
    Re: Perl documentation <tchrist@mox.perl.com>
    Re: Perl documentation (Larry Rosler)
    Re: Perl documentation (Michael Fuhr)
    Re: Perl documentation (Ronald J Kimball)
    Re: Perl documentation (Larry Rosler)
    Re: Perl documentation (Larry Rosler)
    Re: Perl documentation (Craig Berry)
    Re: Perl documentation (Craig Berry)
        Possible to 'use strict' and Symbolic Refs? (Kenneth Loafman)
        script redirect: downloading file through browser <stathy@jaske.com>
        Sending file to browser <stathy@jaske.com>
    Re: Sending file to browser (Maurice Aubrey)
        Termination Character removal - how? <kauffman_e_wayne_ii@lilly.com>
        Termination Character removal - how? <kauffman_e_wayne_ii@lilly.com>
        tie %h, 'DB_File'... complains about invalid arg ? <alex@kawo2.rwth-aachen.de>
    Re: tie %h, 'DB_File'... complains about invalid arg ? (Ronald J Kimball)
    Re: tie %h, 'DB_File'... complains about invalid arg ? (Ronald J Kimball)
    Re: Turn Perl program into binary (I R A Aggie)
    Re: Warnings when dereferencing hashes? <jdf@pobox.com>
    Re: Warnings when dereferencing hashes? (Ronald J Kimball)
    Re: Warnings when dereferencing hashes? (Ronald J Kimball)
    Re: Why dont people read the FAQs (Gary L. Burnore)
    Re: Why dont people read the FAQs (Gary L. Burnore)
    Re: Why dont people read the FAQs (Gary L. Burnore)
    Re: Why dont people read the FAQs (Ronald J Kimball)
    Re: Why dont people read the FAQs (Craig Berry)
        Win32 perl, XS and VC++ 6 (RonaldWS)
        Win32::RasAdmin -- Setting NT RAS permissions with PERL <kingm@vmicro.com>
        Win32::RasAdmin -- Setting NT RAS permissions with PERL <kingm@vmicro.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Sat, 22 Aug 1998 16:03:18 GMT
From: dhawker@removethis.bigfoot.com (David Hawker)
Subject: Perl documentation
Message-Id: <6rnels$1au$57@elle.eunet.no>

1. Why is for/foreach/etc never included in the perl docs?

2. I'm after a complete documentation in one package. One thing that annoys
me is when the perl docs just say 'does the same thing as the system call'
and i have no idea what the system call does. I'd like everything to be
present in one giant package, without the need for me to go online and try
to track down other documentation. Has this been done?

--
dhawker@bigfoot.com | ICQ 7222349
http://dhawker.home.ml.org


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

Date: 22 Aug 1998 16:46:18 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Perl documentation
Message-Id: <6rnem3$1au$68@elle.eunet.no>

 [courtesy cc of this posting denied to cited author as a
  penalty for address mutilation]

In comp.lang.perl.misc, david.hawker@removethis.cableol.co.uk writes:
:1. Why is for/foreach/etc never included in the perl docs?

It is.  You didn't look hard enough.  It's in the REMOVE THIS manpage.

:2. I'm after a complete documentation in one package. One thing that annoys
:me is when the perl docs just say 'does the same thing as the system call'
:and i have no idea what the system call does. I'd like everything to be
:present in one giant package, without the need for me to go online and try
:to track down other documentation. Has this been done?

That can't happen, because the system call's behaviour varies
depending on the system.

--tom
-- 
    "Yes, you can think of almost everything as a function, but this may upset
    your wife." --Larry Wall


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

Date: Sat, 22 Aug 1998 09:51:03 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl documentation
Message-Id: <6rnem3$1au$69@elle.eunet.no>

In article <35dfe53d.4765271@news.cableol.net> on Sat, 22 Aug 1998 
16:03:18 GMT, David Hawker <dhawker@removethis.bigfoot.com> says...
> 1. Why is for/foreach/etc never included in the perl docs?

'for' and 'foreach' are discussed fully in `perldoc perlsyn` (though a 
grep for 'for' might get far more than you want).  I'm not sure about 
'etc'. :-)

> 2. I'm after a complete documentation in one package. One thing that annoys
> me is when the perl docs just say 'does the same thing as the system call'
> and i have no idea what the system call does. I'd like everything to be
> present in one giant package, without the need for me to go online and try
> to track down other documentation. Has this been done?

When I asked a similar question some months ago, I was flamed for not 
using a web search for, as I recall, 'man crypt'.  With so much 
Unix/POSIX documentation readily available online, it seems inappropriate 
to repackage it all with the Perl docs.

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


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

Date: Sat, 22 Aug 1998 16:59:32 GMT
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: Perl documentation
Message-Id: <6rnem4$1au$70@elle.eunet.no>

dhawker@removethis.bigfoot.com (David Hawker) writes:

> 1. Why is for/foreach/etc never included in the perl docs?

Eh?  They've been in every set of Perl documentation I've seen.
Try starting with the perl or perltoc manual page if you can't
seem to find something.

> 2. I'm after a complete documentation in one package. One thing that annoys
> me is when the perl docs just say 'does the same thing as the system call'
> and i have no idea what the system call does. I'd like everything to be
> present in one giant package, without the need for me to go online and try
> to track down other documentation. Has this been done?

Your system should have documentation on what each system call does.
For example, if you're using some flavor of Unix try "man foo"[1] to
find out about the foo() system call.  Perhaps the Perl documentation
authors prefer not to spend time writing about something that's already
documented elsewhere; besides, if foo() has any OS-specific behavior
then you'll have to refer to your local docs anyway.

[1] Or some variant like "man 2 foo" or "man -s 2 foo".
-- 
Michael Fuhr
http://www.fuhr.net/~mfuhr/


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

Date: Sat, 22 Aug 1998 13:17:11 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Perl documentation
Message-Id: <6rnem5$1au$72@elle.eunet.no>

David Hawker <dhawker@removethis.bigfoot.com> wrote:

> 1. Why is for/foreach/etc never included in the perl docs?

Remember, for/foreach/etc aren't functions, so if you're looking in
perlfunc, you won't find them.  Try perlsyn (for syntax) instead.

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Sat, 22 Aug 1998 10:23:39 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl documentation
Message-Id: <6rnem6$1au$73@elle.eunet.no>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <6rmskq$eq1$1@csnews.cs.colorado.edu> on 22 Aug 1998 16:46:18 
GMT, Tom Christiansen <tchrist@mox.perl.com> says...
 ...
> That can't happen, because the system call's behaviour varies
> depending on the system.

Not so much as it might have in the past.  A great deal of Section 2 has 
been incorporated into the POSIX standard (where the P means 'Portable') 
and has been replicated on 'POSIX-conforming' non-Unix systems (which 
shall remain nameless here because I don't want to violate *your* 
obscenity standards).

On the systems in question, these 'system calls' are documented as part 
of the Standard C Library, which is not available locally to many users 
of perl binaries on those systems.  But the Web solution seems 
appropriate (and doesn't require the Perl documenters to focus on 
anything but Perl -- a Good Thing).

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


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

Date: Sat, 22 Aug 1998 10:31:04 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl documentation
Message-Id: <6rnem7$1au$75@elle.eunet.no>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <6rmtdd$pl9@flatland.dimensional.com> on Sat, 22 Aug 1998 
16:59:32 GMT, Michael Fuhr <mfuhr@dimensional.com> says...
 ...
> Your system should have documentation on what each system call does.
> For example, if you're using some flavor of Unix try "man foo"[1] to
> find out about the foo() system call.  Perhaps the Perl documentation
> authors prefer not to spend time writing about something that's already
> documented elsewhere; besides, if foo() has any OS-specific behavior
> then you'll have to refer to your local docs anyway.
> 
> [1] Or some variant like "man 2 foo" or "man -s 2 foo".

Not at all.  See my response to Tom C.  The term 'system call' in many 
environments means 'call to behavior implemented in and documented with 
the C library', and such documentation does not come with the operating 
system.

But it *is* readily available on the Web.

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


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

Date: 22 Aug 1998 19:02:22 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Perl documentation
Message-Id: <6rnemc$1au$84@elle.eunet.no>

David Hawker (dhawker@removethis.bigfoot.com) wrote:
: 1. Why is for/foreach/etc never included in the perl docs?

/usr2/people/cberry > perldoc perlsyn | grep foreach            
         LABEL foreach VAR (LIST) BLOCK                         
     The foreach loop iterates over a normal list value and sets
     The foreach keyword is actually a synonym for the for      
     keyword, so you can use foreach for readability or for for 
     foreach loop index variable is an implicit alias for each  
         foreach my $elem (@elements) {                         
         foreach $item (split(/:[\\\n:]*/, $ENV{TERMCAP})) {    
         OUTER: foreach my $wid (@ary1) {                       
         INNER:   foreach my $jet (@ary2) {                     
     executes a foreach statement more rapidly than it would the
     A common idiom for a switch statement is to use foreach's  
     subroutine or a foreach loop.  It also can't be used to go 

And that's just perlsyn; it may well pop up elsewhere.

: 2. I'm after a complete documentation in one package. One thing that annoys
: me is when the perl docs just say 'does the same thing as the system call'
: and i have no idea what the system call does.

  perldoc -f system

: I'd like everything to be
: present in one giant package, without the need for me to go online and try
: to track down other documentation. Has this been done?

Well, define 'one giant package'.  It's all there on your hard disk,
albeit in a group of several files.  This modularity is often considered a
feature rather than a bug.  Alternatively, the Camel book provides one
giant (physical) package *and* entirely eliminates the need to go online.

You can't grep paper.  You (usually) can't flip through man pages in the
bathroom.  Each format has its advantages.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      "Ripple in still water, when there is no pebble tossed,
       nor wind to blow..."


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

Date: 22 Aug 1998 19:31:18 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Perl documentation
Message-Id: <6rnemd$1au$85@elle.eunet.no>

(Following up my own post...)

Craig Berry (cberry@cinenet.net) wrote:
: David Hawker (dhawker@removethis.bigfoot.com) wrote:
: : 2. I'm after a complete documentation in one package. One thing that annoys
: : me is when the perl docs just say 'does the same thing as the system call'
: : and i have no idea what the system call does.
: 
:   perldoc -f system

My apologies on this part; I read too hastily, and didn't see the
"system() in perl" vs. "external C-lib system() function" distinction
implicit here.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      "Ripple in still water, when there is no pebble tossed,
       nor wind to blow..."


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

Date: Sat, 22 Aug 1998 17:18:29 GMT
From: loafman@gte.net (Kenneth Loafman)
Subject: Possible to 'use strict' and Symbolic Refs?
Message-Id: <6rmurh$49p$1@news-2.news.gte.net>

OK, so here's what I'm trying to do... My script 'require's two template
files after determining which, one for input, one for output.  The
module names in them are derivable, but not fixed.  This means that I
can only have symbolic refs to the members of these packages, right?
That means that I have to turn on 'no strict refs' anywhere that I need
to access these packages, which is everywhere basically.  I would rather
'use strict' and stay with it.

So, with all the fooling around perl'ers do in the symbol table, is
there a way to 'fool' perl into thinking that these are hard references
instead, or better yet, convert them to hard references?  I have read
the books, the FAQ's, HTML, pod, etc., and just don't see a way.

 ...Thanks,
 ...Kenneth


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

Date: Sat, 22 Aug 1998 11:33:54 -0500
From: Stathy Touloumis <stathy@jaske.com>
Subject: script redirect: downloading file through browser
Message-Id: <6rnem1$1au$65@elle.eunet.no>

I need to send a file to a user accessing the script through the web. 
The file is in a directory not accessible by anyone over the web (except
through this script).  Is there an easy way to do this?  (no sym links)

Thanks,


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

Date: Sat, 22 Aug 1998 11:29:44 -0500
From: Stathy Touloumis <stathy@jaske.com>
Subject: Sending file to browser
Message-Id: <6rnem0$1au$64@elle.eunet.no>

I need to send a file to a user accessing the script through the web. 
The file is in a directory not accessible by anyone over the web (except
through this script).  Is there an easy way to do this?  (no sym links)

Thanks,


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

Date: Sat, 22 Aug 1998 16:32:22 GMT
From: maurice@hevanet.com (Maurice Aubrey)
Subject: Re: Sending file to browser
Message-Id: <6rnem1$1au$66@elle.eunet.no>

On Sat, 22 Aug 1998 11:29:44 -0500, Stathy Touloumis <stathy@jaske.com> wrote:
>I need to send a file to a user accessing the script through the web. 
>The file is in a directory not accessible by anyone over the web (except
>through this script).  Is there an easy way to do this?  (no sym links)

This is not a Perl question.  This question should have been directed to
a CGI or webserver newsgroup.

You need to password protect the directory.  Your script can do that, or
you can configure your webserver to do so.

-- 
Maurice Aubrey <maurice@hevanet.com>

The man who asks of freedom anything other than itself is born to 
be a slave. 
  - Alexis de Tocqueville


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

Date: Sat, 22 Aug 1998 16:09:46 -0500
From: Wayne Kauffman <kauffman_e_wayne_ii@lilly.com>
Subject: Termination Character removal - how?
Message-Id: <35DF339A.BC7F185B@lilly.com>

I have a CGI/application process that somehow introduces a termination
character, <SOH>, into the output file.  I further manipulate that info
to display it back to the user.  I have been unable to remove the darned
thing and  it blows up the CGI and I get no output.

in the text file it show up as follows:
                     ::::::<SOH>

How can the following code snippet be improved to really catch and
remove this nasty character?
        while (<DATAIN>) {
                chomp;
                $_ =~ s/\x01//g;
 ....

Should i preprocess the file via a shell command to strip it out?

Thanks for the enlightenment!

Wayne Kauffman
Wayne@lilly.com




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

Date: Sat, 22 Aug 1998 16:09:46 -0500
From: Wayne Kauffman <kauffman_e_wayne_ii@lilly.com>
Subject: Termination Character removal - how?
Message-Id: <6rnemg$1au$90@elle.eunet.no>

I have a CGI/application process that somehow introduces a termination
character, <SOH>, into the output file.  I further manipulate that info
to display it back to the user.  I have been unable to remove the darned
thing and  it blows up the CGI and I get no output.

in the text file it show up as follows:
                     ::::::<SOH>

How can the following code snippet be improved to really catch and
remove this nasty character?
        while (<DATAIN>) {
                chomp;
                $_ =~ s/\x01//g;
 ....

Should i preprocess the file via a shell command to strip it out?

Thanks for the enlightenment!

Wayne Kauffman
Wayne@lilly.com




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

Date: Sat, 22 Aug 1998 19:58:22 +0000
From: Alex Farber <alex@kawo2.rwth-aachen.de>
Subject: tie %h, 'DB_File'... complains about invalid arg ?
Message-Id: <6rneme$1au$86@elle.eunet.no>

Hi,

I have a strange situation, when using DB_File module
at my RedHat 5.1 Linux with Perl 5.004 patch 04:

I can use tie only once. When my script is called next time,
I get an "invalid argument" message. I wonder what could be
the reason and would appreciate any ideas. The perldoc DB_File
says, that there should be no references to the data-base
or the destructor won't be called on it. But I undef $dbh,
please see the code snippet below:

Greetings
Alex

--
http://www.simplex.ru/pref.html


########################################
    if (param ('button') eq 'Remove')
    {
	if (not $dbh = tie (%dbm, 
	    'DB_File', 
	    $DIR . param ('dbm')))
        { 
	    print 'can`t tie ' . $!; 
	}
	elsif (not open DBM, '>>&=' . $dbh -> fd) 
        { 
	    print 'can`t write';
	}
	elsif (not flock DBM, LOCK_EX)
	{
	    print 'can`t lock';
	}
	else
        {
	    delete $dbm{$url};

	    $dbh -> sync;
	    flock DBM, LOCK_UN;
	    close DBM;
	    undef $dbh;
	    untie %dbm;

	    print "Okay, removed http://$url !\n";
	}
    }
################################################
   elsif (param ('button') eq 'Store')
    {
	if (length (param ('name')) < 2)
	{
	    print 'wWEDITE NAZWANIE!';
	}
        elsif (not $dbh = tie %dbm, 
	                   'DB_File', 
                           $DIR . param ('dbm'))
	{ 
	    print 'can`t tie'; 
	}
	elsif (not open DBM, '>>&=' . $dbh -> fd) 
	{
	    print 'can`t write';
	}
	elsif (not flock DBM, LOCK_EX)
	{
	    print 'can`t lock';
	}
	else
        {
	    $dbm{$url} = join "\n", 
	    param ('name'), 
	    param ('period'), 
	    param ('class'), 
	    param ('clicks'), 
	    param ('probs');

	    $dbh -> sync;
	    flock DBM, LOCK_UN;
	    close DBM;
	    undef $dbh;
	    untie %dbm;

	    print "Okay, stored http://$url !\n";
	}
    }


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

Date: Sat, 22 Aug 1998 16:45:01 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: tie %h, 'DB_File'... complains about invalid arg ?
Message-Id: <1de694w.17bsvpa4osnqwN@bay1-409.quincy.ziplink.net>

Alex Farber <alex@kawo2.rwth-aachen.de> wrote:

> I can use tie only once. When my script is called next time,
> I get an "invalid argument" message.

Next time, save the actual error message so you can post it to the
newsgroup.  You're more likely to get a useful answer that way.

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Sat, 22 Aug 1998 16:45:01 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: tie %h, 'DB_File'... complains about invalid arg ?
Message-Id: <6rnemf$1au$88@elle.eunet.no>

Alex Farber <alex@kawo2.rwth-aachen.de> wrote:

> I can use tie only once. When my script is called next time,
> I get an "invalid argument" message.

Next time, save the actual error message so you can post it to the
newsgroup.  You're more likely to get a useful answer that way.

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Sat, 22 Aug 1998 18:26:17 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Turn Perl program into binary
Message-Id: <fl_aggie-2208981826170001@aggie.coaps.fsu.edu>

In article <wxxaf4x919f.fsf@gladsheim.ifi.uio.no>, Terje Kvernes
<terjekv@ifi.uio.no> wrote:

+ like:
+ $pass = "XrdKIkaN/ucs4";
+ chomp($try = <>)
+ if ($try eq $pass) {
+         let's go!
+ }
+ 
+ or am I missing something here?
+ 

Yeah, like encrypting $try before comparing it to an encrypted password...

James - :)


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

Date: 22 Aug 1998 11:51:52 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: Jeffery Cann <jc_cann@ix.netcom.com>
Subject: Re: Warnings when dereferencing hashes?
Message-Id: <6rnelr$1au$56@elle.eunet.no>

Jeffery Cann <jc_cann@ix.netcom.com> writes:

> Use of uninitialized value at ./deref.pl line 12 (#1)

You didn't make clear which line in your program was generating that
error.  However, it seems to be the case that you're using $jeff{NAME}
as if it were defined, and it's not.  To check the existence of a hash
key, use exists(), like so:

   if (exists $jeff{NAME}) {
     # use $jeff{NAME} somehow
   }

Or you can supply $jeff{NAME} with a default value:

   $jeff{NAME} ||= 'default value';

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


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

Date: Sat, 22 Aug 1998 12:14:25 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Warnings when dereferencing hashes?
Message-Id: <6rnelu$1au$61@elle.eunet.no>

Jeffery Cann <jc_cann@ix.netcom.com> wrote:

> print "Name entered: $jeff{'NAME'}\n";

The problem is that you are interpolating an undefined value into a
string, as $jeff{'NAME'} is undefined.

To make sure $jeff{'NAME'} gets defined, you could do this:

if (not defined $jeff{'NAME'}) {
  $jeff{'NAME'} = '';  # or 'undefined' or whatever
}

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Sat, 22 Aug 1998 13:17:14 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Warnings when dereferencing hashes?
Message-Id: <6rnem5$1au$71@elle.eunet.no>

Jonathan Feinberg <jdf@pobox.com> wrote:

> Jeffery Cann <jc_cann@ix.netcom.com> writes:
> 
> > Use of uninitialized value at ./deref.pl line 12 (#1)
> 
> You didn't make clear which line in your program was generating that
> error.  However, it seems to be the case that you're using $jeff{NAME}
> as if it were defined, and it's not.  To check the existence of a hash
> key, use exists(), like so:
> 
>    if (exists $jeff{NAME}) {
>      # use $jeff{NAME} somehow
>    }

Of course, you can still get the warning if $jeff{NAME} exists but is
not defined.  It would be better to simply call defined there instead of
exists.

> Or you can supply $jeff{NAME} with a default value:
> 
>    $jeff{NAME} ||= 'default value';

Note that this will also replace the defined values '' and 0, which may
be okay in most cases, but it's worth keeping in mind.

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Sat, 22 Aug 1998 14:56:23 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: Why dont people read the FAQs
Message-Id: <6rnekj$1au$1@elle.eunet.no>

On 18 Aug 1998 10:40:43 +0200, in article
<u7yasmof78.fsf@mch2pc21.tuwien.ac.at>, Alois Steindl
<asteindl@mch2pc21.tuwien.ac.at> wrote:

>Jonathan Feinberg <jdf@pobox.com> writes:
>
>> Remember that the replies to a given post may not have propagated when
>> someone posts their own reply.  How can you know that 5 other people
>> have already posted replies?
>> 
>> -- 
>> Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
>> http://pobox.com/~jdf/
>
>Hello,
>I don't think it's necessary at all to post such replies. Maybe the
>traffic in this newsgroup could be reduced considerably, if answers to
>FAQs were send by email: If a FAQ generates 5 responses with pointers
>to the FAQ, the traffic caused by these answers is maybe much larger
>than by the question itself.

Then there's no sense having a newsgroup. Make a listserve.  One of the good
things about newsgroups is that you might get 5 different but correct answers
to a question.  Another is that if someone suggests wrong, others are there to
help him and the one asking the question to learn.  If 5 people each send an
email message, who's to know the answers are correct or if they're all very
different, that they're all still correct?

-- 
      I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
                  How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore                       |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH!                                  |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3 3 4 1 4 2  ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups.          |     Official Proof of Purchase
===========================================================================


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

Date: Sat, 22 Aug 1998 14:53:52 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: Why dont people read the FAQs
Message-Id: <6rnekl$1au$3@elle.eunet.no>

On 17 Aug 1998 15:29:28 -0500, in article <lnontkrb.fsf@mailhost.panix.com>,
Jonathan Feinberg <jdf@pobox.com> wrote:

>Richard Proctor <Richard@waveney.demon.co.uk> writes:
>
>> When someone asks a FAQ, yes tell them its in the documents once. It
>> does not need 6 people to say its in the FAQ
>
>Remember that the replies to a given post may not have propagated when
>someone posts their own reply.  How can you know that 5 other people
>have already posted replies?

Hehehe. You could wait three weeks before answering. :)

-- 
      I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
                  How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore                       |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH!                                  |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3 3 4 1 4 2  ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups.          |     Official Proof of Purchase
===========================================================================


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

Date: Sat, 22 Aug 1998 14:53:25 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: Why dont people read the FAQs
Message-Id: <6rnekm$1au$4@elle.eunet.no>

On Mon, 17 Aug 1998 20:23:08 +0100, in article
<ant171908b49Rr9i@waveney.demon.co.uk>, Richard Proctor
<Richard@waveney.demon.co.uk> wrote:

>Why do we get so many questions here that are in the FAQ?
>
>These could be because:-
>
>0) People cant read (if so why are they writing)
>
>1) People have never heard of a FAQ (Unlikely)
>
>2) People are lazy (True - see Camel)
>
>3) The FAQs and Man pages are large, it is sometimes possible
>to miss somthing esoteric (This should be acceptable - I did it once)
>
>4) People are Impatient (True - see Camel)
>
>5) A lot of people, I suspect, post questions without ever having read
>clp.misc before (True)
>
>6) Perl is popular (Very True)
>
>7) A lot of postings come to clp.misc that are really about servers and cgi,
>this represents a major use of perl and results from people looking here
>because of the perl content, maybe there should be a clp.cgi?

DingDingDingDing.  Now this makes sense.  Great idea.


>
>8) I am not sure that Hubris comes into it though, with Hubris you solve
>the problem without the FAQ, or CPAN or clp.misc ...
>
>When someone asks a FAQ, yes tell them its in the documents once. It does not
>need 6 people to say its in the FAQ, it does not  need a flame war.

Right. When someone _politely_ says: "The answer is ... and it's in the faq,
it works better than: "it's in the f*cking faq and you must be a lazy bum if
you didn't read it"

>
>Perhaps it requires one to step back from the war and ask WHY are there so
>many questions?  Are there ways to reduce the number?  Should perl print out
>"Read the FAQs" before it even looks at the script? (Supressable, by looking
>at the FAQs!)

Hehehe.  Better yet, those who hate to see the same question asked several
times should ignore them and let others who have yet to become bored with them
answer.

>
>NB Abigails posts may be curt, but are generaly right and often amusing,
>and there is an awfull lot of perl to be learnt from her sigs.

So you'd find it amusing if someone called you a clueless moron for asking a
question that was covered somewhere in the faq but you just couldn't find it
and your boss wanted you to get the damn thing working today.  Right.
-- 
      I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
                  How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore                       |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH!                                  |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3 3 4 1 4 2  ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups.          |     Official Proof of Purchase
===========================================================================


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

Date: Sat, 22 Aug 1998 12:14:27 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Why dont people read the FAQs
Message-Id: <6rnelv$1au$62@elle.eunet.no>

<lvirden@cas.org> wrote:

> According to Craig Berry <cberry@cinenet.net>:
> :Larry Rosler (lr@hpl.hp.com) wrote:
> :: Owen Cook <rcook@pcug.org.au> says...
> :: > unless((length($CCNumber) == 16) && ($CCNumber=~ /\d{16}/))
> ::   unless ($CCNumber =~ /^\d{16}$/)
> :If, as was discussed under a different topic a couple of weeks ago, you
> :either know $CCNumber has no trailing newline, or don't mind one if it's
> :there.
> 
> So length ignores the newline?  The original code shows clearly the variable
> is to match only if there are only the 16 digits of the credit card number
> in the field.  So the original would also fail with a training newline.

No, length doesn't ignore the newline.  That's the point.  If the length
of $CCNumber is 16, *including a newline*, then obviously /\d{16}/ will
not match.  Thus, using length ensures the exact number of digits.

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 22 Aug 1998 18:47:12 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Why dont people read the FAQs
Message-Id: <6rnema$1au$79@elle.eunet.no>

lvirden@cas.org wrote:
: According to Craig Berry <cberry@cinenet.net>:
: :Larry Rosler (lr@hpl.hp.com) wrote:
: :: In article <35db0173.1744952@newshost.pcug.org.au> on Tue, 18 Aug 1998 
: :: 23:13:38 GMT, Owen Cook <rcook@pcug.org.au> says...
: :: > unless((length($CCNumber) == 16) && ($CCNumber=~ /\d{16}/))
: ::   unless ($CCNumber =~ /^\d{16}$/)
: :If, as was discussed under a different topic a couple of weeks ago, you
: :either know $CCNumber has no trailing newline, or don't mind one if it's
: :there.
: 
: So length ignores the newline?

No; I was commenting on Larry's version:

  unless ($CCNumber =~ /^\d{16}$/)

which uses only the {16} quantifier and explicit start- and end-anchors to
bound the length.  The tricky part is that the end-anchor can match at
actual end of string *or* before a trailing newline.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      "Ripple in still water, when there is no pebble tossed,
       nor wind to blow..."


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

Date: 22 Aug 1998 21:06:51 GMT
From: ronaldws@aol.com (RonaldWS)
Subject: Win32 perl, XS and VC++ 6
Message-Id: <1998082221065100.RAA17826@ladder03.news.aol.com>

I am looking to do some XS work with the new ActiveState Perl 5.005.  Does
anyone know if this can be done with VC++6?  Any known compatibility problems? 
Am I one of the few at this bleeding edge?

Ronald Schmidt
The Software Path
RonaldWS@aoftware-path.com


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

Date: Sat, 22 Aug 1998 13:43:52 -0700
From: "Michael A. King" <kingm@vmicro.com>
Subject: Win32::RasAdmin -- Setting NT RAS permissions with PERL!
Message-Id: <35df2d95.0@news.vmicro.com>

I am trying to grant dialin privileges to existing NT user accounts using
Dave Roth's RasAdmin module which appears to be a tool to call Microsoft's
RASSAPI.DLL.  I need to be able to toggle the RASPRIV_DialinPrivilege flag,
but cannot get RasAdmin to do this.

I am calling it like this:

Win32::RasAdmin::UserSetInfo($Server,$UserName, RASPRIV_DialinPrivilege,
0x8)

I am assuming that this is proper syntax -- no errors are generated, but the
code isn't returning a successful result.  I would imagine if I am doing
anything wrong it is with the flag and value (RASPRIV_DialinPrivilege and
0x8) . . . . Does this need to be dealt with bitwise?  It appears from the C
APIs that I have seen that there is a byte value that is set to toggle
certain RAS flags, and that the 00001000 is the way to enable RAS Dialin
(010 octal or 0x8 hex), correct?

Anyhow, any help / insight with this pesky little problem would be
appreciated!

Sincerely,

--Michael King
--Director, Technical Operations
--VM Online / VM2000
--Temecula, CA









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

Date: Sat, 22 Aug 1998 13:43:52 -0700
From: "Michael A. King" <kingm@vmicro.com>
Subject: Win32::RasAdmin -- Setting NT RAS permissions with PERL!
Message-Id: <6rneme$1au$87@elle.eunet.no>

I am trying to grant dialin privileges to existing NT user accounts using
Dave Roth's RasAdmin module which appears to be a tool to call Microsoft's
RASSAPI.DLL.  I need to be able to toggle the RASPRIV_DialinPrivilege flag,
but cannot get RasAdmin to do this.

I am calling it like this:

Win32::RasAdmin::UserSetInfo($Server,$UserName, RASPRIV_DialinPrivilege,
0x8)

I am assuming that this is proper syntax -- no errors are generated, but the
code isn't returning a successful result.  I would imagine if I am doing
anything wrong it is with the flag and value (RASPRIV_DialinPrivilege and
0x8) . . . . Does this need to be dealt with bitwise?  It appears from the C
APIs that I have seen that there is a byte value that is set to toggle
certain RAS flags, and that the 00001000 is the way to enable RAS Dialin
(010 octal or 0x8 hex), correct?

Anyhow, any help / insight with this pesky little problem would be
appreciated!

Sincerely,

--Michael King
--Director, Technical Operations
--VM Online / VM2000
--Temecula, CA









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

Date: 12 Jul 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 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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