[11510] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5110 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Mar 11 12:07:21 1999

Date: Thu, 11 Mar 99 09:00:22 -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, 11 Mar 1999     Volume: 8 Number: 5110

Today's topics:
        
    Re: backticks & system() wierdness snay@redbox.caroline.net
    Re: BigInt: Decimal to Hex (Ilya Zakharevich)
    Re: Building Perl 5 with Socket Support on Sequent/Dyni <biwillia@cisco.com>
    Re: Can't Increment Counter in FILE Using http:// (brian d foy)
    Re: Can't Increment Counter in FILE Using http:// (Tad McClellan)
        Complex Structure Question <bruceh@interaccess.com>
    Re: DBI docs? (brian d foy)
    Re: does perl discourage obfuscated code? (was Re: Perl (Randal L. Schwartz)
    Re: flock parameters (brian d foy)
    Re: Freeware Affiliate Perl Script <smiles@wfubmc.edu>
        Getting E-mail addresses from html files? <Jason.Breitweg@desy.de>
    Re: Help modifying 'null' elements ?! (Sean McAfee)
    Re: Help with basic perl problems. <Philip.Newton@datenrevision.de>
        help! <eladr@amit.org.il>
    Re: Mysql question (brian d foy)
        Newbie Q about CGI-lib.pl <brandeda@se.bel.alcatel.be>
        Online guide for newbie in Perl marco_costa@my-dejanews.com
    Re: PC - UNIX text converter snay@redbox.caroline.net
    Re: Perl Power Tools update <Philip.Newton@datenrevision.de>
        Perl Question <hzhou@newbridge.com>
    Re: Perl scripts written for UNIX. Will they work on NT <cpierce1@ford.com>
    Re: problems with readdir (Randal L. Schwartz)
    Re: standard input and standard error (Tad McClellan)
        Updating the .htpasswd file from perl <dontspam.bob@textor.com>
    Re: Updating the .htpasswd file from perl <Tony.Curtis+usenet@vcpc.univie.ac.at>
        Why is a temporary needed? <ftidev@fhb.clickcharge.com>
    Re: Why is a temporary needed? (brian d foy)
    Re: Why is a temporary needed? <tchrist@mox.perl.com>
    Re: Why is a temporary needed? (brian d foy)
    Re: Win32: which files as minimum distribution? <cpierce1@ford.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Thu, 11 Mar 1999 10:44:57 -0400
From: bingdo19@earthlink.net (Bob Langdon)
Subject: 
Message-Id: <bingdo19-ya02408000R1103991044570001@news.alt.net>

Hi,

I'm new to perl, so I wrote a short script I thought I couldn't screw up,
but it won't work.

I want to remove the ".html" from all of the files in a directory called "bbs"

the script I tried is:

#!/usr/bin/perl
opendir(BBS, '/home/gigs/public_html/bbs');
@allfiles = readdir(BBS);
foreach $file(@allfiles){
$file =~ 's/(.*)\.html/$1/g';
}
exit

Okay, what stupid mistake(s) did I make?

TIA,

-- 
+++++++++++++++++++++++++++++++++++++++++++++++++++++
Bob Langdon
bingdo19@earthlink.net


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

Date: 11 Mar 1999 08:15:42 -0800
From: snay@redbox.caroline.net
Subject: Re: backticks & system() wierdness
Message-Id: <m11ziwuhn5.fsf@redbox.caroline.net>

I have been using backticks in two perl scripts that are run from my cron
daemon every 5 minutes for the last two months and have never experienced
any problems.  I just switched to the same version of perl you are using
two weeks ago, and have not had problems yet.  I am running these scripts
on two machines a vanilla RH5.1 and a RH5.0 machine with glibc from RH5.2.
Possibly its some problem with the system call on AIX?  If there was a prob
on linux I probably would have experienced some problems... Any other AIX
people having troubles with system calls???

Shane...


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

Date: 11 Mar 1999 06:28:55 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: BigInt: Decimal to Hex
Message-Id: <7c7nr7$2sb$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Tom Christiansen 
<tchrist@mox.perl.com>],
who wrote in article <7c77pk$7qe$1@nntp.Stanford.EDU>:
>     sub big_dec2hex {
> 	use Math::BigInt;
> 	my $num = new Math::BigInt shift;
> 	my $str = '';
> 	while ($num > 0) { 
> 	    my($quo, $rem) = $num->bdiv(16);
> 	    $str .= (0 .. 9, 'A'.. 'F')[$rem];
> 	    $num = new Math::BigInt $quo;  # why aren't they bigints?

Why should they?  If you do not use 

    $a % $b

then you know what you do.  An overhead of creating a new object may
be prohibitive.

Ilya


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

Date: Thu, 11 Mar 1999 10:00:13 -0500
From: Bill Williams <biwillia@cisco.com>
Subject: Re: Building Perl 5 with Socket Support on Sequent/Dynix 4.x
Message-Id: <36E7DA7C.854B408A@cisco.com>

Looks like the DBD Oracle 0.59 modules don't pick up the socket libraries on
sequent
unless you force them to, ie. edit the makefile to add:

LDFLAGS=/usr/lib/abi-socket
LDDFLAGS=/usr/lib/abi-socket

or bsd-socket, depending on how your rdbms was compiled.

Thanks!

-b


Thanks,
__________________________
Bill Williams
ERP Systems Administrator
Cisco Systems - RTP-IS





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

Date: Thu, 11 Mar 1999 10:18:40 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Can't Increment Counter in FILE Using http://
Message-Id: <comdog-ya02408000R1103991018400001@news.panix.com>

In article <36205783.7562027@news2.tmisnet.com>, strads@tmisnet.com (George Crissman) posted:

> The good news:  it WORKS in telnet mode based in the
>         cgi-bin directory.
> The bad news:  it DOESN'T work in http:// mode from my browser.

> Partial success is worse than complete failure, because I have
> no clue how to proceed with my debugging.

check the return values of function calls and look for errors in the
error log.  you might also check the FAQs referenced in the CGI
Meta FAQ.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>


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

Date: Thu, 11 Mar 1999 03:19:14 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Can't Increment Counter in FILE Using http://
Message-Id: <2au7c7.i98.ln@magna.metronet.com>

George Crissman (strads@tmisnet.com) wrote:

: I'm developing an application that keeps a serial number in a file
: named <syscount.txt>.  The program is supposed to read the number,
: increment it, and save it back into the file for next time.  The 
: program fragment shown below performs this task.

: The good news:  it WORKS in telnet mode based in the
:         cgi-bin directory.
: The bad news:  it DOESN'T work in http:// mode from my browser.
                    ^^^^^^^^^^^^

   We cannot help much if you don't decribe what that means.

   What happens?

   Get any messages?

   Get any output?

   Dumps core?

   ...


: # Open System Count Data File, Get Serial Number, Save Next Serial
: Number
: if (-e "syscount.txt")


   You have a race condition here.

   syscount.txt may be created by another instance of your program
   right here, before this instance of your program opens the file.

   Better to just open it, then check to see if it has any content.




   If you are going to use this code in a multitasking environment
   (CGI is one of those), then you need to do file locking to
   avoid corrupting the data.

   See the Perl FAQ, part 5:

      "How can I lock a file?"

      "What can't I just open(FH, ">file.lock")?"

      "I still don't get locking.  I just want to increment the 
       number in the file.  How can I do this?"


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Thu, 11 Mar 1999 11:35:01 -0500
From: Bruce Hodo <bruceh@interaccess.com>
Subject: Complex Structure Question
Message-Id: <36E7E2A5.351DCE55@interaccess.com>

I am using MySQL to store some info. There are 3 levels of information:
gate,dest,area. What I think I'm trying to do is create a hash of
hashes, with each subhash containing an array. When I process the info,
I want to save the following info into a "complex record":
-"dest"s in each gate ( $data{$gate} = @dests #array of "dest"s ?)
-"area"s in each dest ( $data{$gate}{$dest} = @areas #array of "area"s?)

Later in the script, I want to loop through each area of each dest of
each gate to do further processing.
My questions are:
-have I set this up and loaded it properly?
-how do I reference the arrays to use in "foreach" loops?

Example:

my $gate;
my @gates #pre-existing array of gates
foreach $gate ( @gates ) {
    my $dest;
    my @dests = $data{$gate} # this doesn't work, based upon the
creation of $data above
    foreach $dest ( @dests ) {
        my $area;
        my @areas = $data{$gate}{$dest}; # ditto
        foreach $area ( @areas ) {
            process data...
        }
    }
}
How should I create and access this info?

Thanks!


--
                 Bruce Hodo - Webmaster, GetAwayNetwork, Inc.
     ==Providing unique vacation information on the World Wide Web==
       For Villas, Resorts, Hotels, Air/Hotel Packages, Charter Airfares

                              And Now Offering Travel Auctions!
=============== Visit us at http://getawaynet.com ===============




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

Date: Thu, 11 Mar 1999 10:24:13 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: DBI docs?
Message-Id: <comdog-ya02408000R1103991024130001@news.panix.com>

In article <36e7a49a.37587900@news.freeserve.net>, John@melon17.freeserve.co.uk posted:

> Is there anywhere where I can 
> get some good documentation
> on DBI?

perldoc DBI

there is also an upcoming O'Reilly book, or so i'm told :)

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>


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

Date: 11 Mar 1999 07:10:03 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: does perl discourage obfuscated code? (was Re: Perl evangelism)
Message-Id: <m1678812r8.fsf@halfdome.holdit.com>

>>>>> "Russell" == Russell Schulz <Russell_Schulz@locutus.ofB.ORG> writes:

Russell> Jonathan Feinberg <jdf@pobox.com> writes:
>> Russell Schulz <Russell_Schulz@locutus.ofB.ORG> makes up some quotes:
>> 
Randal> in fact, I think I'll call him a LIAR!  for calling Perl obscure!

Russell> unfortunately, that's one I _didn't_ make up.

Well, for the record (and www.dejanews.com can verify that), I *never*
said exactly that.  Your paraphrasing leans my statements in your
favor.  Perhaps what you said and what you think I said are the same.
This is more revealing of *you* than of the truth.

More particularly, I don't call people "liars".  I have often said
that a statement is untrue in my experience.  But I rarely carry that
through to a personal attack of character.  Now, if you took that
personally, that's your choice.  But don't blame me for how personally
you took the statement. :)

print "Just another Perl hacker," (and overloaded semanticist :)

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Thu, 11 Mar 1999 10:23:26 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: flock parameters
Message-Id: <comdog-ya02408000R1103991023260001@news.panix.com>

In article <36E7BE55.8703CB66@nospam.com>, JPAH-FLA <mymail@nospam.com> posted:

> I also tried, roughly following Camel:
> 
>   sysopen(FH,MYFILE,RD_ONLY);
>   $LOCK_SH = 1;
>   flock(FH, $LOCK_SH);
> 
> which, instead of locking the file, immediately exited the script.

do the second thing you did.  the constants from one architecture to
the next may change, but Fcntl takes care of this hassle for you.

> use 5.004;
>     use Fcntl qw(:DEFAULT :flock);
>     open(FH, "< filename")          or die "can't open filename: $!";
>     flock(FH, LOCK_SH)              or die "can't lock filename: $!";
>     # now read from FH

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>


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

Date: Wed, 10 Mar 1999 10:37:30 -0500
From: Steve Miles <smiles@wfubmc.edu>
Subject: Re: Freeware Affiliate Perl Script
Message-Id: <36E691BA.1FF055B8@wfubmc.edu>

Hi TeV,

I have been developing an affiliate script called ultimate affiliate I'll be
selling at Groundbreak.com for $150. However, as a demo I'll be selling it's
use for $50. You can sign up on the mailing list at Groundbreak.com for the
special offer. I'm still working on the script, but you can see a sample of the
admin page at:

http://www.groundbreak.com/cgi-bin/affiliate/admin.cgi     the password is
"superpass".

and a sample signup page at http://www.groundbreak.com/affiliates

I can send you a list of the features - but this script will be smokin'! It
tracks by both cookies and IP addresses - and will have a great affiliate
control panel as well.

Steve
www.groundbreak.com

TeV21@my-dejanews.com wrote:

> Hello,
>
>   Is there a freeware affiliate PERL script available somewhere?  I want to
> give webmasters a chance to make 15% on my site and do not want to pay $800
> for someone else's script.  Please email me and let me know!
>
> TeV
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own

--
=============================================
Steve Miles (smiles@wfubmc.edu)
----> http://www.groundbreak.com  <----
Wake Forest University School of Medicine
5019 Hanes, Medical Center Blvd.
Winston-Salem, NC 27157
Phone: 336.716.0454     FAX: 336.716.7200
=============================================




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

Date: 11 Mar 1999 17:02:17 +0100
From: Jason T. Breitweg <Jason.Breitweg@desy.de>
Subject: Getting E-mail addresses from html files?
Message-Id: <tkur9qwt3p2.fsf@zussun4.desy.de>

Hi everyone,

I have a bunch of html files that include mailto: tags.  What I want
to do is get all the E-mail addresses from these files and then send a
short e-mail to these people (no spam though).

The code that I have written so far is:

#!/usr/local/bin/perl

open(OUT,">list.txt");

while(defined($nextname = <*.html>)) {

    open(GB,"$nextname");
#    print "$nextname\n";

    while($line=<GB>) {
	
	if ($line =~ /mailto:([\S^\@]+\@[\S^\@]+(?=\"))/) {
#	  print "$line\n";
	  print "$1\n";
	  print OUT "$1\n";
	}
    }
    close(GB);
}

close(OUT);

Anyway, what I wanted to know if anyone has a better regexp to match
E-mail addresses?  Mine works pretty well on lines of the form:

  mailto:blah@blah.blah.com"

but sometimes I get funny things.  Like if someone had a period at the
very end of their address.  Stuff like that.  Does anyone have a
canonical regexp for addresses?  Thanks for the help.

Jason

-- 
+-------------------+------------------------------+
| Jason T. Breitweg | Home:  +49 (0)40 23 80 90 98 |
| Muenzstr. 11      | Work:  +49 (0)40 89 98 31 57 |
| D-20097 Hamburg   | FAX:   +49 (0)40 23 80 90 81 |
| GERMANY           | Mobil: +49 (0)171 176 79 37  |
+-------------------+------------------------------+
| E-mail:   Jason.Breitweg@desy.de  ICQ: 7495933   |
| Web Site: http://www-zeus.desy.de/~breitweg      |
+--------------------------------------------------+


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

Date: Thu, 11 Mar 1999 15:36:40 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: Help modifying 'null' elements ?!
Message-Id: <cqRF2.10996$Ge3.43490431@news.itd.umich.edu>

In article <7c810s$ht0$1@nnrp1.dejanews.com>,
 <Jamie@worldweb.demon.co.uk> wrote:
>I've got a list of lists. This lol is built up from the return values of a
>select from a database. Some of these values are 'null'. I want to loop
>through the lol and for each 'null' value, set it to the text string
>'<null>'.

>I've tried the following:
>my @row
>while (@row = $sth->fetchrow_array) {
>  foreach $item (@row) {
>    if ($item == undef) {$item = '<null>'}
>  }
>}

>This sets *some* values to <null>, including those values I'd expect to be
>set to <null> but it also sets a whole load more to <null> too! So I'm losing
>data!!!

The == operator does a numeric comparison.  The value "undef" is
numerically equal to zero, as the following code will show:

perl -le '$x = 0; if ($x == undef) { print "Zero!" }'

Use the "defined" operator to test for undef, like so:

while (@row = $sth->fetchrow_array) {
    foreach $item (@row) {
        defined $item or $item = '<null>';
    }
}

-- 
Sean McAfee                                                mcafee@umich.edu
print eval eval eval eval eval eval eval eval eval eval eval eval eval eval
q!q@q#q$q%q^q&q*q-q=q+q|q~q:q? Just Another Perl Hacker ?:~|+=-*&^%$#@!


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

Date: Thu, 11 Mar 1999 16:43:54 +0100
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: Help with basic perl problems.
Message-Id: <36E7E4BA.EA9ADFAC@datenrevision.de>

Frank Varnavas wrote:
> 
> is mode 750 really what you want for a cgi script?

Specifically, can the user-id that the HTTP server runs under (maybe
"httpd", or "nobody") read the CGI script? 750 means only you and your
group can read and execute it; does the CGI user belong to your group?

Cheers,
Philip


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

Date: Thu, 11 Mar 1999 16:42:56 +0200
From: eladr <eladr@amit.org.il>
Subject: help!
Message-Id: <36E7D670.2129@amit.org.il>

hi...
im running netscape fast track on novel.
im trying to running web search script
which users can search my site using keywords
i cant find such script which working on my machine
can you help me?
(i have one that works but it's work very very slowly)
elad


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

Date: Thu, 11 Mar 1999 10:21:26 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Mysql question
Message-Id: <comdog-ya02408000R1103991021260001@news.panix.com>

In article <36e7d546.50049681@news.freeserve.net>, John@melon17.freeserve.co.uk posted:

> If i want to download/backup the database/tables i have
> created, how do i do that?

mysql uses normal files.  just cp them elsewhere.  if you want to
be really careful, shutdownthe server momentarily so all buffers
are flushed.  this is covered in the docs IIRC.

> Does the tables/database created via a telnet session show up 
> in my web site (i.e.can you see it using ftp)?

depends on your local setup.  hopefully they don't, although i'm
not really sure what you are asking.

so what was your Perl question, anyway?

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>


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

Date: Thu, 11 Mar 1999 16:31:13 +0100
From: David Van den Brande <brandeda@se.bel.alcatel.be>
Subject: Newbie Q about CGI-lib.pl
Message-Id: <36E7E1C1.D6C3D170@se.bel.alcatel.be>

Hi,

I'm using CGI-lib to ReadParse my web form.
I can easily print all the variables with the &PrintVariables
subroutine.
But I want to save all these variables (value/key pairs) for further
processing.
More precisely: I want to concatenate each key/value pair into a new
variable and save them al into an array.
for ex.: 	key1=>value1
		key2=>value2
		...
must be saved into an array as: Array[1]=key1.value1
				Array[2]=key2.value2
				...

My script returns the following (logical) error:
Global symbol "hash" requires explicit package name
Global symbol "key" requires explicit package name
Global symbol "value" requires explicit package name

#!/usr/local/bin/perl5 -w

use strict;

require "./cgi-lib.pl";

MAIN:
{
  my (%input,   # The CGI data
      $field);  # Each of the fields (used for testing) 

  &ReadParse(\%input);

  print &PrintHeader;
  print &HtmlTop ("output");

  print "<HR>And here is a list of the variables you entered...<P>";
  print &PrintVariables(\%input);

#####################################
## the following doesn't work :-(  ##
 
  %hash = &PrintVariables(\%input);
  while (($key,$value)=each %hash)
  {
	print "$key:$value";
  }

  print &HtmlBot;
}
-- 
          V              David Van den Brande, Trainee at
  -----------------      Alcatel Switching VE27
 |  A L C A T E L  |     Fr. Wellesplein 1 - 2018 Antwerp - Belgium
  -----------------      mailto:David.Van_den_Brande@alcatel.be


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

Date: Thu, 11 Mar 1999 15:35:07 GMT
From: marco_costa@my-dejanews.com
Subject: Online guide for newbie in Perl
Message-Id: <7c8nra$4tm$1@nnrp1.dejanews.com>

Hi there,

I need a guide wich I could dowload to learn Perl, I've tried the man pages,
but  it is not intended for a newbie!

Thank you in advance.

Marco Costa
TECTELCOM Fibras Opticas
Sao Jose dos Campos - SP - Brazil

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


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

Date: 11 Mar 1999 08:28:53 -0800
From: snay@redbox.caroline.net
Subject: Re: PC - UNIX text converter
Message-Id: <m1zp5kt2gq.fsf@redbox.caroline.net>

Number 1:  Do we really need to see the HTML crap?  Must we really have a
text and html version running around to clog up the not so superhighway?
Not to mention many people run their own local newsgroup copy (leafnode, 
whatever) and the HTML and text stuff is not so cool. Please disable it.

Any way to answer your question:
open (INPUT, "in.file");
open (OUTPUT,">output.file");
while($line=<INPUT>)
{
	chomp $line;
	print OUTPUT $line;
}
 .. easy, first page of file i/o in perl book could teach you this.

Shane...
Asking myself: Why did I reply to this post?...


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

Date: Thu, 11 Mar 1999 16:01:25 +0100
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: Perl Power Tools update
Message-Id: <36E7DAC5.177C0702@datenrevision.de>

Tom Christiansen wrote:
> 
> The following commands have implementations:

This has what to do with FAQ 3.16 "How can I make my Perl program run
faster?" ?

ISTR Tom posted a thread begin as a thread continuation a while back
already -- IIRC, it was asking how often the FAQ should be posted, but I
don't remember what the thread was he posted it to. Perhaps you need to
double-check whether you are following-up or posting, Tom :)

Cheers,
Philip


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

Date: Thu, 11 Mar 1999 09:48:41 -0500
From: Helen Zhou <hzhou@newbridge.com>
Subject: Perl Question
Message-Id: <36E7D7C9.BE536633@newbridge.com>

Hi All:

I am just starting to learn perl and wondering how to write a script to do this:

I want to create a web page to ask a user to enter a search string.  Then
I will take this string and do a grep in the local directory to find files
containing that string.  Then I want to list all the filenames on the web as
hyperlinks.

The only problem I have is to embed the unix command. If I use tcsh, will
the following be valid?

#!  /usr/local/bin/perl
#! /usr/local/tcsh

$searchStr = $ENV{'QUERY_STRING'};
$pathname = /system/local/
grep $search $pathname
read(STDIN, $buffer, $ENV{'QUERY_STRING'});
@filename = split(/&/, $buffer);
print "Content-type: text/html\n\n";
print <<EndHdr;
<html><head><title>Search Results</title></head>
<p>
<h2>Search Results</h2>
<ul>
EndHrd;

foreach $i (@filename) {
    print "<li><a href=\"$pathname{$filename}\">$filename</a>\n";
}

print <<EndFooter;

</ul>
<p>
</body>
</html>
EndFooter
;'

Please tell me what I did wrong.

Thanks,
Helen




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

Date: Thu, 11 Mar 1999 09:22:51 -0500
From: Clinton Pierce <cpierce1@ford.com>
Subject: Re: Perl scripts written for UNIX. Will they work on NT?
Message-Id: <36E7D1BB.BF8DB09D@ford.com>

Larry Rosler wrote:
> > separator changes from "/" to "\").  There's even portable ways.. 
>
> Ignore this advice.  Do not use '\' as the pathname separator.  It is
> error-prone and unnecessary.

Ignore some of this advice.  Often times, it's quite necessary in Win32 to
use backslashes as pathname separators.  It is error-prone, but
indespensible sometimes.

*I wonder why people started doing this anyway?  [from D. Turley]

Because handing pathnames off to system() calls with forward slashes causes
all hell to break loose.

	$dir="/Windows/System";
	system("dir $dir");

Does not work as desired.  (At least in the Win32 perl I have been using.) 
Under Win32, if you're prepared to guarantee that a pathname isn't going to
be handed to a sub-"shell", then by all means use forward-slashes.  This
means system() calls and backticks (``).

-- 
Clinton A. Pierce       "If you rush a Miracle Man, you get rotten
clintp@geeksalad.org        Miracles."  -- Miracle Max, The Princess Bride
http://www.geeksalad.org


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

Date: 11 Mar 1999 07:29:24 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: problems with readdir
Message-Id: <m1yal4yrhn.fsf@halfdome.holdit.com>

>>>>> "jstrike" == jstrike  <jstrike@execpc.com> writes:

jstrike> local (@catagories) = grep(/$filetype$/, readdir(DIR));
[...]
jstrike> processlist(@catagories);

jstrike> sub processlist {
jstrike> local (@catagories) = @_;
jstrike>   ## Process the list.
jstrike>   foreach (@catagories) {
jstrike>     ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime,
jstrike> $mtime, $ctime) = stat $_;

Ahh.  Common problem with readdir().  The names returned are just the
filenames, not the path to the names relative to where you are.  So
the stat() (and further fileops) are working on names in the *current*
directory, not the directory where the readdir() was performed.

You'll need to patch up the filenames so they have a full relative (or
absolute) path, or chdir() to the directory so that filenames without
paths are still correct. :)

print "Just another Perl hacker,"

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Thu, 11 Mar 1999 04:59:31 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: standard input and standard error
Message-Id: <3648c7.7b8.ln@magna.metronet.com>

Chim Kin Sang (mecks@ust.hk) wrote:

:         The problem I engaged is that when I am using the command
: system. I cannot
: put the standard output and standard error into the same file. for


: I am new to
: PERL.


   Then you should scan the list of Frequently Asked Questions
   frequently :-)

   Perl FAQ, part 8:

      "How can I capture STDERR from an external command?"


   (use Bourne shell syntax, not csh)


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Thu, 11 Mar 1999 16:50:34 -0000
From: "Bob" <dontspam.bob@textor.com>
Subject: Updating the .htpasswd file from perl
Message-Id: <7c8s5d$7u3$1@taliesin.netcom.net.uk>

We are giving a limited set of users access to a particular part of the web
site (not unusual) and in order to do this we have a perl program which
updates the .htpasswd file in what I think is fairly normal manner (it is
below).

Now this works 90% of the time, but some users find they can't get into the
password protected area.  I never have this problem so its hard for me to
nail it down, but its definitely there as an issue.  Its not just finger
trouble on their part (my first reaction).  Its not down to their browser
because I just got off the phone to someone who was using the same as me
(IE4 SP1).  If we re-run the program and re-encrypt the problem goes away
for them.

Anyone else come up against this?????


sub UpdatePasswordFile
{
        local (@saltchars,$salt,$crypted,%log,$x,$key);
 open (PASSFILE, $PASSFIL);
 while (<PASSFILE>)
 {
  chomp;
  ($x,$crypted)=split(/:/);
  $log{$x}=$crypted;
 }
 close PASSFILE;
 srand($$|time);
 @saltchars=(a..z,A..Z,0..9,'.','/');
        if ($FORM{$PASSFLD})
        {
  $salt=$saltchars[int(rand($#saltchars+1))];
  $salt.=$saltchars[int(rand($#saltchars+1))];
  $crypted=crypt($FORM{$PASSFLD},$salt);
                $log{$FORM{$PASSLOG}}=$crypted;
        }
 open (PASSFILE, ">".$PASSFIL);
       foreach $key ( keys(%log))
       {
         print PASSFILE  "$key:$log{$key}\n";
       }
       close PASSFILE;
       print "<P>Password file updated</p>";
}





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

Date: 11 Mar 1999 17:51:04 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Updating the .htpasswd file from perl
Message-Id: <83iuc8ezrb.fsf@vcpc.univie.ac.at>

Re: Updating the .htpasswd file from perl, Bob
<dontspam.bob@textor.com> said:

Bob> We are giving a limited set of users access to
Bob> a particular part of the web site (not unusual)
Bob> and in order to do this we have a perl program
Bob> which updates the .htpasswd file in what I
Bob> think is fairly normal manner (it is below).

perldoc HTTPD::UserAdmin

hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien.  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: Thu, 11 Mar 1999 10:11:22 -0500
From: Patrick Sweeney <ftidev@fhb.clickcharge.com>
Subject: Why is a temporary needed?
Message-Id: <36E7DD1A.BF18068A@fhb.clickcharge.com>

Why are these two not equivalent?

my @list = ();
$$self {'list'}= \@list;

and

$$self{'list'} = \();




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

Date: Thu, 11 Mar 1999 10:47:40 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Why is a temporary needed?
Message-Id: <comdog-ya02408000R1103991047400001@news.panix.com>

In article <36E7DD1A.BF18068A@fhb.clickcharge.com>, Patrick Sweeney <ftidev@fhb.clickcharge.com> posted:

> Why are these two not equivalent?
> 
> my @list = ();
> $$self {'list'}= \@list;

this is a reference to a list

> and
> 
> $$self{'list'} = \();

and this is a list of references.

perhaps you wanted

    $$self{'list'} = [];

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>


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

Date: 11 Mar 1999 08:51:14 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Why is a temporary needed?
Message-Id: <36e7e672@csnews>

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

In comp.lang.perl.misc, 
    comdog@computerdog.com (brian d foy) writes:
:> $$self {'list'}= \@list;
:this is a reference to a list

No, sir.

:> $$self{'list'} = \();
:and this is a list of references.

Yes, sir.

--tom
-- 
    Though I'll admit readability suffers slightly... 
                    --Larry Wall in <2969@jato.Jpl.Nasa.Gov>


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

Date: Thu, 11 Mar 1999 11:01:14 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Why is a temporary needed?
Message-Id: <comdog-ya02408000R1103991101140001@news.panix.com>

In article <36e7e672@csnews>, tchrist@mox.perl.com (Tom Christiansen) posted:

>  [courtesy cc of this posting sent to cited author via email]
> 
> In comp.lang.perl.misc, 
>     comdog@computerdog.com (brian d foy) writes:
> :> $$self {'list'}= \@list;
> :this is a reference to a list
> 
> No, sir.

oops.  i was a bit imprecise.  it's a reference to an array.

sorry about the confusion.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>


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

Date: Thu, 11 Mar 1999 09:31:00 -0500
From: Clinton Pierce <cpierce1@ford.com>
To: Edwin van Geelen <edwin@mindless.com>
Subject: Re: Win32: which files as minimum distribution?
Message-Id: <36E7D3A4.1966CE43@ford.com>

[author cc'd in E-Mail]

Edwin van Geelen wrote:
> I use Vim 5.3 with the Perl interface. Now I want to make as small a
> distribution of the both as possible. I've already trimmed Vim to the
> minimum, but now what about Perl? Which files (I use the Sarathy
> distribution) do I need as an absolute minimum. Perl.exe of course,
> and what else?

If you're trimming it down so you can distribute a script (or few), you
might want to look at perl2exe.  It will give you a .EXE file you can run
and a couple of DLL's to be installed.

Otherwise, what you distribute has to do with what scripts your're going to
run and what modules they require.

If you're distributing a development environment--don't trim it at all,
please.

-- 
Clinton A. Pierce       "If you rush a Miracle Man, you get rotten
clintp@geeksalad.org        Miracles."  -- Miracle Max, The Princess Bride
http://www.geeksalad.org


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

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

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