[18647] in Perl-Users-Digest
Perl-Users Digest, Issue: 815 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 1 18:09:08 2001
Date: Tue, 1 May 2001 15:05:11 -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: <988754710-v10-i815@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 1 May 2001 Volume: 10 Number: 815
Today's topics:
Re: Another regexp question (Tad McClellan)
Re: Another regexp question (Rudolf Polzer)
Re: Another regexp question (Craig Berry)
Re: Corrupted scripts Winows to UNIX <bop@mypad.com>
Re: Corrupted scripts Winows to UNIX <Jonathan.L.Ericson@jpl.nasa.gov>
Does 'exec' never fail? <bernie@fantasyfarm.com>
Re: Does 'exec' never fail? (Anno Siegel)
Re: Does 'exec' never fail? (Rudolf Polzer)
Re: entries per page <Jonathan.L.Ericson@jpl.nasa.gov>
Re: Hacker Challenge. Can you break this script for me? <godzilla@stomp.stomp.tokyo>
Re: Hacker Challenge. Can you break this script for me? <godzilla@stomp.stomp.tokyo>
Re: Hacker challenge. Can you break this script for me? <djmarcus@ex-pressnet.com>
Re: Hacker challenge. Can you break this script for me? (Rudolf Polzer)
Re: Hacker Challenge. Can you break this script for me? <godzilla@stomp.stomp.tokyo>
Re: How to: Create Regex which extracts N number of wor (Craig Berry)
Listing files on client end? <sshannon@acc.com>
Re: Multiple errors running newspro.cgi <rb@rb.com>
Re: one-line stderr, stdout redirection (Anno Siegel)
Re: Passing open file handles (sockets included) to chi (Anno Siegel)
Re: perl program suggestions <Jonathan.L.Ericson@jpl.nasa.gov>
perl script for changing file names and extensions <web.foi@mbs.gov.on.ca>
Re: perl script for changing file names and extensions <juex@deja.com>
Re: perl script for changing file names and extensions <vmurphy@Cisco.Com>
Re: problem compiling perl on hpux 10.01 (Richard J. Rauenzahn)
Re: Question about float to hex (Greg Bacon)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 1 May 2001 14:54:55 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Another regexp question
Message-Id: <slrn9eu1jv.jeb.tadmc@tadmc26.august.net>
Ciaran McCreesh <keesh@users.pleaseremovethisbit.sourceforge.net> wrote:
>s/(regex)p/\1/gi;
You should enable warnings.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 2 May 2001 01:17:47 +0200
From: eins@durchnull.de (Rudolf Polzer)
Subject: Re: Another regexp question
Message-Id: <slrn9euh0r.27o.eins@www42.t-offline.de>
Tad McClellan <tadmc@augustmail.com> wrote:
> Ciaran McCreesh <keesh@users.pleaseremovethisbit.sourceforge.net> wrote:
>
> >s/(regex)p/\1/gi;
>
> You should enable warnings.
Of course. But this is not an error.
--
#!/usr/bin/perl -W -- WARNING: This will print 22,307 bytes! <strictsafe!>
use strict;for(my$y=-1;$y<1;$y+=.1){for(my$x=-1.9;$x<.4;$x+=.03){print'+';
my$X=my$Y=0;for(0..99){($X,$Y)=($X*$X-$Y*$Y+$x,2*$X*$Y+$y);print"\b "if$X*
$X+$Y*$Y>9;}}print"\n"};print''.reverse"\nHPAJ \a!rezloP .R yb torblednaM"
------------------------------
Date: Tue, 01 May 2001 21:38:42 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Another regexp question
Message-Id: <teub724pe84ha4@corp.supernews.com>
Ciaran McCreesh (keesh@users.pleaseremovethisbit.sourceforge.net) wrote:
: I'm seriously tempted to modify my newsreader to
: s/(regex)p/\1/gi; everything to make it easier to read...
Use $1 instead of \1, and you won't get warnings when you do it. :)
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "When the going gets weird, the weird turn pro."
| - Hunter S. Thompson
------------------------------
Date: Tue, 01 May 2001 19:53:47 GMT
From: "flash" <bop@mypad.com>
Subject: Re: Corrupted scripts Winows to UNIX
Message-Id: <fvEH6.678644$f36.19130756@news20.bellglobal.com>
^M
is your problem
you can change the path to perl like this
#!/usr/bin/perl --
and it should ignore them.
Or make sure to upload in ascii mode.
"Nigel Taylor" <niget(nospam)@sympatico.ca> wrote in message
news:YABH6.212$k95.33807@news20.bellglobal.com...
> Hi
> I am currently having problems with scripts that I upload to a Unix
server.
>
> For example after editing formmail (Matts Archive) to my parameters, and
> uploading via WS_FTP, the script will not run.
>
> 'Internal Server Error'
>
> My hosting tech had to re-install the script from his end, he said the
size
> of the file should be 14k, but after upload it
> is 23k.
>
> I know it is not a path problem etc.
>
> I use Programmers file editor or Notepad to edit, I edit in windows 98,
and
> upload with a DSL connection.
>
> This is obviously a real problem if all my scripts are corrupted somehow.
>
> Anyone have any ideas on what may be causing my problems.
>
> Nigel
>
>
------------------------------
Date: 01 May 2001 19:34:27 +0000
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: Corrupted scripts Winows to UNIX
Message-Id: <86oftcn9rw.fsf@jon_ericson.jpl.nasa.gov>
"Nigel Taylor" <niget(nospam)@sympatico.ca> writes:
> I am currently having problems with scripts that I upload to a Unix server.
>
> For example after editing formmail (Matts Archive) to my parameters, and
> uploading via WS_FTP, the script will not run.
>
> 'Internal Server Error'
>
> My hosting tech had to re-install the script from his end, he said the size
> of the file should be 14k, but after upload it
> is 23k.
This isn't a perl issue. We can't guess what could be wrong with your
system, WS_FTP and your hosting server. Talk to a sysadmin (sorry,
"hosting tech"). If you have a perl question, post code.
Jon
------------------------------
Date: Tue, 01 May 2001 16:47:33 -0400
From: Bernie Cosell <bernie@fantasyfarm.com>
Subject: Does 'exec' never fail?
Message-Id: <te7uetoejakg0rgbg2hr03bnpu0plaklpj@news.supernews.net>
I try to be a cautious coder, and so I assume that an exec might not work
and try to do something reasonable [log, print to stderr, whatever...
depends on what sort of app it is]. the code might look like:
exec <some program>
[cleanup if the program doesn't go]
die <WHAT HAPPENED>
That earns me a warning:
Statement unlikely to be reached at /home/bernie/bin/testexec.pl line 75.
(Maybe you meant system() when you said exec()?)
[this with 5.004.]
I realize that this is easy enough to deal with. I'll just add a
local $^W
before the exec, but as a matter of general practice I don't like turning
off warnings unless i have a good reason [*other* than to make perl shut
up! :o)] and I understand why I need to do it, and I don't exactly in this
case.
Now, it is possible that the way 'exec' is implemented in Perl it is
guaranteed NEVER to return [which is _not_ the case for the underling
exec(2) system call it is using!], in which case that's fine by me --- I'll
just remove the 'cleanup' stuff.. it is a bit unfortunate because if the
exec does fail I would often like to do something about it, but I guess I
can live with my program silently going-away.
OTOH, if exec *CAN* return in the face of an error, then the warning above
is not only not correct but *BAD* advice: indeed, any program that
*doesn't* handle the case that the exec failed is basically an accident
waiting to happen (lest the exec return and the program race along
executing code it never should have --- sort of the same class of problem
as forgetting to put an 'exit' in the child-code after a 'fork').
?????
/Bernie\
--
Bernie Cosell Fantasy Farm Fibers
bernie@fantasyfarm.com Pearisburg, VA
--> Too many people, too few sheep <--
------------------------------
Date: 1 May 2001 21:10:12 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Does 'exec' never fail?
Message-Id: <9cn8nk$r56$1@mamenchi.zrz.TU-Berlin.DE>
According to Bernie Cosell <bernie@fantasyfarm.com>:
> I try to be a cautious coder, and so I assume that an exec might not work
> and try to do something reasonable [log, print to stderr, whatever...
> depends on what sort of app it is]. the code might look like:
> exec <some program>
> [cleanup if the program doesn't go]
> die <WHAT HAPPENED>
>
> That earns me a warning:
>
> Statement unlikely to be reached at /home/bernie/bin/testexec.pl line 75.
> (Maybe you meant system() when you said exec()?)
[...]
This is discussed in Perl's exec documentation (near the end). The
discussion includes workarounds that don't involve switching off
warnings.
Anno
------------------------------
Date: Wed, 2 May 2001 01:31:32 +0200
From: eins@durchnull.de (Rudolf Polzer)
Subject: Re: Does 'exec' never fail?
Message-Id: <slrn9euhqj.af4.eins@www42.t-offline.de>
Bernie Cosell <bernie@fantasyfarm.com> wrote:
> I try to be a cautious coder, and so I assume that an exec might not work
> and try to do something reasonable [log, print to stderr, whatever...
> depends on what sort of app it is]. the code might look like:
> exec <some program>
> [cleanup if the program doesn't go]
> die <WHAT HAPPENED>
>
> OTOH, if exec *CAN* return in the face of an error, then the warning above
> is not only not correct but *BAD* advice: indeed, any program that
> *doesn't* handle the case that the exec failed is basically an accident
> waiting to happen (lest the exec return and the program race along
> executing code it never should have --- sort of the same class of problem
> as forgetting to put an 'exit' in the child-code after a 'fork').
See perldoc -f exec. You have to do a
{ exec <some program>; }
[ cleanup ]
die ...
or
exec <some program>
or
do
{
}
or something like that. This is a 'feature' that should warn you when you
use exec() instead of system().
--
#!/usr/bin/perl -W -- WARNING: This will print 22,307 bytes! <strictsafe!>
use strict;for(my$y=-1;$y<1;$y+=.1){for(my$x=-1.9;$x<.4;$x+=.03){print'+';
my$X=my$Y=0;for(0..99){($X,$Y)=($X*$X-$Y*$Y+$x,2*$X*$Y+$y);print"\b "if$X*
$X+$Y*$Y>9;}}print"\n"};print''.reverse"\nHPAJ \a!rezloP .R yb torblednaM"
------------------------------
Date: 01 May 2001 18:26:03 +0000
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: entries per page
Message-Id: <86y9shlydg.fsf@jon_ericson.jpl.nasa.gov>
"Troy Boy" <troyr@vicnet.net.au> writes:
> I was wondering if there was a perl cgi module that could seperate rows in a
> hash per page..
>
> For example..say i had 40 rows in my hash array..and i wanted it to show the
> first 10....then click on a hyperlink to retrieve the next 10 etc.
Have you tried search.cpan.org or google.com? If you end up writing
the module yourself, why not submit it to CPAN?
Jon
------------------------------
Date: Tue, 01 May 2001 11:08:05 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Hacker Challenge. Can you break this script for me?
Message-Id: <3AEEFB85.16B70FDA@stomp.stomp.tokyo>
Jfreeman wrote:
> "Godzilla!" wrote:
> > Jfreeman wrote:
> > > It has long been axiomatic that only (the Perl parser) can parse perl.
> > (snipped)
> > Randal sorely underestimates his abilities in his article
> > relative to this thread. My belief is Randal has forgotten
> > more about Perl than I have learned over a number of years.
> > After unzipping your file, setting up a test directory,
> > it took me less than three minutes to break your script.
> You have not broken the script at all. As stated in the pod only scripts which
> compile as a string under eval are processed. Clearly this script does not pass
> the eval., so never gets processed. If you can show me how to capture the output
> of perl -c this would not be an issue but that's another thread - see thread
> Capturing the output of perl -c myfile.pl
So programmers must adhere to your rules for writing scripts
in order to successfully use your program. This is illogical.
I tend to disagree and hold an opinion about your program
which is quite different than yours. Evidence suggests
otherwise, based on my exhaustive testing of your program.
Perhaps others will invest time and effort in testing your
program as I have, then add pertinent comments.
Your program does ok, so far. I tested fifteen scripts,
some mine own, others off-the-shelf generic scripts. I've
encountered only two failures by your script out of those
fifteen scripts tested. Comments are stripped as expected
and I have noted no serious problems other than these
two failures noted in my articles. This is not bad for
beta stage development.
Other problems I noted are insignificant and can be
readily remedied by a programmer.
You presented a challenge, I have met your challenge, twice.
C:\APACHE\USERS\TEST>perl stripcom.pl nph-prox.cgi
Compile check .\nph-prox.cgi
Compile ckeck failed!
Sorry perl script .\nph-prox.cgi does not compile, Aborting!
Can't localize lexical variable $path at (eval 1) line 1398.
I have been able to replicate this error in your program.
It appears your program cannot deal with common global
variables which are later localized. However, this is
for you to analyze; I have not examined your program.
I have extracted all lines affecting $path for your review.
Godzilla!
--
This is a historical accounting of $path by line number
to maintain easily viewed chronology:
373 ($scheme, $authority, $path)= ($URL=~ m#^([\w+.-]+)://([^/?]*)(.*)$#i);
375 $path= "/$path" if $path!~ m#^/# ;
379 $is_html= $path=~ /\.html?(\?|$)/i ;
404 &nontextdie if ($path=~ /\.($nontext)(;|\?|$)/i) ;
851 $request_uri= $path;
889 $cookie_to_server= &cookie_to_server($ENV{'HTTP_COOKIE'}, $path, $host);
1049 $is_dir= $path=~ m#/$# ;
1091 ($rcode, @r)= &ftp_command("LIST $path\015\012", '125|150');
1093 ($rcode, @r)= &ftp_command("RETR $path\015\012", '125|150|550');
1101 ($rcode)= &ftp_command("CWD $path\015\012", '');
1141 ($ext)= $path=~ /\.(\w+)$/;
1224 if ($path eq '/')
1247 <h2>Current directory is $path</h2>
1351 $headers=~ s/^Set-Cookie:\s*([^\015\012]*)/
1352 'Set-Cookie: ' . &cookie_to_client($1, $path, $host)
1353 /gie unless $done;
1395 sub cookie_to_client
1396 {
1397 local($cookie, $source_path, $source_server)= @_;
1398 local($name, $value, $expires_clause, $path, $domain, $secure_clause);
1399 local($new_name, $new_cookie);
------------------------------
Date: Tue, 01 May 2001 11:14:19 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Hacker Challenge. Can you break this script for me?
Message-Id: <3AEEFCFB.2C38EC2@stomp.stomp.tokyo>
Rudolf Polzer wrote:
> Godzilla! wrote:
> > Rudolf Polzer wrote:
> > > Godzilla! wrote:
> > > > Jfreeman wrote:
(significant snippage)
> > > I do not see anything in this that does not work.
> > This is correct. My script has been in use for a few
> > years, by thousands of visitors sustaining well over
> > three million hits to date. Obviously, it compiles.
> I wanted to know which code was generated by his script and which code was
> the original one, since the error message looks like a perl syntax error and
> not a die() from his script. I just wanted to see what the error is!
My suggestion is you run tests of your own. Doing this will
provide quicker, more authoritative answers.
Godzilla!
------------------------------
Date: Tue, 1 May 2001 15:32:13 -0400
From: "David J. Marcus" <djmarcus@ex-pressnet.com>
Subject: Re: Hacker challenge. Can you break this script for me?
Message-Id: <teu3p8dnasbheb@corp.supernews.com>
Out of curiosity, you say you have tested the stripper (does it tease?) on
nearly 120,000 lines of code.
This leads, naturally, to the following variants on the same question or
correctness:
1- How do you know that it does indeed strip correctly?
2- How do you determine if the generated (stripped down) code is not
broken?
Just having the resulting output still compile is not equivalent to 'not
breaking' the code.
Short of fully testing each and every module it is virtually impossible to
certify that nothing has been broken. Full testing is impossible, since that
requires you to certifiably test that every possible input and external
machine state combinations have been tested (again, an impossibility).
So, again, how do you know that it didn't break anything?
-Regards
David
"Jfreeman" <jfreeman@tassie.net.au> wrote in message
news:3AEEEB4D.8657D1E4@tassie.net.au...
>
>
> "Godzilla!" wrote:
>
> > Jfreeman wrote:
> >
> > (snipped)
> >
> > > The code, with online pod, is available here:
> >
> > > http://www.dynamicflight.com.au/Perl/stripcomments.pl
> >
> >
> > 404 File not Found
> >
> > The document that you requested
> > (http://www.dynamicflight.com.au/Perl/stripcomments.pl)
> > does not exist on this server. Please check the spelling
> > of the document, and make sure there are no spaces in the
> > address. If there is still a problem, please contact the
> > Webmaster.
> >
> > This type of inane mistake is indicative of very sloppy work
> > and is quite inexcusable. There is not a chance I personally
> > would trust your coding. My mistrust is further resolved by
> > your making duplicate postings of your article, failing to
> > subject line note your second article is an address correction.
> >
> > My presumption is you fell off the Turnip Truck, yesterday.
>
> Yes, and it hurt too. Clearly you ripped this down off the server between
my
> cancelling it and posting one with the correct address. Had .pl on the
brain
> not html. For the record if anyone else hits this post not the proper,
real,
> intended one the address is:
>
> http://www.dynamicflight.com.au/Perl/stripcomments_pl.htm
>
> I agree. Sloppy. To much coffee and not enough sleep.
>
> sleep 28800;
>
> James
>
> >
> >
> > Godzilla!
>
------------------------------
Date: Wed, 2 May 2001 01:16:31 +0200
From: eins@durchnull.de (Rudolf Polzer)
Subject: Re: Hacker challenge. Can you break this script for me?
Message-Id: <slrn9euguf.27o.eins@www42.t-offline.de>
David J. Marcus <djmarcus@ex-pressnet.com> wrote:
> Out of curiosity, you say you have tested the stripper (does it tease?) on
> nearly 120,000 lines of code.
>
> This leads, naturally, to the following variants on the same question or
> correctness:
> 1- How do you know that it does indeed strip correctly?
> 2- How do you determine if the generated (stripped down) code is not
> broken?
>
> Just having the resulting output still compile is not equivalent to 'not
> breaking' the code.
>
> Short of fully testing each and every module it is virtually impossible to
> certify that nothing has been broken. Full testing is impossible, since that
> requires you to certifiably test that every possible input and external
> machine state combinations have been tested (again, an impossibility).
>
> So, again, how do you know that it didn't break anything?
Perhaps the B::Bytecode approach is possible: create the assembler code file
and strip out the line numbers before diff-ing.
--
#!/usr/bin/perl -- Random sig generator. Editor command in slrn => ~/siggs
$F=shift;open H,"+<$F";$_=join"",<H>;$s=index$_,"\n\n-- \n";$s<0||truncate
H,$s;close H;system"$ENV{EDITOR} $F</dev/tty>/dev/tty";$s=$n=0;for#sichtig
(<~/siggs/*>){++$n;int rand$n or$s=$_};`(echo "\n\n-- ")|cat - $s>>$F`+nan
------------------------------
Date: Tue, 01 May 2001 14:46:04 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Hacker Challenge. Can you break this script for me?
Message-Id: <3AEF2E9C.7C11685F@stomp.stomp.tokyo>
Jfreeman wrote:
(significant snippage)
> "Godzilla!" wrote:
> > Jfreeman wrote:
> > Randal sorely underestimates his abilities in his article
> > relative to this thread. My belief is Randal has forgotten
> > more about Perl than I have learned over a number of years.
> > After unzipping your file, setting up a test directory,
> > it took me less than three minutes to break your script.
> You have not broken the script at all. As stated in the pod only scripts which
> compile as a string under eval are processed. Clearly this script does not pass
> the eval., so never gets processed. If you can show me how to capture the output
> of perl -c this would not be an issue but that's another thread - see thread
> Capturing the output of perl -c myfile.pl
A quick glance at my Micky Mouse wristwatch indicates
it is half a hair passed a freckle. Suppose I should
clue you in on a fatal flaw in your program which is so
obvious, it is slapping you upside your head, repeatedly.
My hunch is you are quite frustrated by now and are
wondering how I managed to hack your program. Certainly
did not screw your head on backwards with an eval trick
as you so confidently claim.
"Never Give A Sucker An Even Break"
- W.C. Fields
Two snippets for you and one printed results which
both snippets produce, follow my signature. Incidently,
those previous codes I posted are actual codes I use.
I selected those for equally obvious reasons.
If you cannot figure out how I hacked you, perhaps
you should return to Gorilla Basic. Think of me as
the egg which sticks to your teflon pan.
Incidently, you misspelled "check". Sloppy, very sloppy.
However, not as sloppy as forgetting a period after
your abbreviated doctorate title.
Godzilla!
Dr. Kiralynne Schilitubi
Professor Of English
--
TEST SCRIPT ONE:
________________
#!perl
$path = "gigo";
&Break_Code;
sub Break_Code
{
local($path) = "garbage in garbage out";
print $path;
}
TEST SCRIPT TWO:
________________
#!perl
$found = "gigo";
&Break_Code;
sub Break_Code
{
local($found) = "garbage in garbage out";
print $found;
}
PRINTED RESULTS BOTH TEST SCRIPTS:
________________
C:\APACHE\USERS\TEST>perl stripcom.pl test1.pl
Compile check .\test1.pl
Compile ckeck failed!
Sorry perl script .\test1.pl does not compile, Aborting!
Can't localize lexical variable $path at (eval 1) line 9.
------------------------------
Date: Tue, 01 May 2001 20:20:56 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: How to: Create Regex which extracts N number of words before target word
Message-Id: <teu6l8pps4fe95@corp.supernews.com>
BarryK (notmyrealemail@fake.com) wrote:
: Assume you have a target word, e.g. "cat", and you want to extract that word
: and a certain number of words before it. How is one to do this in a
: non-literal manner with a regular expression which will support any number
: of pre-words to be extracted?
:
: Following does not work. It should replace target and previous two words, to
: wit: word1 word2 Z
:
: $_ = "word1 word2 word3 word4 cat";
: s: \b.+\b{2}?cat :Z:xg;
: print $_;
$_ = 'word1 word2 word3 word4 cat';
s/(\w+\s+){2}cat/Z/g;
print;
Output is 'word1 word2 Z'.
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "When the going gets weird, the weird turn pro."
| - Hunter S. Thompson
------------------------------
Date: Tue, 01 May 2001 13:59:12 -0700
From: Scott Shannon <sshannon@acc.com>
Subject: Listing files on client end?
Message-Id: <3AEF23A0.626CA1DE@acc.com>
Hi. I'd like to know the simplest way, using a perl cgi script, to list
the files (placed, say, in a
special public accesible directory), on the *clients* end..i.e. the
server should do the
equivalent of an ls on the clients computer, then create a html page
with that listing,
which it then displays back to the client. Thanks for any info
S
------------------------------
Date: Tue, 01 May 2001 19:54:26 GMT
From: "RonB" <rb@rb.com>
Subject: Re: Multiple errors running newspro.cgi
Message-Id: <SvEH6.72116$eL4.19603812@Flipper>
thanx for the info, must be some other problem then, I've got perlfectsearch
up and running so I dont think it's apache, maybe some module isn't loaded,
I'll have to try something else then, sigh. I'm a total newbie at linux and
dont do any perl programming myself. Only experience is with scripts I use
for my own site on hypermart. They work fine so it must be something I'm
doing wrong with configuring apache or some perlthing. Could the fact that
apache is configured with mod_perl have anything to do with it?
Ron
"Tad McClellan" <tadmc@augustmail.com> schreef in bericht
news:slrn9ethbp.ius.tadmc@tadmc26.august.net...
> RonB <r.borkent@123chello.nl> wrote:
>
> >I get these errors
>
>
> None of those are errors. They are warnings.
>
>
> --
> Tad McClellan SGML consulting
> tadmc@augustmail.com Perl programming
> Fort Worth, Texas
------------------------------
Date: 1 May 2001 18:23:55 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: one-line stderr, stdout redirection
Message-Id: <9cmuvr$kh2$2@mamenchi.zrz.TU-Berlin.DE>
According to Rudolf Polzer <eins@durchnull.de>:
> Villy Kruse <vek@pharmnl.ohout.pharmapartners.nl> wrote:
> > On Tue, 1 May 2001 13:49:10 +0200, Rudolf Polzer <eins@durchnull.de> wrote:
> >
> > >
> > >Can you still use IO::Select when you have >30 open sockets? select() does
> > >not work because the bit vector can only hold fileno()s in 0..31.
> > >
> >
> >
> > That would depend on the unix version, many of those can go considerably
> > higher than 31 in the select bitmap.
>
> vector(), too?
vector()? If you mean vec(), that would depend on the restrictions
Perl imposes on the length of strings. Which are those?
Anno
------------------------------
Date: 1 May 2001 20:00:55 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Passing open file handles (sockets included) to child
Message-Id: <9cn4ln$ofi$1@mamenchi.zrz.TU-Berlin.DE>
According to Michael Vera <mxvera@qwest.com>:
> -=-=-=-=-=-
>
> Ok, so I find in the camel book, edition III, on page 423:
>
> "To avoid granting implicit access to all possible filehandles, Perl
> automatically closes any filehandles it has opened (including pipes and
> sockets) whenever you explicitly exec a new program or implicitly
> execute one through a call to a piped open, system, or qx// (backticks).
> "
>
> ### Open our socket...
> #
> $sock = new IO::Socket::INET (LocalHost => $host,
> LocalPort => $port,
> Proto => 'tcp',
> Listen => 5,
> Reuse => 1,
> );
> die "Could not connect: $!" unless $sock;
> while ($new_sock = $sock->accept()) {
>
> ...
>
> print $new_sock "Starting dm_oracle\n";
> open(SYS, "$bin_path/start_dm_oracle |" );
> SYS->autoflush(1);
> while(<SYS>) {
> chomp($_);
> print $new_sock "$_<br>\n";
> }
> sleep 5;
> print $new_sock " done.<br>\n";
> close(SYS);
>
> So at this point, isn't $new_sock simply a filehandle? And wouldn't it
> NOT be passed to the child as per page 423?
Quite so. Nor does the child need to know about the socket. It
prints to stdout (which is exempt from being closed on exec[1]).
The parent process picks this up from SYS and redirects it to the
socket.
Anno
[1] This is currently also discussed in the thread "one-line stderr,
stdout redirection".
------------------------------
Date: 01 May 2001 19:28:55 +0000
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: perl program suggestions
Message-Id: <86sniona14.fsf@jon_ericson.jpl.nasa.gov>
Gordon Vrdoljak <vrdoljak@uclink.berkeley.edu> writes:
> I'm trying to write a ledger program in Perl for people getting
> material and services from our lab. I have a nice form where they
> can input their name, material they use, and the amount. I'd like
> each item they input, to be displayed as a list at the bottom of the
> screen. When they finish adding items, they click on a checkout or
> submit button.
>
> I'm trying to think of how to code this in. Any suggestions?
> Should I have the items they add to their purchase list be stored as
> a temporary file and that file is read in with each addition to the
> list, and then a link to another CGI file is used for the final
> 'checkout'? I've written simple programs in Perl, but this is a bit
> more complex for me. Any comments greatly appreciated.
There are plenty of examples of this sort of script. Randal
L. Schwartz is a great person (I almost typed `perlson' :) to learn
from:
http://www.stonehenge.com/merlyn/WebTechniques/col40.html
Jon
------------------------------
Date: Tue, 01 May 2001 15:58:42 -0400
From: js <web.foi@mbs.gov.on.ca>
Subject: perl script for changing file names and extensions
Message-Id: <3AEF1572.21F96A1A@mbs.gov.on.ca>
Hi
I have searched the net for a perl script to change the name and
extension of a file with no luck.
can anyone give me some pointers !
Cheers
------------------------------
Date: Tue, 1 May 2001 13:09:10 -0700
From: "Jürgen Exner" <juex@deja.com>
Subject: Re: perl script for changing file names and extensions
Message-Id: <3aef17e6$1@news.microsoft.com>
"js" <web.foi@mbs.gov.on.ca> wrote in message
news:3AEF1572.21F96A1A@mbs.gov.on.ca...
> I have searched the net for a perl script to change the name and
> extension of a file with no luck.
Most operating systems provide this functionality as a native command ('mv'
in Unix, 'ren' in DOS/Windows, ...). No need to write a Perl script for
that.
If you insist on using Perl:
rename $ARGV[0], $ARGV[1];
[adding the bells and whistles like use strict, -w, and error checking is
left as an excercise]
Details see "perldoc -f rename".
jue
------------------------------
Date: 01 May 2001 16:43:14 -0400
From: Vinny Murphy <vmurphy@Cisco.Com>
Subject: Re: perl script for changing file names and extensions
Message-Id: <m38zkgiyvx.fsf@vpnrel.cisco.com>
"Jürgen Exner" <juex@deja.com> writes:
> "js" <web.foi@mbs.gov.on.ca> wrote in message
> news:3AEF1572.21F96A1A@mbs.gov.on.ca...
> > I have searched the net for a perl script to change the name and
> > extension of a file with no luck.
>
> Most operating systems provide this functionality as a native command ('mv'
> in Unix, 'ren' in DOS/Windows, ...). No need to write a Perl script for
> that.
>
> If you insist on using Perl:
>
> rename $ARGV[0], $ARGV[1];
>
> [adding the bells and whistles like use strict, -w, and error checking is
> left as an excercise]
> Details see "perldoc -f rename".
Larry Wall had written a rename.pl script which you could do regular
expressions to rename files. I don't have it handy, but I'm sure if you
search the web you could find it rather quickly.
--
Vinny
------------------------------
Date: 1 May 2001 17:21:32 GMT
From: nospam@hairball.cup.hp.com (Richard J. Rauenzahn)
Subject: Re: problem compiling perl on hpux 10.01
Message-Id: <988737691.860198@hpvablab.cup.hp.com>
"Robert Hartley" <roberthartley@mediaone.net> writes:
>I'm having problems compiling on hpux10.01 (pa-risc1.1). The build fails at
>pp_sys.c line 35. The line begins with a pre-processor (#export ...) I tried
>appling the latest patch for libc - no help. Has anyone run into problems
>with this platform?
You've given insufficient information. What version of perl? Which
compiler? Bundled, ANSI-C, or gcc?
...and you really need to upgrade your OS!
Rich
--
Rich Rauenzahn ----------+xrrauenza@cup.hp.comx+ Hewlett-Packard Company
Technical Consultant | I speak for me, | 19055 Pruneridge Ave.
Development Alliances Lab| *not* HP | MS 46TU2
ESPD / E-Serv. Partner Division +--------------+---- Cupertino, CA 95014
------------------------------
Date: Tue, 01 May 2001 18:05:11 -0000
From: gbacon@HiWAAY.net (Greg Bacon)
Subject: Re: Question about float to hex
Message-Id: <tetumnamlus2ae@corp.supernews.com>
In article <9cmoc6$1qlf$1@ccreader.nctu.edu.tw>,
toaster <toaster@nomail.org> wrote:
: I have a question about casting floating point value
: to hex value. In C we can declare a union like:
:
: union {
: float a;
: unsigned long b;
: } tmp;
:
: And print tmp.b by using:printf("%x",tmp.b); then
: we get the a hex value of this floating value in
: IEEE 754 format. [...]
#! /usr/local/bin/perl -w
my $pi = 3.14159;
printf "%x\n", unpack "L", pack "f", $pi;
Hope this helps,
Greg
--
You might say that Perl allows you to be paradigmatic without
being "paradogmatic".
-- Larry Wall
------------------------------
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 815
**************************************