[8265] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1882 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 12 20:07:30 1998

Date: Thu, 12 Feb 98 17:00:26 -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           Thu, 12 Feb 1998     Volume: 8 Number: 1882

Today's topics:
    Re: ? Regular Expressions ? <rra@stanford.edu>
        `-w' should warn on ({} + 0) <junio@twinsun.com>
    Re: Clearing all variables (Martien Verbruggen)
    Re: Creating HTML documentation <rra@stanford.edu>
    Re: CRs in scripts - ARGH! <rra@stanford.edu>
    Re: does perl store the shattered remains of an attempt <rra@stanford.edu>
        Elegance with File::Find <pdcawley@bofh.org.uk>
    Re: Elements in a hash <rra@stanford.edu>
    Re: FAQless Forays (was: Code Example Needed) <dgwilson@gte.net>
    Re: FAQless Forgays <rra@stanford.edu>
    Re: FTP as filehandle <dgoddard@us.oracle.com>
    Re: FTP as filehandle <rra@stanford.edu>
    Re: Help: "use strict" & passing variables to subroutin <rra@stanford.edu>
    Re: HUMOR: Userspeak vs Hackerspeak <pdcawley@bofh.org.uk>
    Re: Killfile Triage (Martien Verbruggen)
    Re: on reading FAQs and gurus answering questions <rra@stanford.edu>
    Re: PLEASE HELP!!! <dgoddard@us.oracle.com>
        Porting a forking server to WinNT <joe@ispsoft.de>
    Re: Problems with sendmail code (Martien Verbruggen)
    Re: Reload/unload modules? <rra@stanford.edu>
        Searching for FAQs (patch to perldoc) <pdcawley@bofh.org.uk>
    Re: So what about last summer's RFD?  Let's go moderate <rra@stanford.edu>
    Re: TENDERS INVITED (Martien Verbruggen)
    Re: testing cgi-perl before submitting to server (Martien Verbruggen)
    Re: time for comp.lang.perl.more-needed ? (Re: repetiti <rra@stanford.edu>
    Re: Tom wins flamer of the year award! (Will Morse)
    Re: WWW Page <rra@stanford.edu>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 12 Feb 1998 16:09:00 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: ? Regular Expressions ?
Message-Id: <m3btwce57n.fsf@windlord.Stanford.EDU>

Myles Barrett Williams <a@b.c.d> writes:

> I downloaded and installed the djgpp build of Perl.  I don't have the
> manuals on my machine.  Go figure.

Have you reported this bug to the maintainer of the djgpp build of Perl?

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 12 Feb 1998 16:03:48 -0800
From: Junio Hamano <junio@twinsun.com>
Subject: `-w' should warn on ({} + 0)
Message-Id: <7vpvks5q1n.fsf@dew.twinsun.com>

Perl 5.004_04 seems to silently coerce a reference into an
integer, but I do not see this documented anywhere.  I do not
get any warning from the program below:

    #!/local/bin/perl -w

    use strict;
    my $r = {};
    my @aor = ({}, {}, {});
    my ($not_in_void_context, @not_in_void_context);

    $not_in_void_context = ($r == $r) || ($r eq $r);
    @not_in_void_context = sort { $a < $b } @aor;
    printf "$r 0x%x\n", ($r+0);

I think `use strict' and `-w' should give a warning when a
reference is coerced into an integer for any reason other than
being on either rhs or lhs of a numerical comparison operator.

I noticed this behavior when I was trying to figure out whether
I should use `==' or `eq' to find out if two objects are the
same.  The document (perlop.pod) states that `==' is for
numerical comparison and `eq' is for string comparison, but I
could not found anywhere in the document how to compare
references.  From my experience, either of the following yields
true if and only if $a and $b are references to the same thingy:

    (ref $a && ref $b && $a == $b)
    (ref $a && ref $b && $a eq $b)

Tie::RefHash uses "$ref" as a hash key; this probably means 
the stringify form is preferred (i.e. one writes `$a eq $b').

Anyway, the above assumes that the hexadecimal number that
appear in "$ref" or that is returned by ($ref + 0) is the
address of the thingy (or some other number uniquely identifies
the thingy) $ref refers to.

Although this kind of implementation details should be best left
out from the language documentation for future implementation
changes, giving some kind of guarantee to let programers compare
references portably and reliably seems to be in order.  How
about stating something like this?

    Using a reference on either side of a numerical comparison
    operator coerces the reference into an integer.  The
    resulting integer obtained by such a coersion is guaranteed
    to be the same for references referring to the same thingy
    during the thingy's lifetime.  Also, if two references
    referring to different thingies are coerced into integers,
    the results are guaranteed to be different.


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

Date: 12 Feb 1998 22:54:24 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Clearing all variables
Message-Id: <6bvuj0$ak4$3@comdyn.comdyn.com.au>

In article <34e33aa2.0@myth.vianet.on.ca>,
	"Lainer" <elaine@lainer.com> writes:
> I am calling it as a separate executable using "require" at the end of the
> loop.

Then you are NOT calling it as a seperate process. You would need
system, exec, backticks or qx// for that.

perldoc -f require

Please read.
Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | If at first you don't succeed, try
Commercial Dynamics Pty. Ltd.       | again. Then quit; there's no use being
NSW, Australia                      | a damn fool about it.


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

Date: 12 Feb 1998 16:06:41 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Creating HTML documentation
Message-Id: <m3en18e5bi.fsf@windlord.Stanford.EDU>

Philip Snyder <prsnyder@bewley.net> writes:

> Global symbol "i" requires explicit package name at lib/Pod/Html.pm line 298,
> <DATA> chunk 208.
> Variable "$i" is not imported at lib/Pod/Html.pm line 299, <DATA> chunk 208.
> Global symbol "i" requires explicit package name at lib/Pod/Html.pm line 299,
> <DATA> chunk 208.
> Missing $ on loop variable at lib/Pod/Html.pm line 300, <DATA> chunk 208.
> BEGIN failed--compilation aborted at ./installhtml line 10, <DATA> chunk 208.

What version of Perl are you running this under?  Are you using the same
version of Perl as the Pod::Html module came with?  These errors sound to
me like you're not using the Pod::Html version corresponding to the Perl
that you're running.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 12 Feb 1998 16:21:18 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: CRs in scripts - ARGH!
Message-Id: <m3ra58cq2p.fsf@windlord.Stanford.EDU>

David Hardy <dhardy@beagle.colorado.edu> writes:

> Does anyone know of an easy way to make perl accept CR/LFs as well as
> just LFs in scripts? It's a pain in the neck to have to convert when I
> write scripts on my PC.

Why?  Wouldn't:

        perl -i~ -pe 'tr/\r//d'

do it for you?  (Yes, I know, there's a cool one-liner that just uses
flags to do this, but this one is more readable.  :))

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 12 Feb 1998 16:16:17 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: does perl store the shattered remains of an attempted match?
Message-Id: <m3zpjwcqb2.fsf@windlord.Stanford.EDU>

Kevin B Cohen <kcohen@julius.ling.ohio-state.edu> writes:

> sometimes a match fails, but i'd like to know if it was able to match
> even some bit, particularly towards its leftmost edge.  for instance, if
> i've got some RE like

> 	(dog|cat|trilobite)\s<bunch of arcane stuff here>

> i might want to know something like "if it failed, did it at least reach
> the bunch of arcane stuff?"

I don't believe Perl stores that information; I think the best you can do
is retry the match without the arcane stuff and see if that succeeds.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 12 Feb 1998 20:51:56 +0000
From: Piers Cawley <pdcawley@bofh.org.uk>
Subject: Elegance with File::Find
Message-Id: <m3k9b0fswj.fsf@tower.bofh.org.uk>

I've been going through some of my old code with an eye to tidying it
up and making it a little less embarrassing, (It is amazing how nasty
your old code can look when you come back to it after you've finished
reading the Jaguar and the Pearl) and I came across this little chunk
of ugliness:

#!/usr/bin/perl -w

use File::Find;

# Check the directory $dir to see if any of the files it contains have
# been modified since $last_time. $last_time is a unix time() type
# value.

sub update_p {

    my $dir        = shift;     # Directory to check.
    my $last_visit = shift;     # Last time we checked, (unix time)
    my $full       = undef;     # A flag, set if dir is full
    
    $last_visit  ||= 0;         # Keep -w happy.
    
    my $days_ago   = (time - $last_visit) / 86400;
      
    my $wanted     = sub {
	return unless -f $File::Find::name;
	if (-M _ < $days_ago) {
	    $updated = 1;
	    die;
	}
    };
    
    eval {
	File::Find::find($wanted, $dir);
    };
    
    if ($@ and not $updated) {
	warn $@;
	return undef;
    }
    return $updated;    
}

Every time I look at this it tends to look uglier. What do people
think? Am I better off doing a 'local ($updated,$days_ago)' and moving 'wanted'
out to be a subroutine proper? I've also tried something like:

my $wanted = sub {
   return unless -f $File::Find::name;
   $updated++, last WRAPFIND if -M _ < $days_ago;
}

WRAPFIND: {
   File::Find::find($wanted, $dir);
}

but then -w tells me everytime I break out of the WRAPFIND block with
last. (And, without inspecting File::Find, how can i be sure that
WRAPFIND is a unique label)? 

Benchmark doesn't help too much, the various options seem to be much
of a muchness...

-- 
Piers Cawley
If a `religion' is defined to be a system of ideas that contains
unprovable statements, then Godel taught us that mathematics is not
only a religion, it is the only religion that can prove itself to be
one. -- John Barrow


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

Date: 12 Feb 1998 16:20:04 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Elements in a hash
Message-Id: <m3u3a4cq4r.fsf@windlord.Stanford.EDU>

Holly Sommer [munged address] writes:

> for ( $total =0; $total<$count; $total++ ) {
>    print STDOUT "Record Number: $total\n";
>    print STDOUT "Course: $records[$total]{course_name}\n";
>    print STDOUT "Classes: $records[$total]{classes}\n";
>    print STDOUT "Description: $records[$rtotal]{description}\n";
                                         ^^^^^^^
>    print STDOUT "URL: $records[$total]{url}\n";
>    print STDOUT "Groups: $records[$total]{groups}\n";
>    print STDOUT "Keywords: $records[$total]{keywords}\n";
>    print STDOUT "\n==========================================\n\n";
> }

> So, I run the script, and it lists the {description} for $records[0]
> on all records.

That's because you have a typo.  If you'd run your script under -w, it
would have warned you about that.  Hope this helps!

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Thu, 12 Feb 1998 18:53:47 -0500
From: Douglas Wilson <dgwilson@gte.net>
Subject: Re: FAQless Forays (was: Code Example Needed)
Message-Id: <6c0200$anc$1@gte1.gte.net>

Frank@but_dont_use_this.address wrote:
> 
> Hello all!

> My problem with the FAQs is, that I do not know the questions.
> 
> Example from current code:
> 
> (I try to concatenate all lines in a file to a string)

>         $data ="";
>         open MULT_HANDLE, "<$file" || die "ERROR: can't read $!";
>         @files = <MULT_HANDLE>;
>         close (MULT_HANDLE);
>         foreach $aLine (@files) {
>             $data .= $aLine;
>         }

The foreach loop could be replaced with:
$data=join "",@files;
> again: My problem with the FAQs is, that I do not know the
> questions(keywords to search for).

Should have searched for 'join' :)
I've read the FAQs but I too have not become one with them, and
sometimes
the thing you're looking for doesn't jump out.

(posted from a PC cuz thats what's on my desk)
Hope that helps,
Douglas Wilson


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

Date: 12 Feb 1998 16:13:30 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: FAQless Forgays
Message-Id: <m367mke505.fsf@windlord.Stanford.EDU>

Wef [munged address] writes:

> I think you should find a reputable psychiatrist to perscribe some
> seratonin re-uptake inhibitors for that obsessive-compulsive disorder.
> Maybe he can help you to release some of that anger...

I think people who use Usenet had better start getting used to the idea
that good posters are not necessarily a renewable resource, that
*repeatedly* and *intentionally* asking stupid questions in public is a
bad idea, and that sometimes when people get angry it's because there's a
reason to be angry.

Otherwise, all of the new Perl users are likely to end up talking to
themselves.  And then who's going to answer their questions?

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Thu, 12 Feb 1998 16:13:23 -0800
From: Denis Goddard <dgoddard@us.oracle.com>
Subject: Re: FTP as filehandle
Message-Id: <34E39023.55EEAFAF@us.oracle.com>

Reilly Shea wrote:
> 
> open(FTP,|ftp somemachine");

You will find it well worth your while to rewrite this using Net::FTP,
latest version is at:

http://www.perl.com/CPAN-local/modules/by-category/05_Networking_Devices_Inter_Process/Net/libnet-1.0605.tar.gz

It may seem like a slight learning curve at first (depending on how much you
have used other CPAN modules in the past) but you will find it is well
worth the effort!


-Denis

-- 
     __  __  _  __     __
~~~~(__)|-< /-\(__ |__(-_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Denis Goddard, Senior Member, Tech. Staff  |"I see the heads of men arise
email: dgoddard@us.oracle.com              |with hungry minds and open eyes!"
ourworld.compuserve.com/homepages/d_goddard| -Rush, from 2112: _The Oracle_


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

Date: 12 Feb 1998 16:30:08 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: FTP as filehandle
Message-Id: <m3iuqkcpnz.fsf@windlord.Stanford.EDU>

Reilly Shea <traveler@rust.net> writes:

>   I open an ftp process as a filehandle doing the following..
> open(FTP,|ftp somemachine");

You don't want to do this.  You want to use Net::FTP instead and save
yourself hours and hours of headaches.  The Unix command-line ftp client
does a poor job at being run noninteractively in this fashion and really
doesn't deal with it very well even when you can get it working.

> I've tried looking at $? but it comes back 0 successful or not. This
> actually makes sense since I'm technically not doing a system call (am
> I?).

You're confusing $? with $!.  $! gives you the status of system calls; $?
gives you the exit status of the last subprocess you ran.  In this case,
it sounds like ftp is always exiting with status 0 even if it failed.
This is arguably a bug in ftp.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 12 Feb 1998 16:25:47 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Help: "use strict" & passing variables to subroutine
Message-Id: <m3oh0ccpv8.fsf@windlord.Stanford.EDU>

Please don't post in HTML.  You risk not getting any responses that way,
since I'm sure a lot of people have either filtered your post out at the
news server level or have killfiled you.  There should be an option in
your newsreader that controls posting in HTML; you'll want to turn it off.

In comp.lang.perl.misc, Tommy <tkho@technologist.com> writes:

> I am a novice in using strict.pm. Does anyone know how to correct this
> script to make it work with "use strict". The only problem is that I
> can't declare the variable "*id" and "*in" in the main program.

Why are you using typeglobs at all?  The number of cases in which you
really want to do that is quite small.

> sub ParseTable {
>   local(*id,*in);

What you really seem to be doing here is using a hash named %in and an
array named @id.  So you want to just delcare those instead of trying to
localize a typeglob.  Change this line to:

        my (@id, %in);

and see if that works better.  Hope this helps!

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 12 Feb 1998 20:30:30 +0000
From: Piers Cawley <pdcawley@bofh.org.uk>
Subject: Re: HUMOR: Userspeak vs Hackerspeak
Message-Id: <m3lnvgftw9.fsf@tower.bofh.org.uk>

12 Feb 1998 01:18:14 GMT Tom Christiansen <tchrist@mox.perl.com> comp.lang.perl.misc
>         C:\                          root# 
                                       ^^^^^
Oops, Tom just failed the sysadmin test. YM, '$', HTH, HAND.

>     online documentation        manpage
      ^^^^^^^^^^^^^^^^^^^^

Given your current crusade, I'm surprised you think PoBs even know
what this phrase means.

-- 
You're stupid, I'm rude -- Dick Solomon


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

Date: 13 Feb 1998 00:12:44 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Killfile Triage
Message-Id: <6c035s$b49$7@comdyn.comdyn.com.au>

In article <34E30D05.BECB7CA8@integrityonline.com>,
	Mike Noel <noel@integrityonline.com> writes:
> Of course, the problem with posting killfiles is that people who want you to
> read their post but still don't have anything good to say now know how to
> avoid your killfile.  That is, the posting could have been titled, "What not
> to put in your message if you want the smart people to read it".

Provided they would know what a killfile was in the first place, or
how to change the behaviour of their 'news reader' to avoid it.  :)

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | In a world without fences, who needs
Commercial Dynamics Pty. Ltd.       | Gates?
NSW, Australia                      | 


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

Date: 12 Feb 1998 16:33:53 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: on reading FAQs and gurus answering questions
Message-Id: <m3g1locphq.fsf@windlord.Stanford.EDU>

Marc Haber <Marc.Haber-usenet@gmx.de> writes:

> "Give a little, get a little" is the formular that makes Usenet work.
> But you gotta see Usenet as a whole, not only clpm. Who doesn't have a
> clue about perl might be a Windows NT, X or hardware wizard and may
> perhaps spend as much time as you do here "answering" FAQs in "his" home
> group.

I would be delighted if this were, in fact, the case, but unfortunately
it's not.  And even then, I have no problems answering questions from
people who don't yet know enough about any topic to be able to answer
questions themselves.  I don't mind, and even enjoy, paying forward to the
next generation.

It would be nice to see some acknowledgement from the people being helped
that that's what it is, though, and that they have a responsibility now to
the community as a whole to help out when *they* can.  Some people
understand this.  Depressingly many don't.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Thu, 12 Feb 1998 16:06:28 -0800
From: Denis Goddard <dgoddard@us.oracle.com>
To: A M Borregana <A.Migueis@shef.ac.uk>
Subject: Re: PLEASE HELP!!!
Message-Id: <34E38E84.4C441E@us.oracle.com>

A M Borregana wrote:

[a cry for help]

Please browse http://www.perl.com
You will especially want to:
1. Download the newest version of Perl for Windows
2. read the FAQs related to Perl for Windows
3. read the part of the FAQ about CGI programming

Only after you have carefully read these things are you likely to
be able to be helped.

Hope this helps..

-Denis


-- 
     __  __  _  __     __
~~~~(__)|-< /-\(__ |__(-_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Denis Goddard, Senior Member, Tech. Staff  |"I see the heads of men arise
email: dgoddard@us.oracle.com              |with hungry minds and open eyes!"
ourworld.compuserve.com/homepages/d_goddard| -Rush, from 2112: _The Oracle_


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

Date: Fri, 13 Feb 1998 00:49:46 +0100
From: Jochen Wiedmann <joe@ispsoft.de>
Subject: Porting a forking server to WinNT
Message-Id: <34E38A9A.CC6E3CF3@ispsoft.de>

Hello,

any hints for doing this? Of course I'd prefer a Perl solution,
but hints for a C version would still be welcome.

Thanks,

Jochen

P.S: Btw, I've noted that some people consider a fork()-ing server
as multithreaded?


-- 
Jochen Wiedmann					joe@ispsoft.de
						07123 14887


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

Date: 12 Feb 1998 22:46:03 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Problems with sendmail code
Message-Id: <6bvu3b$ak4$1@comdyn.comdyn.com.au>

In article <34E334F6.23A2@magma.ca>,
	Stephen Foley <sfoley@magma.ca> writes:
> #!/usr/bin/perl5

No -w.

no 'use strict'.
no 'use CGI'.

[snip decoding stuff]

CGI.pm will do that for you, probably much more reliable and more correctly.

[snipped lots of commented out stuff]

> $toaddr = "sfoley\@magma.ca";
> 
> # Open the mail client and begin to send
> open (MAIL, "|usr/sbin/sendmail $toaddr");

Not checking for any return codes?  How do you know if this open
succeeded?

Is $toaddr always under your control? Are you always 100 % certain
that it doesn't contain things like 'blabla@bla.com; rm -rf /*" ?
This is an accident waiting to happen.

You should consider using one of the modules on CPAN to do the
mailing. It's a lot more reliable.

> print MAIL "From: Internet\n";

[lots of prints snipped]

Use a here-document syntax as specified in the perldata documentation:

print <<EOCRAP;
blabla
more blabla $blabla
EOCRAP

> close(MAIL);
> 
> select(stdout);
> $| = 1;
> 
> print <<END2;

Oh! So you DO know about the here-document syntax?

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | For heaven's sake, don't TRY to be
Commercial Dynamics Pty. Ltd.       | cynical. It's perfectly easy to be
NSW, Australia                      | cynical.


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

Date: 12 Feb 1998 16:11:07 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Reload/unload modules?
Message-Id: <m390rge543.fsf@windlord.Stanford.EDU>

Rauli Ruohonen <raulir@voimax.cygnnet.jkl.fi> writes:

> Is it possible to reload or unload modules? Python has "reload()" but
> perl seems to have nothing. I tried to remove a module by deleting its
> symbol table entries, but it doesn't free all the memory the module has
> allocated. Is there a way to do this cleanly or otherwise?

I think the right question to ask is why you want to do this.  I don't
believe there's any way to free the space used by the bytecompiled module
code, but the module itself should be providing a way to free its data
structures or otherwise managing them.

There isn't anything magical about Perl module loading, so there shouldn't
be any need to "reload" them; if you tell us what you're trying to do, we
can probably find a good way to do it.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 12 Feb 1998 23:09:49 +0000
From: Piers Cawley <pdcawley@bofh.org.uk>
Subject: Searching for FAQs (patch to perldoc)
Message-Id: <m3iuqkfmiq.fsf@tower.bofh.org.uk>

What with all the recent kerfuffle about folks being too lazy to
search the FAQs properly I thought it might be a good idea to share
the following patch to perldoc. In the spirit of the ever popular
'perldoc -f FuncName' I offer, 'perldoc -q RegEx', which searches the
list of faqs for questions that match the given regex and prints them
out, together with the appropriate answer and some indication of the
particular .pod they came from. Eg:

$ perldoc -t -q 'larry wall'
Found in /usr/lib/perl5/pod/perlfaq1.pod
  Where can I get a list of Larry Wall witticisms?

            Over a hundred quips by Larry, from postings of his or source
            code, can be found at http://www.perl.com/CPAN/misc/lwall-quotes
            .

Okay, here's the patch:

*** perldoc	1998/02/12 22:31:17	1.1
--- perldoc	1998/02/12 23:03:16
***************
*** 19,24 ****
--- 19,25 ----
  	die <<EOF;
  Usage: $me [-h] [-v] [-t] [-u] [-m] [-l] PageName|ModuleName|ProgramName
         $me -f PerlFunc
+        $me -q FAQKeywords
  
  We suggest you use "perldoc perldoc" to get aquainted 
  with the system.
***************
*** 41,46 ****
--- 42,48 ----
      die <<EOF;
  perldoc [options] PageName|ModuleName|ProgramName...
  perldoc [options] -f BuiltinFunction
+ perldoc [options] -q FAQRegex
  
  Options:
      -h   Display this help message
***************
*** 51,56 ****
--- 53,59 ----
      -l   Display the modules file name
      -v	 Verbosely describe what's going on
  
+ 
  PageName|ModuleName...
           is the name of a piece of documentation that you want to look at. You 
           may either give a descriptive name of the page (as in the case of
***************
*** 61,67 ****
  BuiltinFunction
           is the name of a perl function.  Will extract documentation from
           `perlfunc'.
!          
  Any switches in the PERLDOC environment variable will be used before the 
  command line arguments.
  
--- 64,74 ----
  BuiltinFunction
           is the name of a perl function.  Will extract documentation from
           `perlfunc'.
! 
! FAQRegex
!          is a regex. Will search perlfaq[1-9] for and extract any
!          questions that match.
! 
  Any switches in the PERLDOC environment variable will be used before the 
  command line arguments.
  
***************
*** 73,79 ****
  
  unshift(@ARGV,shellwords($ENV{"PERLDOC"}));
  
! getopts("mhtluvf:") || usage;
  
  usage if $opt_h || $opt_h; # avoid -w warning
  
--- 80,86 ----
  
  unshift(@ARGV,shellwords($ENV{"PERLDOC"}));
  
! getopts("mhtluvf:q:") || usage;
  
  usage if $opt_h || $opt_h; # avoid -w warning
  
***************
*** 87,92 ****
--- 94,101 ----
  
  if ($opt_f) {
     @pages = ("perlfunc");
+ } elsif ($opt_q) {
+    @pages = ("perlfaq1" .. "perlfaq9");
  } else {
     @pages = @ARGV;
  }
***************
*** 337,342 ****
--- 346,384 ----
         }
     } else {
         die "No documentation for perl function `$opt_f' found\n";
+    }
+    exit;
+ }
+ 
+ if ($opt_q) {
+    local @ARGV = @found;	# I'm lazy, sue me.
+    my $found = 0;
+    my %found_in;
+    my @pod;
+ 
+    while (<>) {
+       if (/^=head2\s+.*$opt_q/oi) {
+ 	 $found = 1;
+ 	 push @pod, "=head1 Found in $ARGV\n\n" unless $found_in{$ARGV}++;
+       } elsif (/^=head2/) {
+ 	 $found = 0;
+       }
+       next unless $found;
+       push @pod, $_;
+    }
+    
+    if (@pod) {
+       if ($opt_t) {
+ 	 open(FORMATTER, "| pod2text") || die "Can't start filter";
+ 	 print FORMATTER "=over 8\n\n";
+ 	 print FORMATTER @pod;
+ 	 print FORMATTER "=back\n";
+ 	 close(FORMATTER);
+       } else {
+ 	 print @pod;
+       }
+    } else {
+       die "No documentation for perl function `$opt_f' found\n";
     }
     exit;
  }

-- 
Piers Cawley
If a `religion' is defined to be a system of ideas that contains
unprovable statements, then Godel taught us that mathematics is not
only a religion, it is the only religion that can prove itself to be
one. -- John Barrow


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

Date: 12 Feb 1998 16:15:01 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: So what about last summer's RFD?  Let's go moderated.
Message-Id: <m33ehoe4xm.fsf@windlord.Stanford.EDU>

Steve Linberg <linberg@literacy.upenn.edu> writes:

> OK folks, we're all pretty worked up about this, and Randall's note
> about how he essentially can't stand to be in here anymore -- and Tom
> may not be far behind -- means it's time for some action.  Tom may have
> ruffled some feathers recently, but anybody who would say "good
> riddance" doesn't understand Tom's stature in the Perl community.  He's
> a TITAN.  So is Randall.  So are others who are fed up.

Someone from the Perl Institute was talking about restarting the effort
just recently.  I'll renew my offer to provide technical support for the
newsgroup, write or help write the robomoderation software, and serve as a
co-moderator.

> A quick deja-news search revealed that in article
> <5nmj87$282$1@nadine.teleport.com>, deckers@man.ac.uk (A. Deckers)
> posted an RFD suggesting the creation of four new moderated Perl groups.
> To the best of my knowledge, it died due to a general lack of tuits.

Alain Deckers is currently without reliable network access, so people
should definitely not be waiting for him to pick up the ball again.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 12 Feb 1998 23:00:44 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: TENDERS INVITED
Message-Id: <6bvuus$ak4$4@comdyn.comdyn.com.au>

In article <34E45944.874@om.com.au>,
	John and Widy <jodya@om.com.au> writes:
> Tenders are invited for the contruction of a software app which will:
> 
> (1) Allow me to write a contents page, each item active
> (2) Allow me to write chapters, occasional word active (I need to choose
> which ones after I finish writing
> (3) Each page needs a [Contents], [previous page] and [next page]
> buttons
> (4) I need to insert graphic illustrations at will
> (5) Final publication must be a single exe file, or at least secure from
> tampering
> (6) Final publication must be printable, but not Copy/Paste-able
> (6) I will provide graphics as required for Name of App, Headers,
> Footers etc.

I think you will need to rethink that list. it just doesn't make
sense. And it has two items numbered 6.

Pfff.
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | You can't have everything, where would
Commercial Dynamics Pty. Ltd.       | you put it?
NSW, Australia                      | 


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

Date: 12 Feb 1998 22:49:23 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: testing cgi-perl before submitting to server
Message-Id: <6bvu9j$ak4$2@comdyn.comdyn.com.au>

In article <01bd37ce$6a4d8da0$4b0d8ea7@paul>,
	"Paul Nielsen" <pnielsen@netins.net> writes:
> Is there a way to test a cgi script on my local windows 95 computer before
> sending it to the computer that hosts the web site? 

You should really read the FAQs on this. perlfaq, section 9 should be installed with perl:

perldoc perlfaq
perldoc perlfaq9

Also read the following:

http://www.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html
http://www.perl.com/CPAN/doc/FAQs/cgi/perl-cgi-faq.html
http://www.perl.com/CPAN/doc/FAQs/win32/Perl_for_Win32_FAQ.html

Make sure you write your CGI stuff using CGI.pm. It will make
debugging easier.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd.       | enough features yet.
NSW, Australia                      | 


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

Date: 12 Feb 1998 16:17:42 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: time for comp.lang.perl.more-needed ? (Re: repetitive FAQ posts)
Message-Id: <m3wwf0cq8p.fsf@windlord.Stanford.EDU>

Remove xx to reply <xxTony.Curtis@vcpc.univie.ac.at> writes:

> Maybe the clp hierarchy should be extended?  clp.www or clp.cgi

comp.lang.perl.cgi is called comp.infosystems.www.authoring.cgi and the
people there are just as fed up with stupid questions as we are.  :(  Same
thing is true on IRC; the folks on #cgi are about as annoyed as the folks
on #perl.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 12 Feb 1998 18:33:31 -0600
From: will@Starbase.NeoSoft.COM (Will Morse)
Subject: Re: Tom wins flamer of the year award!
Message-Id: <6c04cr$c8p$1@Starbase.NeoSoft.COM>

In article <34E225E5.BCDBE91@weboneinc.com>,
Douglas Clifton  <doug@weboneinc.com> wrote:
>;-)

Well, maybe so, BUT ...

For those people who can manage to 
-      check the manual, man pages, FAQ, etc. and 
-      are able to format a reasonable question in a reasonable way that shows
-      they have at least pondered the question for thirty seconds before posting, 
Tom is very, VERY knowledgeable and and very, VERY helpful.

He also gives good piano.

Will


-- 
# Copyright 1998 Will Morse.  Internet repost/archive freely permitted.
# Hardcopy newspaper, magazine, etc. quoting requires permission.
# 
#      Gravity,                    #    Will Morse
#      not just a good idea,       #    Houston, Texas
#              it's the law.       #    will@starbase.neosoft.com
#
#   These are my views and do not necessarly reflect anyone else.


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

Date: 12 Feb 1998 16:27:37 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: WWW Page
Message-Id: <m3lnvgcps6.fsf@windlord.Stanford.EDU>

ToiLeTGoD <toiletgod@toiletland.nws.net> writes:

> Question being, I want to have a bunch of perl scripts only runable by
> people who have the password.  I have this as of now at the beginning of
> the .pl scripts...

> exit unless $ENV{QUERY_STRING} eq 'testpassword';

> but I want it so that instead of exiting the script if the password is
> not correct, to reroute the request to a different page.  Perhaps
> badpassword.htm or something along them lines.  Anyone know how to
> perform this?

Yes.  You (a) want to post CGI questions to a CGI group rather than to a
group that's about a language and not a protocol, and (b) read up on your
HTTP documentation, paying particular attention to the Redirect header.

Hope this helps!

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

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

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