[16679] in Perl-Users-Digest
Perl-Users Digest, Issue: 4091 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 22 09:05:37 2000
Date: Tue, 22 Aug 2000 06:05:19 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <966949519-v9-i4091@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 22 Aug 2000 Volume: 9 Number: 4091
Today's topics:
Re: Cannot run cgi... <gellyfish@gellyfish.com>
Re: Cansomeone please explain this hash error? <methabol@hem.passagen.se>
Communication link failure - DBI to SQL Server <iain_hosking@hotmail.com>
Comparing the content of two files <lem@ocean.com.au>
Direct screen access <chris@inta.net.uk>
Re: Functions and reference notation. nobull@mail.com
Gifgraph problems <sorana@bgumail.bgu.ac.il>
Re: Help with quotewords j355@my-deja.com
Help <paulino@jccm.es>
Re: Help <qhuo@brookes.ac.uk>
Re: how can I use perl to get a website? <Joachim.Pimiskern@de.bosch.com>
Re: how can I use perl to get a website? <feiyun-arthur.wang@nokia.com>
Re: how can I use perl to get a website? <Joachim.Pimiskern@de.bosch.com>
I haven´t exleined the problem clearly <paulino@jccm.es>
Indexes from DBI <heydenreich@delta.de>
Re: Indexes from DBI <gellyfish@gellyfish.com>
looking for taint resources (Thomas Brusca)
Re: looking for taint resources (Anno Siegel)
Re: MS IIS and perl syntax errors causing download prom (Martien Verbruggen)
Re: Net::Dns broken, gethostbyname OK <undergronk@my-deja.com>
Re: newbie Q: debugging - how to <bill.kemp@wire2.com>
Re: newline and carriage return problems <skv@iis.nsk.su>
Re: Opening new processes... <superman183@hotmail.com>
Re: Parse::Recdescent questions (<commit> and other pro (Damian Conway)
Re: Parse::Recdescent questions (<commit> and other pro (Damian Conway)
Re: Perl + Administration of NT4 <carvdawg@patriot.net>
Perl and SAP <Vorname.Nachname@kst.siemens.de>
Re: POP3 script in cgi (B Gannon)
Re: Procmail vs Perl. (Tony L. Svanstrom)
Re: Procmail vs Perl. (Tony L. Svanstrom)
Re: Procmail vs Perl. (Johan Vromans)
Re: regexing html-like tags <nickco3@yahoo.co.uk>
Running commands with arbitrary EUID and RUID (Andre Majorel)
Re: Running commands with arbitrary EUID and RUID (Rafael Garcia-Suarez)
Re: sending mail with mailx jon_nixon@my-deja.com
Re: Template In/File Out (Randal L. Schwartz)
Re: Variable vanishing? <abe@ztreet.demon.nl>
write a file in an array <jhijas@yahoo.es>
Re: write a file in an array <heydenreich@delta.de>
Re: write a file in an array <undergronk@my-deja.com>
Re: write a file in an array <abe@ztreet.demon.nl>
Re: write a file in an array <jhijas@yahoo.es>
Re: write a file in an array (Gwyn Judd)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 22 Aug 2000 09:35:45 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Cannot run cgi...
Message-Id: <RPro5.439$NE3.57332@news.dircon.co.uk>
On Tue, 22 Aug 2000 06:18:31 GMT, puzzlerrr@my-deja.com Wrote:
> Hi...
>
> stupid question...
>
> does anyone know what this msg "CGIwrap Error: User not in
> allow file!" means ?? it has something to do with the system
> instead of the program, i suppose ??
>
Yes. I would ask in one of the comp.infosystems.www.* groups as CGIwrap
is not specific to Perl programs.
/J\
------------------------------
Date: Tue, 22 Aug 2000 13:04:51 +0200
From: Dan Zetterstrom <methabol@hem.passagen.se>
Subject: Re: Cansomeone please explain this hash error?
Message-Id: <h5n4qsorcrlcpimg9j7phiprlqe85rpkoh@4ax.com>
On Mon, 21 Aug 2000 23:47:20 GMT, webqueen, queen of the web
<webqueen@my-deja.com> wrotc:
> untie attempted while 1 inner references still exist at ./sweep.pl line
>406 (#1)
>
>Inspecting the hash after the updates look like its working fine..
>
>My hash is populated with hashrefs (hash of hash)..
>
Check perltie in the doc. The section "The untie Gotcha" explains
this.
-DZ
--
Tell me your dreams and I will crush them.
------------------------------
Date: Tue, 22 Aug 2000 22:14:09 +1000
From: "Iain Hosking" <iain_hosking@hotmail.com>
Subject: Communication link failure - DBI to SQL Server
Message-Id: <39a26db1@pink.one.net.au>
I have a perl program (running on Windows NT, ActiveState Perl 522) which
has been faithfully inserting meteorological observations to a SQL Server
table using the DBI module and ODBC since April, but has suddenly started
producing 'Communication link failure' messages from the ODBC driver. Why
might this be?
I've posted this message to a couple of SQL Server forums but I'm sure other
perl users have experienced this problem and might know the reason.
Thanks a lot
Iain
------------------------------
Date: Tue, 22 Aug 2000 19:38:17 +1000
From: "Minh Le" <lem@ocean.com.au>
Subject: Comparing the content of two files
Message-Id: <8nth8s$lk6$1@perki.connect.com.au>
Hi,
In my perl script, I'm using diff ( Unix command) to work out the difference
in content between the two text files say A and B. The A file is my
reference file and used to check if any row in file B has been modified,
deleted or added.
The resulting file has shwon as follows:
+ sdadas ( + sign indicates this row has been added in B file)
- fdsfdsd ( - sign inidcates this row has been deleted in B file)
! dsdasds ( ! sign indicates this row has been modified in B file)
By using perl, can I extract the result into 3 different files, say,
mod.txt, del.txt and insert.txt.
Your help will be very much appreciated .
Regards
------------------------------
Date: Tue, 22 Aug 2000 14:04:45 +0100
From: "Chris Denman" <chris@inta.net.uk>
Subject: Direct screen access
Message-Id: <8ntttl$19hl$1@news2.vas-net.net>
Is it possible to change the video adapter mode to, say, 320X200X256 ?
I know the screen address is at a000 and is 64K in size (in 256 colour
mode).
The reason being, is I would love to write a simple game in Perl (and have
done so years ago in C).
Thanks,
Chris Denman
------------------------------
Date: 22 Aug 2000 08:50:57 +0100
From: nobull@mail.com
Subject: Re: Functions and reference notation.
Message-Id: <u9wvh9sizn.fsf@wcl-l.bham.ac.uk>
johnvert@my-deja.com writes:
> I have two and a half questions that are unrelated to each other (one
> and a half on functions, and one on reference notation), but since
> they're short I'll include them in the same post:
No, never include unrelated questions in the same post.
> 1. My Perl book ($Learning Perl$ by Schwartz and Christiansen) uses the
> words ``function'' and ``operator'' pretty much interchangeably, i.e.
> ``The open() operator'', which seems weird to me. Is it correct to use
> these terms interchangeably in Perl?
Yes, more or less. Most built-in functions and user-declared
functions (once they've been declared!) can be used without
parentheses.
> 1a. Most built-in functions I've used in Perl, as well as the ones I
> wrote can be used with or without parenthesis. However, I ran into a
> number of functions (the only ones that come to mind now are the ones
> from the Gtk-Perl package, but there were more examples) that required
> parenthesis and otherwise would not compile. Why is that? I have a
> feeling it's related to a precedence issue, but I'm not sure.
Maybe these functions have not been declared (at compile time).
Without the parentheses the compiler won't know they are functions.
If you put the parentheses is then the compiler will know that they
are functions and they'll be looked for at run time.
> print $arrayref->[0] . "\n";
>
> instead of:
>
> print @$arrayref[0] . "\n";
These are not quite equivalent. One extracts one element from the array
and the other a single element slice. In this context it makes no
difference but '-w' will warn you that you are using a single element slice.
$arrayref->[0] is equivalent to $$arrayref[0]
> %ENV->{SHELL}; instead of the more familiar (to me): $ENV{SHELL};
>
> AFAIK, 'ENV' isn't a reference (otherwise why would $ENV{SHELL} work?),
> so I was hoping someone could explain this syntax (or refer me to the
> right docs.)
This syntax is permitted by a known bug in the compiler. There have
been a number of threads about this in this newsgroup and more eurdite
discussion on the Perl-porters mailing list.
Do not use this syntax in your scripts as they will fail if and when
the bug in the compiler is fixed. In fact enough people are now
using this syntax that it is more likely that it'll be made a
mandatory warning rather than a fatal error, at least initially.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 22 Aug 2000 14:37:56 +0300
From: Sorana Fraier <sorana@bgumail.bgu.ac.il>
Subject: Gifgraph problems
Message-Id: <Pine.OSF.4.21.0008221424110.5002-100000@sansana.bgu.ac.il>
I'm trying to draw a pie/bar chart after searching publications through a
certain database (ENTREZ).
The search is performed correctly. A filename.gif is created but with zero
size.
The error I get is:
Data array 1:
length misfit at /usr/local/lib/perl5/site_perl/5.005/GIFgraph.pm line 316,
<ENTREZ> line 31.
The subroutine which draws the graph is:
sub create_pie {
my (@publications_per_year) = @_;
my (@X) = ();
my (@Y) = ();
@X=("1995","1996","1997","1998","1999","2000");
@Y=(@publications_per_year);
@data = ([@X],[@Y]);
$pie = new GIFgraph::pie( 500, 300);
$pie->set(
title => 'Publications Presented Per Year',
label => 'Label',
axislabelclr => 'black',
pie_height => 36,
);
$pie->plot_to_gif( "graphs/pie_chart$$.gif", \@data );
}
There isn't any chances of missing data within the array which should
replaced by undef. Any ideas will be highly appreciated.
Please email personally also to
sorana@bgumail.bgu.ac.il
------------------------------
Date: Tue, 22 Aug 2000 12:23:02 GMT
From: j355@my-deja.com
Subject: Re: Help with quotewords
Message-Id: <8ntral$7b3$1@nnrp1.deja.com>
Thanks for the pointer. I think this will solve the problem!
>
> If you want to roll your own, use Text::CSV_XS. If you want to do
> things like sort it in various orders or select only certain fields or
> certain records, then use DBD::CSV or DBD::RAM, both of which allow
you
> to treat CSV files as databases.
>
> Jeff
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 22 Aug 2000 13:01:54 +0200
From: "Paulino" <paulino@jccm.es>
Subject: Help
Message-Id: <8ntmg6$69c$1@diana.bcn.ttd.net>
Hello
I have a htm file with :
<table1>
<table2>
<table3>
program2.gif
</table3>
</table2>
</table1>
and I need a regular expresion for get the code between <table3> and
</table3>
Thanks very much, and I am sorry for my English, I am Spanish
------------------------------
Date: Tue, 22 Aug 2000 13:31:24 +0100
From: Qingning Huo <qhuo@brookes.ac.uk>
Subject: Re: Help
Message-Id: <39A2729C.E02749D7@brookes.ac.uk>
Paulino wrote:
>
> Hello
>
> I have a htm file with :
>
> <table1>
> <table2>
> <table3>
>
> program2.gif
>
> </table3>
> </table2>
> </table1>
>
> and I need a regular expresion for get the code between <table3> and
> </table3>
>
> Thanks very much, and I am sorry for my English, I am Spanish
$html =~ m/<table3>(.*?)</table3>/s;
$1 is what you want.
------------------------------
Date: Tue, 22 Aug 2000 09:43:07 +0200
From: Joachim Pimiskern <Joachim.Pimiskern@de.bosch.com>
Subject: Re: how can I use perl to get a website?
Message-Id: <39A22F0B.7838CB7D@de.bosch.com>
Hi,
Wang FeiYun schrieb:
> I heard that need the module "LWP:"
> What 's that , how to use?
LWP is not necessary, IO::Socket is sufficient:
use IO::Socket;
$remote = IO::Socket::INET->new(
Proto => "tcp",
PeerAddr => "ourworld.compuserve.com",
PeerPort => 80) or die "Can't connect";
print $remote "GET
http://ourworld.compuserve.com/homepages/JoachimPimiskern/\n";
while (<$remote>)
{
print
}
__DATA__
Greetings,
Joachim.
------------------------------
Date: Tue, 22 Aug 2000 08:42:04 GMT
From: "Wang FeiYun" <feiyun-arthur.wang@nokia.com>
Subject: Re: how can I use perl to get a website?
Message-Id: <w1ro5.7519$AM5.125444@news1.nokia.com>
I tried it, there is a error:
Can't connect at
$remote = IO::Socket::INET->new(
Proto => "tcp",
PeerAddr => "ourworld.compuserve.com",
PeerPort => 80) or die "Can't connect";
I have change the URL that I can access.
How could I know which module I have installed ?
--
============================================
Wang FeiYun
feiyun-arthur.wang@nokia.com
============================================
"Joachim Pimiskern" <Joachim.Pimiskern@de.bosch.com> wrote in message
news:39A22F0B.7838CB7D@de.bosch.com...
> Hi,
>
> Wang FeiYun schrieb:
> > I heard that need the module "LWP:"
> > What 's that , how to use?
>
> LWP is not necessary, IO::Socket is sufficient:
>
>
> use IO::Socket;
>
> $remote = IO::Socket::INET->new(
> Proto => "tcp",
> PeerAddr => "ourworld.compuserve.com",
> PeerPort => 80) or die "Can't connect";
> print $remote "GET
> http://ourworld.compuserve.com/homepages/JoachimPimiskern/\n";
>
> while (<$remote>)
> {
> print
> }
>
>
>
> __DATA__
> Greetings,
> Joachim.
------------------------------
Date: Tue, 22 Aug 2000 14:58:45 +0200
From: Joachim Pimiskern <Joachim.Pimiskern@de.bosch.com>
Subject: Re: how can I use perl to get a website?
Message-Id: <39A27905.5A314AB3@de.bosch.com>
Hi,
Wang FeiYun schrieb:
>
> I tried it, there is a error:
> Can't connect at
> $remote = IO::Socket::INET->new(
> Proto => "tcp",
> PeerAddr => "ourworld.compuserve.com",
> PeerPort => 80) or die "Can't connect";
>
> I have change the URL that I can access.
> How could I know which module I have installed ?
when the use <module> statement doesn't raise an error,
the module must be installed. AFAIK IO::Socket comes
along with the standard Perl distribution.
Probably you must change the PeerAddr to the name of
a computer you _can_ access (are you shielded by a
firewall ?).
You can get a feeling of what the script does if
you start
telnet <computer> 80
and type in GET http://...
Greetings,
Joachim
------------------------------
Date: Tue, 22 Aug 2000 13:45:43 +0200
From: "Paulino" <paulino@jccm.es>
Subject: I haven´t exleined the problem clearly
Message-Id: <8ntp4c$nfi$1@diana.bcn.ttd.net>
I need to change the table where is the program2.gif text by a table with
other tags.
<table>
..
<table>
..
<table>
..
<td>program2.gif</td>
..
</table>
..
</table>
..
</table>
If i aply the Regular Expresion
's/<table>.*?program2.gif.*?\/table>/$tablenew/igs' i get it next:
<newtable>
<td>program3.gif</td>
..
</newtable>
..
</table>
..
</table>
and i have lost the first part of the original text.
Regards
------------------------------
Date: Tue, 22 Aug 2000 10:52:13 +0200
From: Ralf Heydenreich <heydenreich@delta.de>
Subject: Indexes from DBI
Message-Id: <39A23F3D.2ACA7E3C@delta.de>
Hi,
how can I get the indexes of some or all tables in a database using DBI
driver? I'm using the Informix-DBD, and there's no hint about this
topic.
Ralf.
------------------------------
Date: Tue, 22 Aug 2000 11:57:41 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Indexes from DBI
Message-Id: <VUto5.6$pD2.598@news.dircon.co.uk>
On Tue, 22 Aug 2000 10:52:13 +0200, Ralf Heydenreich Wrote:
> Hi,
> how can I get the indexes of some or all tables in a database using DBI
> driver? I'm using the Informix-DBD, and there's no hint about this
> topic.
>
You will need to query the systables, syscolumns and sysindexes tables in
Informix as it is specific to the database server. If you need more help
on what information you will need from those tables then you will want
to ask in the comp.databases.informix newsgroup.
/J\
------------------------------
Date: 21 Aug 2000 21:12:20 GMT
From: tebrusca@oakland.edu (Thomas Brusca)
Subject: looking for taint resources
Message-Id: <8ns5vk$l1s$1@news2.acs.oakland.edu>
I've been all over perl sites, maybe I missed it.
I want a module that will let me EASILY filter
input on a character level from web forms.
Effective Perl book had something close but I want
more.
Also would like a collection of regex's for untainting
the input. Common things like URL, e-mail, whatever.
Now I could do both things myself, it's not too hard,
but I want "The Best Practice"
------------------------------
Date: 22 Aug 2000 12:36:22 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: looking for taint resources
Message-Id: <8nts46$1dk$1@lublin.zrz.tu-berlin.de>
Thomas Brusca <tebrusca@oakland.edu> wrote in comp.lang.perl.misc:
>I've been all over perl sites, maybe I missed it.
>I want a module that will let me EASILY filter
>input on a character level from web forms.
>Effective Perl book had something close but I want
>more.
Care to explain what the "something" from _Effective Perl Programming_
does and where it falls short of your expectations? "Filter input
on a character level" is hardly an adequate problem description.
>Also would like a collection of regex's for untainting
>the input. Common things like URL, e-mail, whatever.
Any regex with catching parentheses launders tainted data. What
you use depends entirely on your security requirements. No-one
here can tell you what these are.
>Now I could do both things myself, it's not too hard,
>but I want "The Best Practice"
"It isn't hard, but I prefer someone else do it, you're so much
better than I am". Pardon, but that sounds a little disingenuous.
Anno
------------------------------
Date: Tue, 22 Aug 2000 20:09:35 +1000
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: MS IIS and perl syntax errors causing download prompt
Message-Id: <slrn8q4kav.uou.mgjv@martien.heliotrope.home>
On Mon, 21 Aug 2000 12:55:48 -0700,
Frank Hanny <fchanny@lbl.gov> wrote:
> Regarding the issue I raised previously of certain perl cgi syntax
> errors resulting in prompt from the browser to download the file:
I don't see any mention of perl, Perl or even the---incorrect but often
used in CGI context---PERL. I don't think this has anything to do with
Perl at all. Could you please, in the future, post announcements like
this to appropriate newsgroups.
CGI new Perl
And Perl most certainly ne IIS.
Thank you.
Martien
--
Martien Verbruggen |
Interactive Media Division | Begin at the beginning and go on till
Commercial Dynamics Pty. Ltd. | you come to the end; then stop.
NSW, Australia |
------------------------------
Date: Tue, 22 Aug 2000 07:24:13 GMT
From: Scott Kirk <undergronk@my-deja.com>
Subject: Re: Net::Dns broken, gethostbyname OK
Message-Id: <8nt9qh$krj$1@nnrp1.deja.com>
In article <8ns7p1$e41$1@nnrp1.deja.com>,
dufalac@my-deja.com wrote:
> You've probably figured this out, but just in case, I figured I'd put
my
> 2 cents worth in.
>
> 1. Go to the <installdir>/blib/lib/Net
> 2. Edit the DNS.pm file on line 137.
>
> orig :
> return defined @mxlist ? @mxlist : ();
>
> new :
> return @mxlist ? @mxlist : ()
>
> This resolved my problem on Solaris 2.8 and perl 5.6.0
>
> Later for now :>
>
Thanks for the tip - I was wondering about the 'defined(@array) is
deprecated..' bit.
The other problem with Net::DNS wasn't so easy to solve: I tried to get
the lookups working for the best part of a day before I posted here,
and spent another hour trying other people's ideas. I even installed a
_really_ old version of Perl in case it was a compatibility issue with
the Net::DNS module.
My conclusion is that Net::DNS just isn't going to work on my NT system
(although I have had it working on an older machine which was running
as a DNS server - I will investigate further if I can find the time).
And my head was getting sore banging it on the wall.
So I basically gave up and installed Linux on an old PC. I had it
working in a couple of hours and had my results by the end of the day.
You live and learn, eh?
--
Scott Kirk
My deja.com mailbox is full of spam. Use this instead:
perl -e '$_ = "znvygb: haqretebax\@lnubb.pbz";
tr/A-Za-z/N-ZA-Mn-za-m/; print;'
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 22 Aug 2000 11:44:06 +0100
From: "W Kemp" <bill.kemp@wire2.com>
Subject: Re: newbie Q: debugging - how to
Message-Id: <966941237.21505.0.nnrp-09.c3ad6973@news.demon.co.uk>
Drew Simonis wrote in message <39A18F90.C8F0CC4B@attglobal.net>...
>Robert wrote:
>>
>> hello,
>>
>> I'm a bloody beginner with Perl having a quite complex program that syncs
>> two mysql dbs.
>>
>> Any help will be highly appreciated.
>>
>
># perldoc perldebug
># perldoc perlrun
Or if you prefer to crash into it-
perl -d nameofscript.pl
h or hh -for help
s -for step through (inc subroutines)
r -to get out of subroutines (esp useful when its the DBI stuff)
------------------------------
Date: Tue, 22 Aug 2000 14:15:18 +0600
From: "Konstantin Stupnik" <skv@iis.nsk.su>
Subject: Re: newline and carriage return problems
Message-Id: <8nt97t$1992$1@nl.novosoft.ru>
Hi!
> $lf = chr(10);
> $stuff =~/$lf//g;
When I want to be sure that there are no
\r or \n control characters, I'm using following
substitution:
$line=~s/\x0d|\x0a//g;
--
Best regards,
Konstantin.
Brainbench MVP for perl.
------------------------------
Date: Tue, 22 Aug 2000 07:29:40 -0400
From: "Dave" <superman183@hotmail.com>
Subject: Re: Opening new processes...
Message-Id: <39a2653e_2@news1.prserv.net>
Thanks guys.....
...all comments were appreciated. In the end I used the code supplied by
Martien (see earlier post), and got each child to do an exec. I was actually
able to increase the number of requests to 6, and still usually get
everything back in under 12 seconds, which was of course a marked
improvement on processing them one by one....
Best regards,
Dave
------------------------------
Date: 22 Aug 2000 07:49:10 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: Parse::Recdescent questions (<commit> and other problems.)
Message-Id: <8ntb9m$f5e$1@towncrier.cc.monash.edu.au>
Omri Schwarz <ocschwar@mit.edu> writes:
> Actually, I meant:
> operator_expression_1 :
> (operator_expression_2 operator_1)(s?) operator_expression_2
Okay. In that case you *definitely* want to use <leftop:...> there (and
everywhere else a similar pattern appears). That is:
operator_expression_1 :
<leftop: operator_expression_2 operator_1 operator_expression_2>
Damian
------------------------------
Date: 22 Aug 2000 07:52:17 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: Parse::Recdescent questions (<commit> and other problems.)
Message-Id: <8ntbfh$g1h$1@towncrier.cc.monash.edu.au>
Omri Schwarz <ocschwar@mit.edu> writes:
> Right now for some reason the rule for return statements,
> /return/ <commit> {print 'return';}
> (expression[context => 'return'])(?) ';'
> breaks because of whitespace preceding the return statement.
That's *very* odd.
> Parse::RecDescent::skip is '\s*'
> Is that not what it ought to be?
That's what it should be.
Are you changing $skip anywhere (with a <skip:...> directive perhaps)???
Damian
------------------------------
Date: Tue, 22 Aug 2000 07:19:07 -0400
From: H C <carvdawg@patriot.net>
Subject: Re: Perl + Administration of NT4
Message-Id: <39A261AB.438364AF@patriot.net>
Take a look at ForixNT, the NT Audit ToolKit...
http://patriot.net/~carvdawg/forixnt.html
Alessandro Augusto wrote:
> Hello,
>
> I am looking for tutorials, papers, articles or sites about how can
> I use perl to help administrate my NT network.
>
> Things that I would like to do:
> * remotely set values to the registry
> * remotely start/stop services
> * modify acls
> * etc
>
> I have been looking for this help, but Its has been hard to find.
> Can someone help me pointing me to the right direction.
>
> Thanks,
> Alessandro
--
Q: Why is Batman better than Bill Gates?
A: Batman was able to beat the Penguin.
------------------------------
Date: Tue, 22 Aug 2000 13:45:46 +0200
From: Vorname Nachname <Vorname.Nachname@kst.siemens.de>
Subject: Perl and SAP
Message-Id: <39A267EA.1D45EDF7@kst.siemens.de>
Hello,
i ahve a problem installing the SAP_RFC Module on a Suse Linux
distrubution. Does anybody have a runable SAP_RFC modul???
thanks a lot for your help
markus
------------------------------
Date: 22 Aug 2000 09:51:47 GMT
From: admin@kopnews.co.uk (B Gannon)
Subject: Re: POP3 script in cgi
Message-Id: <8ntifj$f8m$3@news.liv.ac.uk>
Hello
Try http://www.hotscripts.com or http://www.cgi-resources.com
In article a says...
>
>Hi all,
>
>I am looking for a script that -
>
>(a) allows users to check their POP3 mailboxes via a web page by entering
their
>email address, mail server, and password (similar to QD-POP), and
>(b) allows those same users to send email via the web page using the sendmail
>on my server
>
>Why sendmail?
>
>(a) Because I dont have an SMTP server that I can configure into the script,
>and
>(b) Many people don't know the difference between a POP server and an SMTP
>server, which could cause problems for them if I had a field for them to
>specify their SMTP server when sending mail
>
>If anyone knows of such a script, I would surely appreciate a response.
>
>Regards,
>Roy Pope
>Webmaster@rd-soft.com
>+++++++++++++++++
>Webmaster "Voice-Chat" conference room now open at -
>http://www.rd-soft.com/talklive/index.html
>
------------------------------
Date: Tue, 22 Aug 2000 12:14:51 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: Procmail vs Perl.
Message-Id: <1efrlri.1ucouin9rze0wN%tony@svanstrom.com>
Yiorgos Adamopoulos <adamo@dblab.ece.ntua.gr> wrote:
> In article <1efdoez.7o5j3nfazjb8N%tony@svanstrom.com>, Tony L. Svanstrom
> wrote:
>
> >I've now started working on a Perl-based solution; so far I've only got
> >a few lines that split up the headers and separate them from the body,
> >but I'm getting there. Altough I haven't focused too much on it so far
> >I'm doing my best to keep it nice to the system.
>
> Take care that whatever line is inputed in your script is not evaluated
> like a valid Perl expression and then executed. That could lead to nasty
> things happening from your account.
Took me a lil while to get what you were saying, that's so basic that I
doubt that anyone would miss it. I'd actually have to think about it to
add something like that, because most of the times that I use Perl it's
CGI-related; and therefore I always think about the security.
/Tony
--
/\___/\ Who would you like to read your messages today? /\___/\
\_@ @_/ Protect your privacy: <http://www.pgpi.com/> \_@ @_/
--oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
on the verge of frenzy - i think my mask of sanity is about to slip
---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
\O/ \O/ ©99-00 <http://www.svanstrom.com/?ref=news> \O/ \O/
------------------------------
Date: Tue, 22 Aug 2000 12:14:53 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: Procmail vs Perl.
Message-Id: <1efrlvq.1eke7hr97gyn2N%tony@svanstrom.com>
Uri Guttman <uri@sysarch.com> wrote:
> >>>>> "TLS" == Tony L Svanstrom <tony@svanstrom.com> writes:
>
> TLS> Tony L. Svanstrom <tony@svanstrom.com> wrote:
> >> A simple question: Why would I want to learn how to use procmail when I
> >> already know Perl, wouldn't it be easier, as well as potentially a lot
> >> more powerful, to simply use Perl for the mailfiltering?
>
> TLS> I've now started working on a Perl-based solution; so far I've
> TLS> only got a few lines that split up the headers and separate them
> TLS> from the body, but I'm getting there. Altough I haven't focused
> TLS> too much on it so far I'm doing my best to keep it nice to the
> TLS> system.
>
> too late.
>
> check out Mail::Procmail and Mail::Audit. both do what you want with
> different methods (one stole ideas from the other). i have checked them
> out and am starting to use the procmail one. both are very easy to use
> and allow you to check with perl code which place to deliver the
> message. no need to use plain procmail again. now we can have readable
> perl code splitting our mail.
>
> Mail::Procmail comes with a good example file which handles mailing
> lists, and many other mail types including spam.
Great, but... I've started making this as a lil guide to
do-it-yourself:ers (I know, I know, modules aint sumthin bad); and it's
part of yet another "I mean well but will miss every deadline with about
1-2 years"-project. ;)
/Tony
--
/\___/\ Who would you like to read your messages today? /\___/\
\_@ @_/ Protect your privacy: <http://www.pgpi.com/> \_@ @_/
--oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
DSS: 0x9363F1DB, Fp: 6EA2 618F 6D21 91D3 2D82 78A6 647F F247 9363 F1DB
---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
\O/ \O/ ©1999 <http://www.svanstrom.com/?ref=news> \O/ \O/
------------------------------
Date: 22 Aug 2000 14:01:03 +0200
From: JVromans@Squirrel.nl (Johan Vromans)
Subject: Re: Procmail vs Perl.
Message-Id: <wl3wvh9h5ds.fsf@plume.nl.compuware.com>
tony@svanstrom.com (Tony L. Svanstrom) writes:
> Tony L. Svanstrom <tony@svanstrom.com> wrote:
>
> > A simple question: Why would I want to learn how to use procmail when I
> > already know Perl, wouldn't it be easier, as well as potentially a lot
> > more powerful, to simply use Perl for the mailfiltering?
>
> Thank you all that answered.
>
> I've now started working on a Perl-based solution; so far I've only got
> a few lines that split up the headers and separate them from the body,
> but I'm getting there. Altough I haven't focused too much on it so far
> I'm doing my best to keep it nice to the system.
Check Mail::Procmail on CPAN.
Slightly different is Mail::Audit, also on CPAN.
-- Johan
------------------------------
Date: Tue, 22 Aug 2000 12:08:40 +0100
From: Nick Condon <nickco3@yahoo.co.uk>
Subject: Re: regexing html-like tags
Message-Id: <39A25F38.BD6184EC@yahoo.co.uk>
"Godzilla!" wrote:
> Larry Rosler wrote:
>
> > In article <39A1F849.770E9E4A@stomp.stomp.tokyo>,
> > godzilla@stomp.stomp.tokyo says...
> > > Someone wrote:
>
> (snippage)
>
> > Surely you know that a hash can hold only one datum per key.
> > If there will be several data per key, a different data
> > structure is appropriate. The needs of the application
> > determine the correct design.
>
> Precisely. This is why your code fails. I am curious
> why you would post bad code, knowing it is bad code.
>
> Godzilla!
Yes, Larry, you'll put Kira out of a job :-)
------------------------------
Date: Tue, 22 Aug 2000 12:27:44 +0000 (UTC)
From: aym@aym4.domicile.fr (Andre Majorel)
Subject: Running commands with arbitrary EUID and RUID
Message-Id: <slrn8q4vv2.jp.aym@aym4.domicile.fr>
Is there a module or something that would allow a Perl script
running as root to create processes with arbitrary effective and
real UID ? I'm looking for a function like :
system2 $uid, "/some/command -w options";
that would do about the same thing as :
system "su $user -c \"/some/command -w options\"";
but without the overhead of an extra process and the annoyance
of an extra level of quoting.
[Since I need to become root again after creating the child
process, I can't just do $< = $uid]
--
André Majorel <amajorel@teezer.fr> (it's really "teaser")
http://www.teaser.fr/~amajorel/
"I think I'll end it all," Sue sighed. -- Gyles Brandreth
------------------------------
Date: Tue, 22 Aug 2000 13:03:29 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Running commands with arbitrary EUID and RUID
Message-Id: <slrn8q4urp.cfv.rgarciasuarez@rafael.kazibao.net>
Andre Majorel wrote in comp.lang.perl.misc:
>Is there a module or something that would allow a Perl script
>running as root to create processes with arbitrary effective and
>real UID ?
fork() a child, set $>, and exec() the process.
--
Rafael Garcia-Suarez
------------------------------
Date: Tue, 22 Aug 2000 07:37:31 GMT
From: jon_nixon@my-deja.com
Subject: Re: sending mail with mailx
Message-Id: <8ntajq$lo5$1@nnrp1.deja.com>
The "-t" option takes care of the "sendmail-style stuff" - This approach
works fine. The only thing stopping tequila's mail from being sent
successfully is the missing pipe in "| /usr/bin/mailx -t". tequila wins
:)
I think the "~" tilde only escapes if your input is from a tty - but I
may be wrong so I'd probably avoid mailx too.
- Jon
In article <m1lmxqdw3r.fsf@halfdome.holdit.com>,
merlyn@stonehenge.com (Randal L. Schwartz) wrote:
<snip>
> Yes, you're using sendmail-style stuff (address in headers, headers on
> STDIN) with mailx (address on command line, no headers can be
> specified, STDIN is entire body). In other words, they have entirely
> different philosophies and cannot be interchanged. You lose. :)
<snip>
> Ouch ouch ouch ouch... What if $contenu has a line that begins with
> a tilde!? You now have a big BIG BIG security hole.
<snip>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 22 Aug 2000 05:14:56 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Template In/File Out
Message-Id: <m1zom5cx1b.fsf@halfdome.holdit.com>
>>>>> "Tim" == Tim Conrow <tim@ipac.caltech.edu> writes:
Tim> James Hunter wrote:
>>
>> I'm trying to read in a template file -- basically, something that has a lot
>> of text I'll be reusing -- and turn it into an actual file. ...
Tim> You might look at the Text::Template module on your local CPAN site.
Or any of the other few dozen solutions. I'm a bit biased toward
"Template::Toolkit", especially looking at version 2 which is now in
beta from the website at <http://www.template-toolkit.org>. Very nice
general framework, useful for both Makefile-style operations as well
as dynamic runs (caching the transformation code).
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Tue, 22 Aug 2000 11:34:57 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: Variable vanishing?
Message-Id: <g8g4qs8mgc50gboak8h8cecirup8691kqu@4ax.com>
On 22 Aug 2000 00:54:58 -0400, darkon@one.net (David Wall) wrote:
> abe@ztreet.demon.nl (Abe Timmerman) wrote in
> <fdi3qsorchuaiterrc9c7gvsl0k6cm4lur@4ax.com>:
>
> >On Mon, 21 Aug 2000 20:32:56 GMT, Steven Merritt
> ><smerr612@mailandnews.com> wrote:
> >
> >> my $From_Date = 20000000000000;
> >> my $To_Date = 20000525135144;
> >
> >I would declare those as strings:
> >
> > my $From_Date = '20000000000000';
> > my $To_Date = '20000525135144';
>
> Just out of curiousity, why would you do that? Why does it matter?
Because they are strings, usually constructed as strings.
Writing them as numbers gives the impression they're integers, which
they're not (on 32 bit platforms without the use64bitint config option).
--
Good luck,
Abe
------------------------------
Date: Tue, 22 Aug 2000 10:22:11 +0200
From: Javier Hijas <jhijas@yahoo.es>
Subject: write a file in an array
Message-Id: <39A23833.D51090C9@yahoo.es>
Can you tell me a nice way to copy an entire file in an array?
i.e:
print @file <=========> while (<FILE>){
print;
}
------------------------------
Date: Tue, 22 Aug 2000 11:07:28 +0200
From: Ralf Heydenreich <heydenreich@delta.de>
Subject: Re: write a file in an array
Message-Id: <39A242CF.92C14788@delta.de>
try this (the easiest way):
$idx=0;
while(<FILE>)
{
$file[$idx]=$_;
$idx++;
}
Ralf.
Javier Hijas wrote:
> Can you tell me a nice way to copy an entire file in an array?
>
> i.e:
>
> print @file <=========> while (<FILE>){
> print;
> }
------------------------------
Date: Tue, 22 Aug 2000 09:13:27 GMT
From: Scott Kirk <undergronk@my-deja.com>
Subject: Re: write a file in an array
Message-Id: <8ntg7d$rhk$1@nnrp1.deja.com>
In article <39A23833.D51090C9@yahoo.es>,
Javier Hijas <jhijas@yahoo.es> wrote:
> Can you tell me a nice way to copy an entire file in an array?
>
easypeasy - simply read the file in a list context
open (FH, 'afile');
@gulp = <FH>;
and read
perldoc -f readline
and
perldoc perlop - look in the IO operators section.
NB..
"If a <FILEHANDLE> is used in a context that is looking for a list, a
list consisting of all the input lines is returned, one line per list
element. It's easy to make a LARGE data space this way, so use with
care."
HTH
--
Scott Kirk
My deja.com mailbox is full of spam. Use this instead:
perl -e '$_ = "znvygb: haqretebax\@lnubb.pbz";
tr/A-Za-z/N-ZA-Mn-za-m/; print;'
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 22 Aug 2000 11:41:24 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: write a file in an array
Message-Id: <kki4qscqfof9s3nc5sakj1312237as4qfq@4ax.com>
On Tue, 22 Aug 2000 10:22:11 +0200, Javier Hijas <jhijas@yahoo.es>
wrote:
> Can you tell me a nice way to copy an entire file in an array?
>
> i.e:
>
> print @file <=========> while (<FILE>){
> print;
> }
my @file = <FILE>;
--
Good luck,
Abe
------------------------------
Date: Tue, 22 Aug 2000 11:42:13 +0200
From: Javier Hijas <jhijas@yahoo.es>
Subject: Re: write a file in an array
Message-Id: <39A24AF5.3B7A9862@yahoo.es>
Ok, I already found a fancy way!!:
while (<FILE>) {
push @file,$_;
}
I wrote:
>
> Can you tell me a nice way to copy an entire file in an array?
>
> i.e:
>
> print @file <=========> while (<FILE>){
> print;
> }
------------------------------
Date: Tue, 22 Aug 2000 13:05:00 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: write a file in an array
Message-Id: <slrn8q4ujp.4ed.tjla@thislove.dyndns.org>
I was shocked! How could Ralf Heydenreich <heydenreich@delta.de>
say such a terrible thing:
>try this (the easiest way):
>$idx=0;
>while(<FILE>)
>{
> $file[$idx]=$_;
> $idx++;
>}
*sigh* What's wrong with push?
push @file while (<FILE>);
*double sigh* what's wrong with using the diamond operators in a list
context?
@file = <FILE>;
*triple sigh* WHy don;t you read it line by line anyway?
while (<FILE>)
{
# do something
}
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Skydiving... good 'till the last drop.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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.
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 V9 Issue 4091
**************************************