[10676] in Perl-Users-Digest
Perl-Users Digest, Issue: 4268 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Nov 21 01:07:21 1998
Date: Fri, 20 Nov 98 22:00:18 -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 Fri, 20 Nov 1998 Volume: 8 Number: 4268
Today's topics:
Re: a very simple question! <tbsmith@viper.net>
Re: Aggregate <jaudall@students.wisc.edu>
Re: chmod (Tad McClellan)
Errors I found w/ C++, XS and HP-UX <nestor_fernandez@hp.com>
Factory package <hrafal@rcn.com>
Re: How secured my flat database could be using cgi? (I R A Aggie)
Re: How secured my flat database could be using cgi? (brian d foy)
How to get data from an rs232 com port <mh@u.washington.edu>
I need help w/ C++ XS and HP-UX <nestor_fernandez@hp.com>
Re: Little help here <perlguy@technologist.com>
Re: Looking for a script to "roll dice" (brian d foy)
Re: NT perl and mail (Tom McGee)
Re: Perl CGI on NT error <perlguy@technologist.com>
Re: Perl CGI on NT error (Tom McGee)
perl-5.004->perl-5.005 <akozik@mailbox.ucdavis.edu>
Re: perl-5.004->perl-5.005 (I R A Aggie)
Re: Problems with A Perl Script <jaudall@students.wisc.edu>
Re: puzzler <tbsmith@viper.net>
Re: Question from a mega-geek (brian d foy)
Re: Security with .htaccess (brian d foy)
Re: sendmail flags <inquiries@e-ads.net>
Re: Server Administration with Perl (brian d foy)
Re: Sum by group (Tad McClellan)
Re: Sum by group (Patrick Timmins)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 20 Nov 1998 23:09:31 -0600
From: Todd Smith <tbsmith@viper.net>
Subject: Re: a very simple question!
Message-Id: <36564B0B.616506F1@viper.net>
i think it's the browsers' decisions, and they just have to hit reload. I can
always be wrong...
Yue Wang wrote:
> Subject: a very simple question!
> Newsgroups: comp.lang.perl.misc
> Summary:
> Keywords:
>
> Hi,
> I have a very simple question with regard to automatically reload
> a HTML page, basically I am trying to redirect to this URL in my cgi
> script using
>
> " print $query->redirect('http://www.bagd.com');"
> Now, the problem is the page shows up with it's old value field that's
> saved in cache. I tried to use
> print "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"3; URL=http://www.bagd.com\">\n";
> It redirect to the reloaded URL, but there's always this intermediate page
> before transferring to the new URL.
> I am just wondering if there's anyone who knows how to disable
> cache in HTML, or any perl command that will allow me to redirect to an
> URL and reload that URL automatically? Thanks a lot.
>
> Yue
> --
--
_______________
Todd Smith
Perl Programmer
ITC^Deltacom
------------------------------
Date: Fri, 20 Nov 1998 22:47:40 -0600
From: Joshua <jaudall@students.wisc.edu>
Subject: Re: Aggregate
Message-Id: <365645EC.87ADBCA0@students.wisc.edu>
What about this - I don't use a hash, rather just ignore the
column heading in the loops. The @array_sum will consist of
all column sum totals. Perhaps it's a bit simplistic but
I'm new to this.
#!/usr/bin/perl
@big_array = ();
while (<>) {
chomp;
push @big_array, [split];
}
close();
$array_sum[0]="Column_Totals";
$i = 0;
for $j ( 1 .. $#{$big_array[$i]} ) {
$col_sum=0;
for $i ( 1 .. $#big_array ) {
$col_sum += $big_array[$i][$j];
$array_sum[$j] = $col_sum;
}
}
c_b9209@my-dejanews.com wrote:
>
> Hello!
>
> Have a data file where the first coulmn has group data and the other have
> values and I want to clculate the sum and counts by groups and the data file
> is realy huge have found I can use hash variabels but I can't get the values
> in a array. How I do to calculate the sum for each column by group in the
> data file? has anyone a solution of this, please help me this problem make me
> crazy here is my script for a small data file
>
------------------------------
Date: Fri, 20 Nov 1998 18:05:33 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: chmod
Message-Id: <d40537.jmb.ln@flash.net>
K. Krueger (kirbyk@best.com) wrote:
: In article <3655CE41.C4009EE7@alpirsbach.netsurf.de>,
: Bjvrn Oldsen <oldsen@alpirsbach.netsurf.de> wrote:
: >
: >How can I apply chmod to read,write and execute on unix with
^^^^^^^
^^^^^^^
: >perl(cgi)-code
: >
: chmod (0666, $filename);
: Always read the documentation
: if possible before posting.
Always read the question before posting an answer ;-)
The original poster did not specify who those permissions
should be for, and so cannot hope to get an exactly correct
answer anyway...
chmod(0744, $filename) || die "could not change permissions $!";
All three for owner, read-only for group and world.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 20 Nov 1998 19:15:13 -0800
From: nestor fernandez <nestor_fernandez@hp.com>
Subject: Errors I found w/ C++, XS and HP-UX
Message-Id: <36563041.6041B97D@hp.com>
I found some other funky behavior on HP-UX and C++ compiles. The .xs
file that get's generated has to be doctored in the following way
otherwise you get an error about the functions pow(), abs(), and sqr()
having multiple C linkage.
code generated by h2xs:
#ifdef __cplusplus //remove this line
extern "C"
{ //remove this line
#endif //remove this line
#include <EXTERN.h>
#include <perl.h>
#ifdef __cplusplus //remove this line
} //remove this line
# ifndef EXTERN_C
# define EXTERN_C extern "C"
# endif
#else
# ifndef EXTERN_C
# define EXTERN_C extern
# endif
#endif
------------------------------
Date: Fri, 20 Nov 1998 22:50:55 -0500
From: Howard Rafal <hrafal@rcn.com>
Subject: Factory package
Message-Id: <36563899.4401FA7B@rcn.com>
A while back I wrote a package that I found to be very useful. I have
recently been considering rewriting it and making it generally available
(if it hasn't been done already). My recent thinking has had me trying
to weigh different issues with this package and I was hoping to have a
couple of questions answered.
Background:
The package is a very general Factory class which maintains a hash of
class names. Factory::Create takes a package name and an array of
parameters. If the name does not exist in the hash, an eval of "use
<package-name>" is performed and checked for validity. Then an anonymous
subroutine is generated which does a new of this object using the passed
in parameters. This subroutine is created and entered into the hash. The
new is then called and returns the new object. If Create is called and
the name already exists, then the new routine is just called.
Use:
I found this to be useful for two purposes (but I can see many). It
allowed me to create ONE very generic CGI script which could respond to
hundreds of actions without having to compile all of them. Each action
was a form button in my application, so since I only had onaction at any
time, I saved quite a bit of time not compiling unused code. The second
use was for database generality. We wrote an interface that would work
with tab-delimited text or with mSQL. I was able to switch my
application from one to the other, but just changing some environment
variables, thus supporting either database without having to compile
Perl for both pieces.
Questions:
- Is this useful? Has it been done a number of times already?
- If this is a useful thing, does it become unnecessary with modperl?
- What is the impact of doing an eval of 'use'? This is really the most
important question for me.I was thinking about modperl and wondering if
doing a use in an eval will still take advantage of modPerl.
I have some other questions, but this is enough as a start.
Thanks for any input,
HOWIE.
------------------------------
Date: Fri, 20 Nov 1998 21:51:11 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: How secured my flat database could be using cgi?
Message-Id: <fl_aggie-2011982151110001@aggie.coaps.fsu.edu>
In article <3655C349.F9D0839A@cam.org>, Sylvain Lavigne <proband@cam.org> wrote:
+ From my script I give read access to my database and I put
+ a chmod 744 database.dat permission. So, far it is ok. If
+ my database is readable, can someone else read the file by
+ bypassing the cgi script and have access to private data?
Anyone who can log onto the system in question can read that file.
Anyone who can place a cgi program into the server's cgi-bin/ can
access that file thru their program.
As long as the file isn't in a location where your WWW server can
serve it up, no one external can access your file thru their browser
-- except if someone else wrote that cgi program previously mentioned.
+ How can I prevent that?
You might be able to encrypt it. Do a Dejanews search on 'XOR' in this
newsgroup for what may be an enlightening thread.
+ From my script I give write access to my database and I put
+ a chmod 742 database.dat permission. So, far it is ok.
Yes, except now your cgi program will not be able to read it. Is that
what you want?
+ If my database is writable, can someone else write in the file by
+ bypassing the cgi script and corrupt my private data?
Anyone who can log onto the system, and is not in your group can write
to that file.
+ How can I prevent that?
AFAIK, you can't.
James
------------------------------
Date: 21 Nov 1998 04:40:15 GMT
From: comdog@computerdog.com (brian d foy)
Subject: Re: How secured my flat database could be using cgi?
Message-Id: <comdog-1103380847390001@news.panix.com>
Keywords: just another new york perl hacker
In article <3655DF9A.D561B445@alcmn.org>, Jarrod Stenberg <jarrod@alcmn.org> posted:
> > From my script I give read access to my database and I put
> > a chmod 744 database.dat permission. So, far it is ok. If
> > my database is readable, can someone else read the file by
> > bypassing the cgi script and have access to private data?
> I say use CGI.pm. Takes car of security for you.
CGI.pm adds no security. if you don't want other users reading your
data, you need to set up a system in which only a single user has
access to the data. btw, making the file read-only by the web
server user still lets anyone with CGI access read your data.
> > From my script I give write access to my database and I put
> > a chmod 742 database.dat permission. So, far it is ok. If
> > my database is writable, can someone else write in the file by
> > bypassing the cgi script and corrupt my private data?
same thing as before. set up your system so that only a single
user (or group) (not the web server UID) can access the data.
--
brian d foy <http://computerdog.com>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>
------------------------------
Date: Fri, 20 Nov 1998 18:30:53 -0800
From: "M. Hamilton" <mh@u.washington.edu>
Subject: How to get data from an rs232 com port
Message-Id: <Pine.OSF.3.96b.981120182705.32530A-100000@saul3.u.washington.edu>
How do I get data coming into the com port (rs232) on a PC running Win95?
What about if it's running linux or some other unix? Is this an easy
thing to do? Is there a perl module written to do this already?
How do I set things like data bits, stop bits, parity, etc?
I need to watch the port, get the data stream coming off the port at
random times intervals, interpret it (that's the easy part in perl), and
then log it to an output file (also easy). I just need to know how to get
the data into the program from the data port.
I'm kinda a new at this, so, I hope this question doesn't sound really
dumb... if so, I'd appreciate if someone would set me on the right track.
Thanks for the help,
Mike
________________________________________________________
Michael Hamilton mh@u.washington.edu
--------------------------------------------------------
Mr. Bingley...was lively and unreserved, danced every dance,
was angry that the ball closed so early, and talked of
giving one himself at Netherfield. Such amiable qualities
must speak for themselves.
From "Pride and Prejudice" by Jane Austen
________________________________________________________
------------------------------
Date: Fri, 20 Nov 1998 19:15:06 -0800
From: nestor fernandez <nestor_fernandez@hp.com>
Subject: I need help w/ C++ XS and HP-UX
Message-Id: <3656303A.6A6243DF@hp.com>
Help!
I'm trying to do the C++ and perl thing. I've read the Adv Perl
Programming and the perlXStut and the perlxs but am still having
problems.
I'm on HP-UX 10.20 and perl 5.004_03.
I downloaded Dean's CookBookA and CookBook B. The makes work okay
except for the make test, then I get the following error messages:
%make test
....
/usr/lib/dld.sl: Unresolved symbol: __nw__FUi (code) from
./blib/arch/auto/Cook <<< Error
BookB/CCsimple/CCsimple.sl
/usr/lib/dld.sl: Unresolved symbol: __dl__FPv (code) from
./blib/arch/auto/Cook
BookB/CCsimple/CCsimple.sl
...
below is the entire output from make test
PERL_DL_NONLAZY=1 /usr/bin/perl -I./blib/arch -I./blib/lib
-I/opt/perl5.
004_03/lib/PA-RISC1.1/5.00403 -I/opt/perl5.004_03/lib test.pl
1..1
/usr/lib/dld.sl: Unresolved symbol: __nw__FUi (code) from
./blib/arch/auto/Cook <<< Error
BookB/CCsimple/CCsimple.sl
/usr/lib/dld.sl: Unresolved symbol: __dl__FPv (code) from
./blib/arch/auto/Cook
BookB/CCsimple/CCsimple.sl
Can't load './blib/arch/auto/CookBookB/CCsimple/CCsimple.sl' for module
CookBook
B::CCsimple: Unresolved external at
/opt/perl5.004_03/lib/PA-RISC1.1/5.00403/Dyn
aLoader.pm line 155.
at test.pl line 11
BEGIN failed--compilation aborted at test.pl line 11.
not ok 1
*** Error exit code 215
Does this ring any bells out there?
Also, I found some other funky behavior on HP-UX and C++ compiles. The
.xs file that get's generated has to be doctored in the following way
otherwise you get an error about the functions pow(), abs(), and sqr()
having multiple C linkage.
code generated by h2xs:
#ifdef __cplusplus //remove this line
extern "C"
{ //remove this line
#endif //remove this line
#include <EXTERN.h>
#include <perl.h>
#ifdef __cplusplus //remove this line
} //remove this line
# ifndef EXTERN_C
# define EXTERN_C extern "C"
# endif
#else
# ifndef EXTERN_C
# define EXTERN_C extern
# endif
#endif
------------------------------
Date: Fri, 20 Nov 1998 22:13:44 -0600
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: Little help here
Message-Id: <36563DF8.5D086AF8@technologist.com>
Timothy M Bryant wrote:
>
> I am wondering if someone out there could give me a little help in how
> to use Perl for programming. I was told by a friend that it could be
> done. I am just someone who wants to learn new stuff on a raggedy
> computer. Thanks!!
Perl **IS** a programming language! To use it for programming, you just
start programming!
Could you be more specific about your computer. "raggedy" tells us
nothing. Are you running a Unix derivative, Win 95/98/NT, or Win 3.x or
something else???
Without any more details, we can't help you out. If you need to get
Perl or more information on programming with Perl, I suggest visiting
http://www.perl.com
Good luck!
Brent
--
Java? I've heard of it, it is what I drink while hacking Perl! -me
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ Brent Michalski $
$ -- Perl Evangelist -- $
$ E-Mail: perlguy@technologist.com $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
------------------------------
Date: 21 Nov 1998 04:29:42 GMT
From: comdog@computerdog.com (brian d foy)
Subject: Re: Looking for a script to "roll dice"
Message-Id: <comdog-1103380837080001@news.panix.com>
Keywords: just another new york perl hacker
In article <36561B48.A0CD4894@qis.net>, Donboy <donboy@qis.net> posted:
> I'm currently webmastering a site for role playing games and I need a
> cgi program that will roll dice online.
>
> The script must be able to generate random numbers, roll dice of any
> number of sides (i.e. 10 sided dice, 4 sided dice as well as the regular
> 6 sided dice) and it must be able to receive input via an HTML form.
int(rand($number_of_sides) + 1);
good luck :)
--
brian d foy <http://computerdog.com>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>
------------------------------
Date: Sat, 21 Nov 1998 04:55:34 GMT
From: tamcgee@home.com (Tom McGee)
Subject: Re: NT perl and mail
Message-Id: <tamcgee-2011982356290001@cc1017583-a.union1.nj.home.com>
There's a freeware command-line mailer called "blat" which runs on NT.
--Tom
In article <734aso$j7$1@nnrp1.dejanews.com>, mcnay@my-dejanews.com wrote:
>>I know how to do mail from unix perl scripts. (sendmail)
>>
>>Is there a way, or module to do mail from NT perl scripts. If so, sample
>>please, and what needs to be set up on the machine running the perl.
>>
>>I have a script that is looking at database issues and needs to notify a
>>person if there is problems, since they won't take the time to read the log
>>on the machine.
>>
>>Thanks
>>
>>ruth
>>
>>-----------== Posted via Deja News, The Discussion Network ==----------
>>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 20 Nov 1998 22:18:07 -0600
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: Perl CGI on NT error
Message-Id: <36563EFF.B27AE4FB@technologist.com>
Ron wrote:
>
> HI,
>
> My simple program :
>
> #!/usr/local/bin/perl
> # hello.pl - my first perl script!
>
> use CGI;
> print "Hello, world!\n";
>
> which i copied from my book is giving the following problem:
> "
> %1 is not a valid Windows NT application.
> "
>
> Is it something to do with the #! user/... part?
> Since that sounds like UNIX?
>
> If yes, then what should I do for having it work in UNIX?
>
> Thanks,
> Ron
Ron,
It has nothing to do with the #! line. On NT you can actually omit this
line, although I don't recommend it.
The problem is with your server setup. I don't know which version of
Perl you are using - but http://www.activestate.com has a good FAQ on
setting up your web server to run CGI. This FAQ covers many popular web
servers.
Give the FAQ a try and see if that helps!
Brent
--
Java? I've heard of it, it is what I drink while hacking Perl! -me
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ Brent Michalski $
$ -- Perl Evangelist -- $
$ E-Mail: perlguy@technologist.com $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
------------------------------
Date: Sat, 21 Nov 1998 04:58:12 GMT
From: tamcgee@home.com (Tom McGee)
Subject: Re: Perl CGI on NT error
Message-Id: <tamcgee-2011982359080001@cc1017583-a.union1.nj.home.com>
Why don't you skip importing CGI for this first one? And while you're at
it, your first line should be
print "Content-type: text/html\n\n";
--Tom
In article <Pine.GSO.3.95L.981121021937.6271B-100000@uststf1>, Ron
<mkshanx@uxmail.ust.hk> wrote:
>>HI,
>>
>>
>>My simple program :
>>
>>#!/usr/local/bin/perl
>># hello.pl - my first perl script!
>>
>>use CGI;
>>print "Hello, world!\n";
>>
>>
>>
>>which i copied from my book is giving the following problem:
>>"
>>%1 is not a valid Windows NT application.
>>"
>>
>>
>>Is it something to do with the #! user/... part?
>>Since that sounds like UNIX?
>>
>>If yes, then what should I do for having it work in UNIX?
>>
>>Thanks,
>>Ron
------------------------------
Date: Fri, 20 Nov 1998 18:04:39 -0800
From: Alexander Kozik <akozik@mailbox.ucdavis.edu>
Subject: perl-5.004->perl-5.005
Message-Id: <Pine.GSO.4.04.9811201800060.23734-100000@catbert.ucdavis.edu>
I use perl-5.004 from Slackware 3.5.
Is it possible to install perl-5.005
without upgrade to Slackware 3.6.
Is it any reason to upgrade if I use regular expressions only.
What I am going to do:
1. using pkgtool uninstall perl-5.004
2. using pkgtool install perl-5.005
Does it work for somebody?
Is it possible to break other programs that use perl (santa, for example)?
Thanks a lot for advice.
Alexander.
-------------------------------------------------
Alexander Kozik, Medical School, Bio-Chem Dpt,
University of California at Davis.
Davis, 95616 CA.
email: akozik@ucdavis.edu
tel: (530)-752 3314
-------------------------------------------------
------------------------------
Date: Fri, 20 Nov 1998 21:37:50 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: perl-5.004->perl-5.005
Message-Id: <fl_aggie-2011982137500001@aggie.coaps.fsu.edu>
In article <Pine.GSO.4.04.9811201800060.23734-100000@catbert.ucdavis.edu>,
Alexander Kozik <akozik@mailbox.ucdavis.edu> wrote:
+ Is it possible to install perl-5.005 without upgrade to Slackware 3.6.
Yes, if you have the development environment installed, perl should
make right out of the box.
James
------------------------------
Date: Fri, 20 Nov 1998 22:25:52 -0600
From: Joshua <jaudall@students.wisc.edu>
To: Justin Funston <jfunston@connect.ab.ca>
Subject: Re: Problems with A Perl Script
Message-Id: <365640D0.7E483BA9@students.wisc.edu>
check permission of files, path of files, and configuration
of webserver. For example on my machine the cgi scripts
won't run unless they are named .cgi this is just for the
web server sake and won't affect the fontionality of the
script. This can be configured by you sys admin.
Josh
Justin Funston wrote:
>
> Hello,
> I am trying to teach myself perl/cgi.
> So far, I have tried writing a couple of scripts, but they don't work. I get
> an HTTP 500 error. The files are located at
> 'http://www.connect.ab.ca/~funston/'
> The one file: 'variables.html' & the script is 'variables.pl'.
> If anyone could look at it, and tell me what I did wrong, that would be
> great.
>
> Thanks,
> Justin
------------------------------
Date: Fri, 20 Nov 1998 23:07:39 -0600
From: Todd Smith <tbsmith@viper.net>
Subject: Re: puzzler
Message-Id: <36564A9B.3D2FD334@viper.net>
David Alan Black wrote:
> Hello -
>
> In comp.lang.perl.misc you write:
>
> >Is there a good trick for transposing a two dimensional array? That is,
> >combine a two dimensional array into a one dimensional array columnwise: 1st
> >element/1st row followed by 1st element/2nd row, etc. There must be some way
> >to streamline what I wrote.
>
> I do know that temporary variables really are OK - and that this code is almost
> certainly less efficient than it would be if it used some - but I do love
> the "look and feel" of purely functional solutions :-) I'm not entirely
> thrilled with the grepping, but anyway.... (Oh, and I'm following your
> lead in allowing a destructive solution.)
>
> #!/usr/local/bin/perl -w
>
> my @lol = (
> [ "fred", "barney" ],
> [ "george", "judy", "elroy" ],
> [ "homer", "lisa", "bart" ],
> ) ;
>
> my @new = grep { $_ } map { map { shift @$_ } @lol }
> (0..(sort map { scalar @$_ } @lol)[-1]-1);
>
> print "@new\n"; # fred george homer barney judy lisa elroy bart
don't like temp variables? (like @new?) then do this:
print grep { $_ } map { map { shift @$_ } @lol }
(0..(sort map { scalar @$_ } @lol)[-1]-1);
>
>
> __END__
>
> David Black
> dblack@pilot.njin.net
--
_______________
Todd Smith
Perl Programmer
ITC^Deltacom
------------------------------
Date: 21 Nov 1998 04:28:38 GMT
From: comdog@computerdog.com (brian d foy)
Subject: Re: Question from a mega-geek
Message-Id: <comdog-1103380836040001@news.panix.com>
Keywords: just another new york perl hacker
In article <36561CF5.706D9DDB@hotmail.com>, sara starre <nospam.perl_rocks@hotmail.com> posted:
> OK I admit it I'm a total geek to ask this, but does anyone know where I
> can buy "perl-phenelia"? I'd love to get a sew-on patch of that
> "Programming Republic of PERL" with the camel on it for my jean jacket.
there is the Perl Mongers t-shirt <URL:http://www.pm.org/> with the
O'Reilly camel on it. all proceeds support Perl user groups :)
--
brian d foy <http://computerdog.com>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>
------------------------------
Date: 21 Nov 1998 04:30:44 GMT
From: comdog@computerdog.com (brian d foy)
Subject: Re: Security with .htaccess
Message-Id: <comdog-1103380838110001@news.panix.com>
Keywords: just another new york perl hacker
In article <rPm52.854$5v3.6703943@news.optonline.net>, "News" <dixonmat@pouch.com> posted:
> How do I add the routine to post or write to .htaccess with a username and a
> password on an Apache server automatically without going into telnet?
HTTPD::UserAdmin might be a good start.
good luck :)
--
brian d foy <http://computerdog.com>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>
------------------------------
Date: Thu, 19 Nov 1998 08:19:15 -0600
From: Joe Halbrook <inquiries@e-ads.net>
Subject: Re: sendmail flags
Message-Id: <365428E3.734D@e-ads.net>
Ian,
This is what I get when trying the -ol flag:
"ZMailer: ignored sendmail options: -ol"
Sorry. I'll try the -t flag and X-Errors-To: header.
(Any other suggestion out there are welcome!)
-Joe
> Options
> There are also a number of processing options that may be set.
> Normally these will only be used by a system administrator. Options
> may be set either on the command line using the -o flag or in the
> configuration file. .....
>
> l Pay attention to the Errors-To: header.
>
> Again Sorry Joe.
>
> Well you learn something new every day :-)
>
> --
> --
> Ian J. Garlick
> <ijg@csc.liv.ac.uk>
------------------------------
Date: 21 Nov 1998 04:23:11 GMT
From: comdog@computerdog.com (brian d foy)
Subject: Re: Server Administration with Perl
Message-Id: <comdog-1103380830370001@news.panix.com>
Keywords: just another new york perl hacker
In article <36550BDB.1B1A4A8C@sidhe.net>, Evert Smit <admin@sidhe.net> posted:
> snipplet for the following operations in a file? (Open,Close,Add line, Remove
> Line, Replace line) What i am trying to do is to manage the redirect file, that
> each user got in his directory.
* open a file
use the open() or sysopen() function
`perldoc -f open` for examples
* close a file
use the close() function
`perldoc -f close` for examples
* add/move/replace a line
print to a temporary file as mentioned in the FAQ.
`perldoc perlfaq` for a list of perl faq man pages
--
brian d foy <http://computerdog.com>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>
------------------------------
Date: Fri, 20 Nov 1998 16:07:44 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Sum by group
Message-Id: <g7p437.v6b.ln@flash.net>
Patrick Timmins (ptimmins@netserv.unmc.edu) wrote:
: In article <73442a$q21$1@nnrp1.dejanews.com>,
: c_b9209@my-dejanews.com wrote:
: > I want to sum by group in a data file were the first column has groups values
: > and other has regular values. The data file is really huge
: > here is a script for small file but it doesn't works for a big one,please can
: > anyone help me this problem make me crazy
: You posted this question once before under a different subject header
: .... why?
Maybe for easily indentifying plonkablility?
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 21 Nov 1998 03:56:30 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: Sum by group
Message-Id: <735dl9$u39$1@nnrp1.dejanews.com>
In article <claes_no_spam-2111980020160001@p16.one.canit.se>,
claes_no_spam@canit.se (Claes Bjorklund) wrote:
[snip]
> exampel
>
> indata
> 1 2 5 7 7
> 3 4 5 7 5
> 1 2 4 5 4
> 3 4 3 3 5
> 3 4 5 6 6
> 2 4 5 6 7
> 2 5 5 4 4
> and I want this
> outdata:
> 1 2 4 9 12 11
> 2 2 9 10 11 11
> 3 3 12 13 16 16
>
> the second column is the number in each group
> Of course the data file has more rows and columns
Now that you've defined your input, and how you want the output to
look, here is a variation of my earlier post that gives the output
you desire ... I was too lazy to start over from scratch, so
this may not be the most efficient way :)
while (<DATA>) {
@temp = split/\s+/;
for ($i=1; $i<@temp; $i++) {
push @{$group{$temp[0]}{$i}}, $temp[$i];
}
}
foreach $grp (sort keys %group) {
foreach $clmn (sort keys %{ $group{$grp} } ) {
$group{$grp}{sum} = 0; # have to reset this each time through the loop
$group{$grp}{count} = @{ $group{$grp}{$clmn} };
for ($i=0; $i<@{ $group{$grp}{$clmn} }; $i++) {
$group{$grp}{sum} += $group{$grp}{$clmn}[$i];
}
push @{ $group{$grp}{array} }, $group{$grp}{sum};
}
print "$grp $group{$grp}{count} @{ $group{$grp}{array} }\n";
}
__DATA__
1 2 5 7 7
3 4 5 7 5
1 2 4 5 4
3 4 3 3 5
3 4 5 6 6
2 4 5 6 7
2 5 5 4 4
Will print:
1 2 4 9 12 11
2 2 9 10 10 11
3 3 12 13 16 16
Again, hope that helps
Patrick Timmins
$monger{Omaha}[0]
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
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 4268
**************************************