[22755] in Perl-Users-Digest
Perl-Users Digest, Issue: 4976 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 13 03:06:14 2003
Date: Tue, 13 May 2003 00:05:18 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 13 May 2003 Volume: 10 Number: 4976
Today's topics:
Re: "Premature end of script headers" Error <urzaserra@home.com>
Re: "Premature end of script headers" Error <emschwar@pobox.com>
Re: @Array - making it null <dont-reply@this.address>
Re: @Array - making it null <uri@stemsystems.com>
Re: Bloody Java Proselytisers!!! <pkent77tea@yahoo.com.tea>
Re: CGI.pm buffer overflow security?? <REMOVEsdnCAPS@comcast.net>
Re: changing the date <Steffen.Beyer@de.bosch.com>
DBD Oracle - how to read results of stored procedure? <revjack@revjack.net>
Re: DBD Oracle - how to read results of stored procedur <andy@andyh.co.uk>
Re: DBD Oracle - how to read results of stored procedur <usenet@tinita.de>
Re: egrep exclude <abigail@abigail.nl>
Re: egrep exclude <tassilo.parseval@rwth-aachen.de>
Re: How can I right-justify in a pattern substitution? <skuo@mtwhitney.nsc.com>
Managing remote win32 hosts <MHW@MHW.com>
Re: Managing remote win32 hosts <News@LearnQuick.Com>
Merging CGI Cookie into Existing Perl Script <chris_12003@yahoo.com>
Re: Merging CGI Cookie into Existing Perl Script <mbudash@sonic.net>
Need help testing a gzip file for corruption <not@home.net>
Re: Need help testing a gzip file for corruption <urael@zrgebcbyvf.arg.nh>
Re: pattern match A or B with Y or Z (Ido Trivizki)
Re: Question about Net::SMTP <nothing@home.yet>
Re: Replying to Posts ( was: Re: check IP address ) <mgjv@tradingpost.com.au>
Re: Splitting, Sorting, then Rebuilding an Array <sammie@greatergreen.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 12 May 2003 15:07:32 -0700
From: "matt" <urzaserra@home.com>
Subject: Re: "Premature end of script headers" Error
Message-Id: <kWUva.18458$hd6.4623@fed1read05>
"fernando" <null@null.com> wrote in message
news:3ebe6eaf$1_4@news.arrakis.es...
> Hi all!
>
> I have just copied and pasted an script example that uses GD, from:
> http://shawn.apocabilly.org/pwg/examples/4ex.html
>
> And when i execute it on my apache server, under red hat 8, it throws a
500
> error, and prints:
>
> Server error!
> Premature end of script headers: sample2.pl
>
> Error 500
>
> Does any one know whats happening, and how to fix it?
>
> Thanks a lot
Have you tried making sure your shebang line is correct i was having the
same problem and it turned out that i had an incorrect perl path for that
particular server.
> Fernando
> Madrid, Spain
>
>
------------------------------
Date: 12 May 2003 16:14:44 -0600
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: "Premature end of script headers" Error
Message-Id: <eto8ytbhkx7.fsf@wormtongue.emschwar>
"fernando" <null@null.com> writes:
> I have just copied and pasted an script example that uses GD, from:
> http://shawn.apocabilly.org/pwg/examples/4ex.html
>
> And when i execute it on my apache server, under red hat 8, it throws a 500
> error, and prints:
>
> Server error!
> Premature end of script headers: sample2.pl
>
> Error 500
>
> Does any one know whats happening, and how to fix it?
$ perldoc -q 500
Found in /usr/share/perl/5.8.0/pod/perlfaq9.pod
My CGI script runs from the command line but not the browser.
(500 Server Error)
In general, it is wise to search the documentation for information
related to your problem before posting. Using 'perldoc' (included
with your Perl distribution) is probably the easiest way to do it.
Run 'perldoc perldoc' for more information on how to use it right.
-=Eric (look ma, bricktext!)
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
------------------------------
Date: Mon, 12 May 2003 18:52:18 -0700
From: Balaji Venkataraman <dont-reply@this.address>
Subject: Re: @Array - making it null
Message-Id: <Pine.GSO.4.44.0305121843480.10521-100000@leith>
So now that the experts say that undef is not a good thing to do, I
have a question.
I've see people do this to read the whole file in one fell swoop:
Code 1
------
local $/ = undef;
while (<>) {
$file_text = $_;
}
Code 2
------
while (<>) {
$file_text = join ("", $_);
}
I've often used "Code 1". Which is better? Since in Perl TMTOWTDI, I'm
sure there are many other ways - want to know which is the best.
Thanks,
Bala.
On Wed, 7 May 2003, Uri Guttman wrote:
> so why don't you post what you found? you may have actually found a bad
> method and will have problems with it. did you solve it with undef? i am
> guessing that because above you mentioned the term defined. if you did
> that, then it you did not find the correct way which is to assign an
> empty list to the array:
>
> @array = () ;
>
--
Balaji Venkataraman
916-855-5177x3148
------------------------------
Date: Tue, 13 May 2003 03:14:07 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: @Array - making it null
Message-Id: <x7fznjilmo.fsf@mail.sysarch.com>
>>>>> "BV" == Balaji Venkataraman <dont-reply@this.address> writes:
BV> So now that the experts say that undef is not a good thing to do, I
BV> have a question.
BV> I've see people do this to read the whole file in one fell swoop:
BV> Code 1
BV> ------
BV> local $/ = undef;
the undef is redundant. local $/ will set it to undef.
BV> while (<>) {
BV> $file_text = $_;
BV> }
that is very odd code.
$file_text = <>;
that is all you need there. why loop when you are going to slurp in one
read call?
BV> Code 2
BV> ------
BV> while (<>) {
BV> $file_text = join ("", $_);
BV> }
that is just slow slurping.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Mon, 12 May 2003 23:52:23 GMT
From: pkent <pkent77tea@yahoo.com.tea>
Subject: Re: Bloody Java Proselytisers!!!
Message-Id: <pkent77tea-9317CB.00433113052003@dev.rsn.selsyn.co.uk>
and I'll take this opportunity to wonder what Sun Microsystems were
thinking of in the solaris 8 installers.
"So, with the Sol 8 installer we can quite happily write the main
installer to run on the console in text mode or on the X11 console if a
monitor is plugged in, using some Java/Swing point and click interface.
Fine.
For our next trick we shall not bother in the slightest making the
Disksuite installer[1] run in text mode, requiring the admin[2] to walk
all the way to the server room, mount the CD, return to the desk, run
the installer on his X server, walk back to the server to get the CD..."
And then there's Limewire which runs rather sluggishly on a 900MHz PC.
Nine hundred million hertz. I mean, I'm sure Java _itself_ is pretty
darned quick but no-one ever seems to use it for anything other than
horrible GUI things that make me want to test out the "Now shreds CDs!"
feature on the shredder.
If anyone can point me to something like the Perl Power Tools programs
in java I'll see how they perform on my system. Comparing banner or
hexdump or ls (in java, C and perl version) could be a nice simple
comparison.
Just my tuppence based on using programs, not actually writing java.
P
[1] Which was totally unnecessary, as I found out after the install. A
Small Shell Script with a load of pkgadds would have done the trick,
near enough
[2] guess who
--
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply
------------------------------
Date: Mon, 12 May 2003 18:47:40 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: CGI.pm buffer overflow security??
Message-Id: <Xns9379C94508FBBsdn.comcast@216.166.71.239>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
tivolinewbie@canada.com (Kenjis Kaan) wrote in
news:6a8ba9f8.0305121359.4080d37f@posting.google.com:
> As a user of the CGI.pm module, I am wondering if the module has
any
> builtin check against incoming parameter data?
>
> my $cgiPtr = new CGI;
> my $incomingParamData = $cgiPtr->param('SomeTextArea')
>
> Does CGI.pm validate the data taht is coming up through
'SomeTextArea'
> or not? or do we have to do the validation ourselves?
>
> I am of course thinking of attacks such as buffer overflows. TIA
>
CGI.pm has a flag that you can set that limits the quantity of data
that can be uploaded. I forget what it is, but it's easy to find in
the docs. Also there is a flag to disable file uploads, iirc.
It wouldn't really be a buffer overflow attack, since Perl is just
about immune to those. People have had in-memory strings of many
megabytes in Perl with no problem. Rather, it is an attack that
swamps your bandwidth. But hey, either way it's best to limit it.
- --
Eric
print scalar reverse sort qw p ekca lre reh
ts uJ p, $/.r, map $_.$", qw e p h tona e;
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32) - WinPT 0.5.13
iD8DBQE+wDJ5Y96i4h5M0egRAnLwAJ4+5xOIgU4l5vacJB7XWS5NKskYnQCfQrpG
ns5AAeALdy860dh4NwaOEXI=
=DYkU
-----END PGP SIGNATURE-----
------------------------------
Date: Tue, 13 May 2003 08:49:40 +0200
From: "Steffen Beyer" <Steffen.Beyer@de.bosch.com>
Subject: Re: changing the date
Message-Id: <b9q4i5$bbm$1@ns2.fe.internet.bosch.com>
"Mario542" <member17678@dbforums.com> wrote:
> Steffen,
> after I change the date using
> use Date::Calc qw(:all);
>
> my(@date) = (2003,4,17);
>
> my(@tomorrow) = Add_Delta_Days(@date, +1);
> it looks like (2003 4 18) which works fine. Do you know if there is a
> way to add periods to the date like 2003.4.18 so that it can be used in
> a database query?? Thanks for all the help
You should definitely read a book about Perl programming,
or browse the Perl documentation that comes with your Perl
installation. The payoff will make it worth your while!
Start with "perldoc perl" for an index of available Perl
manual pages.
You want string concatenation, string interpolation, sprintf(), or join():
(Remember the Perl motto: "There is more than one way to do it")
$string = $date[0].'.'.$date[1].'.'.$date[2];
$string = "$date[0].$date[1].$date[2]";
$string = sprintf("%d.%d.%d", @date);
$string = sprintf("%d.%02d.%02d", @date); # always 2 digits for month and day (zero-padded)
$string = join('.', @date);
Good luck!
Steffen
------------------------------
Date: 12 May 2003 22:24:27 GMT
From: revjack <revjack@revjack.net>
Subject: DBD Oracle - how to read results of stored procedure?
Message-Id: <b9p6ur$4ss$1@news1.radix.net>
Keywords: Hexapodia as the key insight
Hello,
Using DBI/DBD Oracle, I am able to query our client's Oracle
database using SELECT statements with no trouble; I use
$sth->fetchrow to grab the rows from the response after
$sth->execute, etc.
Now I am informed that there is a new thing to query there,
a stored procedure S_PROC1. My instructions from the DBA
are:
1) log in using SQL*PLUS
2) type "set server output on;<CR>"
3) type "execute S_PROC1('your_input');<CR>
That's great, except I'm not using SQL*PLUS, I'm using perl.
Googling usenet and the web seems to indicate that
fetchrow() is not the appropriate method for pulling data
from a PL/SQL execute.
The following script returns the results of a SELECT
statement correctly. How would I modify it to perform the
two SQL*PLUS steps above?
#!/usr/bin/perl
use DBI;
[$host, $dbname, $dbuser and $dbpasswd assigned here]
$dbh = DBI->connect("dbi:Oracle:host=$host;sid=$dbname", $dbuser, $dbpasswd)
or die "Unable to connect: $DBI::errstr";
$sql = q(select ename, job from emp);
$sth = $dbh->prepare($sql) or die "prepare failed: $DBI::errstr";
$sth->execute or die "execute failed: $DBI::errstr";
while (($ename, $job) = $sth->fetchrow) {
print "$ename\t$job\n";
}
------------------------------
Date: Tue, 13 May 2003 00:20:45 +0100
From: Andy Hassall <andy@andyh.co.uk>
Subject: Re: DBD Oracle - how to read results of stored procedure?
Message-Id: <9na0cv4p17v8ib03qj8n4toeuovlffff3d@4ax.com>
On 12 May 2003 22:24:27 GMT, revjack <revjack@revjack.net> wrote:
>Now I am informed that there is a new thing to query there,
>a stored procedure S_PROC1. My instructions from the DBA
>are:
>
>1) log in using SQL*PLUS
>2) type "set server output on;<CR>"
>3) type "execute S_PROC1('your_input');<CR>
>
>That's great, except I'm not using SQL*PLUS, I'm using perl.
>Googling usenet and the web seems to indicate that
>fetchrow() is not the appropriate method for pulling data
>from a PL/SQL execute.
>
>The following script returns the results of a SELECT
>statement correctly. How would I modify it to perform the
>two SQL*PLUS steps above?
It looks like that procedure will be outputting through dbms_output, if it
produces any output; it's not returning a result set in any way (at least not
if executed as per the instructions above).
Have a look here:
http://search.cpan.org/author/TIMB/DBD-Oracle-1.14/Oracle.pm#dbms_output_enable_dbms_output_put_dbms_output_get
So the modifications would look something like:
#!/usr/bin/perl
use DBI;
[$host, $dbname, $dbuser and $dbpasswd assigned here]
$dbh = DBI->connect("dbi:Oracle:host=$host;sid=$dbname", $dbuser, $dbpasswd)
or die "Unable to connect: $DBI::errstr";
$sql = q(
begin
dbms_output.enable(1000000);
s_proc1(?);
end
);
$sth = $dbh->prepare($sql) or die "prepare failed: $DBI::errstr";
$sth->execute($yourInputHere) or die "execute failed: $DBI::errstr";
while (my $line = $dbh->func('dbms_output_get')) {
print "$line\n";
}
--
Andy Hassall (andy@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
------------------------------
Date: 12 May 2003 23:31:20 GMT
From: Tina Mueller <usenet@tinita.de>
Subject: Re: DBD Oracle - how to read results of stored procedure?
Message-Id: <b9pas8$l52h7$1@ID-24002.news.dfncis.de>
revjack <revjack@revjack.net> wrote:
> That's great, except I'm not using SQL*PLUS, I'm using perl.
> Googling usenet and the web seems to indicate that
> fetchrow() is not the appropriate method for pulling data
> from a PL/SQL execute.
i don't know about oracle; AFAIR this worked for me with
a sybase database; have you tried it out? (for a test you
can just temporarily create a stored procedure)
it also depends, of course, what the sp does and what
it returns.
hth, tina
--
http://www.tinita.de/ \ enter__| |__the___ _ _ ___
http://Movies.tinita.de/ \ / _` / _ \/ _ \ '_(_-< of
http://www.perlquotes.de/ \ \ _,_\ __/\ __/_| /__/ perception
http://www.tinita.de/peace/link.html - Spread Peace
------------------------------
Date: 12 May 2003 23:37:05 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: egrep exclude
Message-Id: <slrnbc0c11.2dr.abigail@alexandra.abigail.nl>
Tassilo v. Parseval (tassilo.parseval@rwth-aachen.de) wrote on MMMDXLI
September MCMXCIII in <URL:news:b9p11l$8he$1@nets3.rz.RWTH-Aachen.DE>:
`' Also sprach Abigail:
`'
`' > James E Keenan (jkeen@concentric.net) wrote on MMMDXLI September MCMXCIII
`' > in <URL:news:b955da04.0305120829.1885e1fd@posting.google.com>:
`' > ^^ patyoung13@hotmail.com (Herb Burnswell) wrote in message news:<3b38898e.0305112012.7af3e9b8@posting.google.com>...
`'
`' > ^^ > chdir $builddir;
`' > ^^ >
`' > ^^ > $commandline = "find . -type f -name *.log | xargs egrep -i error";
`' > ^^ > system ($commandline);
`' > ^^ >
`' > ^^ At the risk of being accused of not answering your question directly,
`' > ^^ I'd like to ask: Why are you running a Perl script which ends up
`' > ^^ going out to the shell when you could accomplish everything you want
`' > ^^ entirely inside Perl?
`' >
`' > As someone who regulary "shells" out to the Unix toolbox, is there
`' > something fundamentally wrong with shelling out? Would you complain
`' > as well if someone is using the DBI because that's using compiled C,
`' > instead of doing it all in Perl?
`'
`' The problem with shelling out is not that it involves compiled C. On the
`' contrary, if I can choose between a module written in pure Perl and one
`' containing XS-portions I usually go for the latter for the sake of
`' performance (provided that the XS module is as convenient as the Perl
`' one).
`'
`' If you invoke the shell from Perl you need a better reason than stating
`' that you do it "regularly". A 'qx!cp * /tmp!' could be either quicker or
`' (or even and) more convenient than using File::Copy so why not? But an
`' egrep task is Perl's realm. You have more powerful regexes, save the
`' spawning of a new process, remain portable etc.
But
"find . -type f -name *.log | xargs egrep -i error"
is a lot more than just an egrep. The fact that Perl has more powerful
regexes is irrelevant - no complicated search is done.
Could you do the above in one line of Perl? Could you convince me that
it's always significantly faster in Perl? Many times people have said
File::Find is faster than 'find' - but whenever I ask for a benchmark,
I've never gotten a reply.
As for "remaining portability", don't overrate portability. Many programs
are written that don't need to run outside of a particular environment.
Don't assume that everyone posting here is writing software for the purpose
of distributing it to the masses.
`' > ^^ Sitting at a Windows terminal, I don't have the opportunity to test
`' > ^^ out your shell command or look up the man pages. So I can't write and
`' > ^^ test the Perl script that would be the answer to your needs.
`' >
`' > That seems a poor reason to me to not shell out.
`'
`' I think it's a good reason. Why should he shell out an egrep thing if
`' his shell couldn't handle it?
You completely lost me here. I assume that the O.P's shell certainly
can handle egrep, otherwise, he wouldn't use it. However, the fact that
James (the replier) can't use egrep, and is hence unable to answer the
question, seems a poor reason for Herb (the original poster) to not
use find or egrep.
Abigail
--
# Perl 5.6.0 broke this.
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi
------------------------------
Date: 13 May 2003 06:05:09 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: egrep exclude
Message-Id: <b9q1ul$qsv$1@nets3.rz.RWTH-Aachen.DE>
Also sprach Abigail:
> Tassilo v. Parseval (tassilo.parseval@rwth-aachen.de) wrote on MMMDXLI
> September MCMXCIII in <URL:news:b9p11l$8he$1@nets3.rz.RWTH-Aachen.DE>:
> `' Also sprach Abigail:
> `' > As someone who regulary "shells" out to the Unix toolbox, is there
> `' > something fundamentally wrong with shelling out? Would you complain
> `' > as well if someone is using the DBI because that's using compiled C,
> `' > instead of doing it all in Perl?
> `'
> `' The problem with shelling out is not that it involves compiled C. On the
> `' contrary, if I can choose between a module written in pure Perl and one
> `' containing XS-portions I usually go for the latter for the sake of
> `' performance (provided that the XS module is as convenient as the Perl
> `' one).
> `'
> `' If you invoke the shell from Perl you need a better reason than stating
> `' that you do it "regularly". A 'qx!cp * /tmp!' could be either quicker or
> `' (or even and) more convenient than using File::Copy so why not? But an
> `' egrep task is Perl's realm. You have more powerful regexes, save the
> `' spawning of a new process, remain portable etc.
>
> But
>
> "find . -type f -name *.log | xargs egrep -i error"
>
> is a lot more than just an egrep. The fact that Perl has more powerful
> regexes is irrelevant - no complicated search is done.
>
> Could you do the above in one line of Perl? Could you convince me that
> it's always significantly faster in Perl? Many times people have said
> File::Find is faster than 'find' - but whenever I ask for a benchmark,
> I've never gotten a reply.
Granted, I couldn't do the above in one line (or at least in a
reasonably short line). What stroke me as odd in the OP's example is the
fact that the above line system()ed is a no-op unless all he wants is
indeed the output of this command to stdout. The OP simply wants to
parameterize his search so that I wonder whether he isn't better off
using a shell script. Using the shell from Perl makes sense when you
gather the output of the shell commands and want to process it further
with Perl. But his attempt appears to contain 95% shell and only a tiny
bit of Perl.
> As for "remaining portability", don't overrate portability. Many programs
> are written that don't need to run outside of a particular environment.
> Don't assume that everyone posting here is writing software for the purpose
> of distributing it to the masses.
Yes, portability is only one side and often not the important one.
Another one was exhibited by the OP. He asked a question more about
egrep than about Perl so using the shell from Perl requires to both know
Perl and the shell commands that shall eventually be used. Therefore,
doing it all within Perl can be easier depending on the programmer's
experience with external tools. I sometimes do it the other way round:
when I don't know how to achieve a particular bit in a series of shell
commands, I plug a little bit of Perl in between because I often know
how to do this way.
> `' > ^^ Sitting at a Windows terminal, I don't have the opportunity to test
> `' > ^^ out your shell command or look up the man pages. So I can't write and
> `' > ^^ test the Perl script that would be the answer to your needs.
> `' >
> `' > That seems a poor reason to me to not shell out.
> `'
> `' I think it's a good reason. Why should he shell out an egrep thing if
> `' his shell couldn't handle it?
>
> You completely lost me here.
Never mind. This was not to be taken completely serious. I should have
added an SCNR there.
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: Mon, 12 May 2003 19:14:29 -0700
From: Steven Kuo <skuo@mtwhitney.nsc.com>
Subject: Re: How can I right-justify in a pattern substitution?
Message-Id: <Pine.GSO.4.21.0305121908180.19789-100000@mtwhitney.nsc.com>
On Mon, 12 May 2003, David K. Wall wrote:
> ...
> I'm not sure why I bothered, but in the spirit of TMTOWTDI, here's a
> variation. (in case there are more than three columns, I guess)
>
>
> $_ = '|';
> my ($row, $blk, $col, $other) = (132, 3, 27, 1234);
> s/\|/f(' %4d ',$row, $blk, $col, $other)/e;
> print;
>
> sub f {
> my $formstr = shift;
> @_ = map { sprintf $formstr, $_ } @_;
> return '|' . join('|', @_) . '|';
> }
>
>
Yet another way:
$_ = "Here's an example | \n";
my ($row, $blk, $col) = (132, 3, 27);
formline '| @## | @## | @## |', $row, $blk, $col;
s/\|/$^A/;
print;
--
Regards,
Steve
------------------------------
Date: Mon, 12 May 2003 21:53:51 -0700
From: "MHW" <MHW@MHW.com>
Subject: Managing remote win32 hosts
Message-Id: <1__va.18607$hd6.16534@fed1read05>
What is the best way to run scripts on remote windows hosts from a Linux
server. Specifically, I want the ability to pole for service availability
(HTTP, Terminal Services, etc.) on a Windows Load Balanced Cluster (WLBS)
and generate windows commands from the Linux server to remove hosts from the
cluster.
Thanks!
------------------------------
Date: Tue, 13 May 2003 05:59:34 GMT
From: "Herb Martin" <News@LearnQuick.Com>
Subject: Re: Managing remote win32 hosts
Message-Id: <aR%va.13142$7x.1142339@twister.austin.rr.com>
> What is the best way to run scripts on remote windows hosts from a Linux
> server. Specifically, I want the ability to pole for service availability
> (HTTP, Terminal Services, etc.) on a Windows Load Balanced Cluster (WLBS)
> and generate windows commands from the Linux server to remove hosts from
the
> cluster.
Your best bet is probably to run the Microsoft
Telnet services (at least on Win2000+) and make
sure you have ActiveState installed on those hosts.
You could also build a custom Perl service/daemon
for doing such things.
Herb Martin
Try ADDS for great Weather too:
http://adds.aviationweather.noaa.gov/projects/adds
------------------------------
Date: Tue, 13 May 2003 01:41:23 GMT
From: "Chris" <chris_12003@yahoo.com>
Subject: Merging CGI Cookie into Existing Perl Script
Message-Id: <73Yva.566579$OV.538573@rwcrnsc54>
I have a classifieds ad program that someone else wrote and I'm modifying it
so that it remembers your logon information from a cookie. They setup the
program so that it calls modules in separate .pl files and I was wondering
how I get the cookie part below to work. I call the CGI in the main.cgi
then call the cookie in the module.
When I try to run it, it displays the following and doesn't store a cookie
on my computer
Set-Cookie: preferences=text&black&background&silver; path=/; expires=Thu,
12-Jun-2003 01:17:46 GMT Date: Tue, 13 May 2003 01:17:46 GMT Content-Type:
text/html; charset=ISO-8859-1
Thanks,
Chris
main.cgi
#!/usr/bin/perl5
use CGI qw(:standard :html3);
&auth_logon1_page
.
.
.
----------------------------------------
auth_logon1_page.pl
sub auth_logon1_page
.
.
.
%preferences = cookie('preferences');
$preferences{'background'} = $preferences{'background'} || 'silver';
$preferences{'text'} = $preferences{'text'} || 'black';
$the_cookie = cookie(-name=>'preferences',
-value=>\%preferences,
-expires=>'+30d');
print header(-cookie=>$the_cookie);
.
.
.
------------------------------
Date: Tue, 13 May 2003 02:02:38 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: Merging CGI Cookie into Existing Perl Script
Message-Id: <mbudash-659B91.19023912052003@typhoon.sonic.net>
In article <73Yva.566579$OV.538573@rwcrnsc54>,
"Chris" <chris_12003@yahoo.com> wrote:
> I have a classifieds ad program that someone else wrote and I'm modifying it
> so that it remembers your logon information from a cookie. They setup the
> program so that it calls modules in separate .pl files and I was wondering
> how I get the cookie part below to work. I call the CGI in the main.cgi
> then call the cookie in the module.
>
> When I try to run it, it displays the following and doesn't store a cookie
> on my computer
> Set-Cookie: preferences=text&black&background&silver; path=/; expires=Thu,
> 12-Jun-2003 01:17:46 GMT Date: Tue, 13 May 2003 01:17:46 GMT Content-Type:
> text/html; charset=ISO-8859-1
thsi just indicates the the http headers have already been completed by
the time you print your cookie header. you'll need to be sure that
doesn't happen by either moving your set-cookie code earlier or moving
the header code later.
hth-
--
Michael Budash
------------------------------
Date: Tue, 13 May 2003 03:49:56 GMT
From: ">>--Archer--->" <not@home.net>
Subject: Need help testing a gzip file for corruption
Message-Id: <a4q0cv4ftkebe848ntbd728lo885p1v2nr@4ax.com>
I'm using a script to download about 50 .gz archives and then expand
the contents. The problem is that 2-3 of the larger files are usually
corrupted after the download, which causes the script to fail.
How can I test the archives validity so that I can then retry the
download?
TIA
Niel Archer
------------------------------
Date: Tue, 13 May 2003 14:25:38 +0930
From: Henry <urael@zrgebcbyvf.arg.nh>
Subject: Re: Need help testing a gzip file for corruption
Message-Id: <urael-68C35A.14253813052003@nswpull.telstra.net>
In article <a4q0cv4ftkebe848ntbd728lo885p1v2nr@4ax.com>,
">>--Archer--->" <not@home.net> wrote:
> I'm using a script to download about 50 .gz archives and then expand
> the contents. The problem is that 2-3 of the larger files are usually
> corrupted after the download, which causes the script to fail.
>
> How can I test the archives validity so that I can then retry the
> download?
Compare file lengths. This will let you know if any truncation has
occured.
If you have access to the other box, you could generate CRC checksums on
the remote machine, then transfer them along with the files and generate
another batch of checksums on the local machine. If the two sets of
checksums don't match, something went wrong. The MD5 module, et al, can
be used to do this.
Henry.
------------------------------
Date: 12 May 2003 17:45:17 -0700
From: ido@hotmail.com (Ido Trivizki)
Subject: Re: pattern match A or B with Y or Z
Message-Id: <3ef348b.0305121645.46c39cb3@posting.google.com>
"Janek Schleicher" <bigj@kamelfreund.de> wrote in message news:<pan.2003.05.10.07.38.33.546179@kamelfreund.de>...
> my %substitute = (A => 'Y',
> B => 'Z');
> my $keys = join "|", keys %substitute;
> s/($keys)/$substitute{$1}/g;
>
> Disadvantages are that it becomes slow,
> when there a lot of different expressions,
> and it can lead to problems if there are some regexp characters inside.
Maybe we should:
my $keys = join "|",map quotemeta, keys %substitute;
------------------------------
Date: Mon, 12 May 2003 19:49:12 -0700
From: "Shane Mosely" <nothing@home.yet>
Subject: Re: Question about Net::SMTP
Message-Id: <vc0n8nmi721521@corp.supernews.com>
"Anthony Saffer" <anthony@nospam.safferconsulting.com> wrote in message
news:3ebfa56d_2@nntp2.nac.net...
> Hello Everyone,
>
> I'm having trouble with Net::SMTP and am, once again, turning to you guys
> for help. I have the following code:
>
> #!/usr/local/bin/perl -w
> use Net::SMTP;
> $smtp = Net::SMTP->new('smtp.junct.com',
> Hello=>'junct.com');
>
>
> $smtp->data();
> $smtp->datasend("From: Tester <just\@tester.com>\n");
> $smtp->datasend("To: anthony\@safferconsulting.com\n");
> $smtp->datasend("Subject: A test of SMTP\n");
> $smtp->datasend("This is a test");
> $smtp->dataend();
> $smtp->quit();
> print "Mail Sent\n";
>
> The program actually makes a connection to my SMTP server (smtp.junct.com)
> and sends SOMETHING. But I never get the mail. Can anyone tell me what's
> wrong with this code or is there a problem with the SMTP server?
>
> Thanks!
> Anthony
>
>
>
here is the script i use for net::smtp so you can see some of the
differences and for from there:
$smtp = Net::SMTP->new('216.86.198.174');
$smtp->mail($radd);
$smtp->to($item);
$smtp->data();
$smtp->datasend("From: " . $radd . "\n");
$smtp->datasend("To: " . $item . "\n");
$smtp->datasend("MIME-Version: 1.0\n");
$smtp->datasend("Content-Type: text/html\n");
$smtp->datasend("Subject: " . $subject . "\n");
$smtp->datasend("\n");
$smtp->datasend("<html><body>" . $body . "</body></html>\n");
$smtp->dataend();
$smtp->quit;
Something you may have overlooked is the blank line after your message ie
(\n). Hope this helps If you dont want html formated email just take out the
mime and content type info.
------------------------------
Date: Mon, 12 May 2003 23:22:20 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: Replying to Posts ( was: Re: check IP address )
Message-Id: <slrnbc0b5c.auv.mgjv@verbruggen.comdyn.com.au>
[TOFU fixed. Please, again, do not top-post]
On Mon, 12 May 2003 20:49:10 +0200,
Nico Coetzee <abuse@mweb.co.za> wrote:
> On Mon, 12 May 2003 02:19:26 +0000, Martien Verbruggen wrote:
>
>> [Please, do not top-post]
>>
>> Martien
> I was told in a previous post that I should top-post.
I am fairly certain that it was not on this newsgroup, or any other
technical newsgroup. Some groups have pandered to the bad design of
certain excuses of news readers and the laziness of their users and
are using top-posting as the norm, but they are the exception. When on
those groups, top-post. Anywhere else, do the Right Thing (TM).
> Which is it now? Does this ng have a FAQ?
For this newsgroup, start at:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
For usenet in general, start at news.announce.newusers, and maybe
http://www.faqs.org/usenet/
Martien
--
|
Martien Verbruggen | Think of the average person. Half of the
Trading Post Australia | people out there are dumber.
|
------------------------------
Date: Tue, 13 May 2003 03:13:05 GMT
From: "Brad Walton" <sammie@greatergreen.com>
Subject: Re: Splitting, Sorting, then Rebuilding an Array
Message-Id: <5pZva.582482$Zo.126688@sccrnsc03>
> Best Wishes,
> Janek
Thanks Janek! These suggestions look real nice. I will start condensing more
:-)
Brad
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.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 V10 Issue 4976
***************************************