[17445] in Perl-Users-Digest
Perl-Users Digest, Issue: 4865 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 10 14:10:38 2000
Date: Fri, 10 Nov 2000 11:10:13 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <973883413-v9-i4865@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 10 Nov 2000 Volume: 9 Number: 4865
Today's topics:
Newbe here having problems <imfro@hotmail.com>
Re: Newbe here having problems (Mark-Jason Dominus)
Problems using Perl Win32::OLE to control Acrobat Excha (Fergus McMenemie)
Returning an array from C to Perl <vidulats@yahoo.co.uk>
Re: Returning an array from C to Perl (Anno Siegel)
Re: Script to offer free email? <Litlmesh@aol.com>
Re: Self-modifying code in Perl (Anno Siegel)
Re: Self-modifying code in Perl <jeffp@crusoe.net>
Re: Self-modifying code in Perl nobull@mail.com
Re: Self-modifying code in Perl <jeff@vpservices.com>
Simple regex problem (G.A.D.Miles)
Re: Simple regex problem nobull@mail.com
Re: STDIN in child process <bkennedy99@home.com>
Re: Taint mode and file globbing nobull@mail.com
VBScript to perl converter? dcrollins@my-deja.com
which zip to use <sbinla@my-deja.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 10 Nov 2000 12:38:12 -0600
From: Dan <imfro@hotmail.com>
Subject: Newbe here having problems
Message-Id: <3A0C4094.45F2517@hotmail.com>
--------------B01321646F3A5ACA9C73F444
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi
I am just learning perl and have ran into a problem, So I came here to
the people that
Know. Can I use this syntax $FORM{'$variable'} the
$variable keeps changing each time it passes through the loop. Ok what
I have is a
form with Check boxes and on some check boxes there are also a textbox.
Below is
the html form I am using. I know there are easyer ways to get the
results I want but I would like to get this script working.
<html>
<head>
<title>Untitled Document</title></head>
<body bgcolor="#FFFFFF">
<center>form</center>
<center>
<table width="75%" border="1" height="83">
<tr>
<td width="28%" height="315"> </td>
<td width="72%" height="315">
<form method="post"
action="http://www.awebsite.com/cgi-bin/maker.cgi">
<p>
<input type="text" name="bingo" value="" cols="6" size="6">
bingo<br>
<input type="text" name="line1" value="" cols="20"
size="20">
name<br>
<input type="text" name="line2" value="" cols="20"
size="20">
address <br>
<input type="text" name="line3" value="" cols="20"
size="20">
Town<br>
<input type="text" name="line4" value="" cols="20"
size="20">
Phone <br>
<input type="checkbox" name="1" value="gears" >
gears
<input type="text" name="gears">
<br>
<input type="checkbox" name="2" value="gear" >
gear
<input type="text" name="gear">
<br>
<input type="checkbox" name="3" value="biggears" >
biggears<br>
<input type="checkbox" name="4" value="smallgears" >
smallgears<br>
<input type="submit" name="SUBMIT" value="Submit">
<input type="reset" name="RESET" value="Reset">
</form></td></tr>
</table></center></body></html>
I want to add the text into a field when there is text and the checkbox
is checked.
Here is the script that I am working on. I think my problem is in part
2:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
if($ENV{"REQUEST_METHOD"} eq 'GET')
{$cat = $ENV{"QUERY_STRING"};
$cat =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
}
else{
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/,$buffer);
foreach $pair(@pairs) {
($name, $value) = split(/=/,$pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;}
}
############ Part 1 works fine in writing to separate file #########
open (oldfile, '>>leeons.txt');
@lee = <oldfile>;
seek(oldfile, eof, 1);
print oldfile
"$FORM{'line1'}|$FORM{'line2'}|$FORM{'line3'}|$FORM{'line4'}\n";
close(oldfile);
############ Part 2 Write to temp file ###################
open (nothfile, 'leeons2.txt');
@lea = <nothfile>;
close(nothfile);
foreach $line(@lea) {
chomp($line);
($egory, $extra, @rest) = split(/\|/,$line);
#loop1
foreach $pair(@pairs) {
($name, $value) = split(/=/,$pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
if ("$value" eq "$egory") {
open (tempfile, '>>temp.txt');
@tea = <tempfile>;
seek(tempfile, eof, 1);
print tempfile "$egory|$extra";
foreach $1(@rest){ print tempfile "|$1$FORM{'$value'}";
}
print tempfile "|$FORM{'bingo'}\n";
close(tempfile);
}
}
}
close(tempfile);
######### Part 3 write to main file #############################
open (tempfile2, 'temp.txt');
@tea2 = <tempfile2>;
close(tempfile2);
open (othfile, 'leeons2.txt');
@lea = <othfile>;
close(othfile);
open (othfile4, '>leeons2.txt');
@lea4 = <othfile4>;
close(othfile4);
foreach $line(@lea) {
chomp($line);
($egory, $extra, @rest) = split(/\|/,$line);
$x=0;
foreach $lines(@tea2) {
chomp($lines);
($egory2, $extra2, @rest2) = split(/\|/,$lines);
if ("$egory2" eq "$egory") {
open (othfile2, '>>leeons2.txt');
@lea2 = <othfile2>;
seek(othfile2, eof, 1);
print othfile2 "$egory2|$extra2";
foreach $2(@rest2){ print othfile2 "|$2";
}
print othfile2 "\n";
$x=1;
close(othfile2);
}
}
if ($x==0) {
open (othfile2, '>>leeons2.txt');
@lea2 = <othfile2>;
seek(othfile2, eof, 1);
print othfile2 "$egory|$extra";
foreach $3(@rest){ print othfile2 "|$3";}
print othfile2 "\n";
close(othfile2);
}
}# end all loops
######## To delete file for next use ##########
open (tempfile3, '>temp.txt');
@tea3 = <tempfile3>;
close(tempfile3);
print "thanks for visiting";
exit;
####################### END ##############
Thanks in advance for any help
Dan
--------------B01321646F3A5ACA9C73F444
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<b>Hi</b><b></b>
<p><b>I am just learning perl and have ran into a problem, So I came here
to the people that</b>
<br><b>Know. Can I use this syntax $FORM{'$variable'} the</b>
<br><b>$variable keeps changing each time it passes through the loop.
Ok what I have is a</b>
<br><b>form with Check boxes and on some check boxes there are also
a textbox. Below is</b>
<br><b>the html form I am using. I know there are easyer ways to
get the results I want but I would like to get this script working.</b>
<p><html>
<br><head>
<br><title>Untitled Document</title></head>
<br><body bgcolor="#FFFFFF">
<br><center>form</center>
<br> <center>
<br> <table width="75%" border="1" height="83">
<br> <tr>
<br> <td width="28%" height="315">&nbsp;</td>
<br> <td width="72%" height="315">
<br> <form method="post" action="<A HREF="http://www.awebsite.com/cgi-bin/maker.cgi">http://www.awebsite.com/cgi-bin/maker.cgi</A>">
<br> <p>
<br>
<input type="text" name="bingo" value="" cols="6" size="6">
<br>
bingo<br>
<br>
<input type="text" name="line1" value="" cols="20" size="20">
<br>
name<br>
<br>
<input type="text" name="line2" value="" cols="20" size="20">
<br>
address <br>
<br>
<input type="text" name="line3" value="" cols="20" size="20">
<br>
Town<br>
<br>
<input type="text" name="line4" value="" cols="20" size="20">
<br>
Phone <br>
<br>
<input type="checkbox" name="1" value="gears" >
<br>
gears
<br>
<input type="text" name="gears">
<br>
<br>
<br>
<input type="checkbox" name="2" value="gear" >
<br>
gear
<br>
<input type="text" name="gear">
<br>
<br>
<br>
<input type="checkbox" name="3" value="biggears" >
<br>
biggears<br>
<br>
<input type="checkbox" name="4" value="smallgears" >
<br>
smallgears<br>
<br>
<input type="submit" name="SUBMIT" value="Submit">
<br>
<input type="reset" name="RESET" value="Reset">
<br> </form></td></tr>
<br> </table></center></body></html>
<br>
<br>
<p><b>I want to add the text into a field when there is text and the checkbox
is checked.</b><b></b>
<p><b>Here is the script that I am working on. I think my problem is in
part 2:</b>
<p>#!/usr/bin/perl
<p>print "Content-type: text/html\n\n";
<p>if($ENV{"REQUEST_METHOD"} eq 'GET')
<br> {$cat = $ENV{"QUERY_STRING"};
<br> $cat =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",
hex($1))/eg;
<br> }
<br>else{
<br>read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
<p>@pairs = split(/&/,$buffer);
<br>foreach $pair(@pairs) {
<br> ($name, $value) = split(/=/,$pair);
<br> $value =~ tr/+/ /;
<br> $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
<br> $FORM{$name} = $value;}
<br>}
<br>############ Part 1 works fine in writing to separate file #########
<br>open (oldfile, '>>leeons.txt');
<br>@lee = <oldfile>;
<br>seek(oldfile, eof, 1);
<br>print oldfile "$FORM{'line1'}|$FORM{'line2'}|$FORM{'line3'}|$FORM{'line4'}\n";
<br>close(oldfile);
<p>############ Part 2 Write to temp file ###################
<br>open (nothfile, 'leeons2.txt');
<br>@lea = <nothfile>;
<br>close(nothfile);
<p>foreach $line(@lea) {
<br> chomp($line);
<br>($egory, $extra, @rest) = split(/\|/,$line);
<br>
<p>#loop1
<br> foreach $pair(@pairs) {
<br> ($name, $value) = split(/=/,$pair);
<br> $value =~ tr/+/ /;
<br> $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
<br> $FORM{$name} = $value;
<p> if ("$value" eq "$egory") {
<br> open (tempfile, '>>temp.txt');
<br> @tea = <tempfile>;
<br> seek(tempfile, eof, 1);
<br> print tempfile "$egory|$extra";
<p> foreach $1(@rest){ print tempfile "|$1$FORM{'$value'}";
<br> }
<br> print tempfile "|$FORM{'bingo'}\n";
<br> close(tempfile);
<br> }
<br>}
<br>}
<p>close(tempfile);
<p>######### Part 3 write to main file #############################
<p>open (tempfile2, 'temp.txt');
<br>@tea2 = <tempfile2>;
<br>close(tempfile2);
<p>open (othfile, 'leeons2.txt');
<br>@lea = <othfile>;
<br>close(othfile);
<p>open (othfile4, '>leeons2.txt');
<br>@lea4 = <othfile4>;
<br>close(othfile4);
<p> foreach $line(@lea) {
<br> chomp($line);
<br> ($egory, $extra, @rest) = split(/\|/,$line);
<p> $x=0;
<p> foreach $lines(@tea2) {
<br> chomp($lines);
<br> ($egory2, $extra2, @rest2) = split(/\|/,$lines);
<br>
<p>
<br> if ("$egory2" eq "$egory") {
<br> open (othfile2, '>>leeons2.txt');
<br> @lea2 = <othfile2>;
<br> seek(othfile2, eof, 1);
<br> print othfile2 "$egory2|$extra2";
<p> foreach $2(@rest2){ print othfile2 "|$2";
<br> }
<br> print othfile2 "\n";
<br> $x=1;
<br> close(othfile2);
<br> }
<p>}
<br> if ($x==0) {
<br> open (othfile2, '>>leeons2.txt');
<br> @lea2 = <othfile2>;
<br> seek(othfile2, eof, 1);
<br> print othfile2 "$egory|$extra";
<br> foreach $3(@rest){ print othfile2 "|$3";}
<br> print othfile2 "\n";
<br> close(othfile2);
<br> }
<br>
<br>}# end all loops
<br>
<p>######## To delete file for next use ##########
<br>open (tempfile3, '>temp.txt');
<br>@tea3 = <tempfile3>;
<br>close(tempfile3);
<p>print "thanks for visiting";
<p>exit;
<p>####################### END ##############
<br>
<p><b>Thanks in advance for any help</b><b></b>
<p><b>Dan</b>
<br> </html>
--------------B01321646F3A5ACA9C73F444--
------------------------------
Date: Fri, 10 Nov 2000 18:49:42 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: Newbe here having problems
Message-Id: <3a0c4345.2602$277@news.op.net>
In article <3A0C4094.45F2517@hotmail.com>, Dan <imfro@hotmail.com> wrote:
>Can I use this syntax $FORM{'$variable'} the
>$variable keeps changing each time it passes through the loop.
You can use it, but it does not do what you want. You need to use
$FORM{$variable}
instead.
The 'single quotes' in '$variable' tall Perl to take $variable
literally, so that it does not refer to a variable any more. When you
say $FORM{'$variable'}, you are asking Perl to look in %FORM for a key
that is nine characters long and starts with a dollar sign and ends
with the letter 'e'.
--
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f|ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print
------------------------------
Date: Fri, 10 Nov 2000 14:49:05 +0000
From: fergus@twig.demon.co.uk (Fergus McMenemie)
Subject: Problems using Perl Win32::OLE to control Acrobat Exchange
Message-Id: <1ejvxf5.1x1cgzh1xjbb5sN%fergus@twig.demon.co.uk>
Hello,
I am having problems with a script I wrote. The script opens a PDF
document and after fiddling around saves it to a new name. The script
works sometimes!
Generally to make the script work again once its broke. I manually
invoke Acrobat Exchange, open the source document and save it back to
itself again. The perl script will then work for a bit! Same effect seen
on NT and Win98, although Win98 is considerably better. Acrobat version
is 4.0.5
print "Creating arcoexch object\n";
my $acrobat = Win32::OLE->new("AcroExch.App");
sleep(2);
$acrobat->show();
sleep(2);
print "Opening $docTemplate \n";
my $tmp = Win32::OLE->new("AcroExch.PDDoc");
unless ($tmp->Open($docTemplate)) {
warn("Couldnt open $docTemplate: ".Win32::OLE->LastError()."\n");
$acrobat->CloseAllDocs();
$acrobat->exit();
exit;
}
...sniped out
- fiddling with document
- saving back to *DIFFERENT* name
...snip end!
$tmp->Close();
The script always fails on the "$tmp->Open($docTemplate)"
Any ideas or suggestions!!!
Rgds Fergus.
------------------------------
Date: Fri, 10 Nov 2000 11:30:03 -0000
From: <vidulats@yahoo.co.uk>
Subject: Returning an array from C to Perl
Message-Id: <t0nn1rcb42jjd1@corp.supernews.com>
Hi Perl Experts,
I am writing my own C++ extension and I need to return an array from
C++ to Perl. Is this possible?
If Yes, then Will anyone please help me out.
If No, then What's the alternative to that.
Thanks in advance,
Vidula
--
Posted via CNET Help.com
http://www.help.com/
------------------------------
Date: 10 Nov 2000 14:10:27 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Returning an array from C to Perl
Message-Id: <8ugvkj$5dc$1@lublin.zrz.tu-berlin.de>
<vidulats@yahoo.co.uk> wrote in comp.lang.perl.misc:
>Hi Perl Experts,
>
> I am writing my own C++ extension and I need to return an array from
>C++ to Perl. Is this possible?
>
>If Yes, then Will anyone please help me out.
>If No, then What's the alternative to that.
You will want to study the following documents (not necessarily in
that sequence): perlxs, perlxstut, perlguts, perlapi.
In particular, perlguts describes the procedure to return multiple
values to perl. Perhaps a little surprisingly, this is found in the
chapter "Subroutines".
Anno
------------------------------
Date: Fri, 10 Nov 2000 18:30:08 -0000
From: Tomesha <Litlmesh@aol.com>
Subject: Re: Script to offer free email?
Message-Id: <t0oflgo83sgd61@corp.supernews.com>
>Tomesha wrote:
>
>Their is a web site that you can offer free email. The site is at
>http://www.zzn.com. You can offer free email and you can use your site
>name to offer it from.
>
> file and put their username in a couple of text files.
>
>
> On Thu, 20 Apr 2000 22:07:21 GMT, Skorpion Seven
> <Skorpion7@jaminnet.com> wrote:
>
> >I've already got an actual POP/SMTP email program for my website
> >(Endymion MailMan 3.0). My question is, is there a script that allows
> >me to offer free email accounts to my users, one that will
> >automatically create the POP account? So that I don't have to manually
> >create every account. If it matters, the email program that my server
> >uses is QMail, and it's running on an Apache OS. Thanks in advance.
>
--
Posted via CNET Help.com
http://www.help.com/
------------------------------
Date: 10 Nov 2000 12:23:07 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Self-modifying code in Perl
Message-Id: <8ugpbb$57f$1@lublin.zrz.tu-berlin.de>
Keywords: raft, seedling, shimmy, singsong
Mark-Jason Dominus <mjd@plover.com> wrote in comp.lang.perl.misc:
>In article <20001109211738.02983.00000009@ng-bj1.aol.com>,
> { local $/ = undef;
> $_ = <CODE>;
> }
An alternative I like to bring up at this point:
read CODE, $_, -s CODE;
Anno
------------------------------
Date: Fri, 10 Nov 2000 08:46:04 -0500
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: Self-modifying code in Perl
Message-Id: <Pine.GSO.4.21.0011100845010.25361-100000@crusoe.crusoe.net>
On Nov 10, Anno Siegel said:
>Mark-Jason Dominus <mjd@plover.com> wrote in comp.lang.perl.misc:
>>In article <20001109211738.02983.00000009@ng-bj1.aol.com>,
>
>> { local $/ = undef;
>> $_ = <CODE>;
>> }
>
>An alternative I like to bring up at this point:
>
> read CODE, $_, -s CODE;
I got "credited" with that idiom, in a "Perl for System Administration".
I find that exceptionally cool. When we were having the "how to read a
file" thread here, several months ago, I came up with that one. :)
--
Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/
CPAN - #1 Perl Resource (my id: PINYAN) http://search.cpan.org/
------------------------------
Date: 10 Nov 2000 17:45:45 +0000
From: nobull@mail.com
Subject: Re: Self-modifying code in Perl
Message-Id: <u9d7g3bu0m.fsf@wcl-l.bham.ac.uk>
Jeff Pinyan <jeffp@crusoe.net> writes:
> >An alternative I like to bring up at this point:
> >
> > read CODE, $_, -s CODE;
>
> I got "credited" with that idiom, in a "Perl for System Administration".
> I find that exceptionally cool. When we were having the "how to read a
> file" thread here, several months ago, I came up with that one. :)
Good though this idiom is under certain limited circumstances (as may
apply here) I think it should always be acompanied by a prominant
"health warning". You must be absolutely sure that the file handle
will only ever be a regular file.
It is all too easy to get into the habit of using something like this
all the time because you think it's cool and then hit problems when
someone does:
$ myscript.pl <(some_command)
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Fri, 10 Nov 2000 10:21:20 -0800
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Self-modifying code in Perl
Message-Id: <3A0C3CA0.38A5741F@vpservices.com>
Jeff Pinyan wrote:
>
> On Nov 10, Anno Siegel said:
>
> >Mark-Jason Dominus <mjd@plover.com> wrote in comp.lang.perl.misc:
> >>In article <20001109211738.02983.00000009@ng-bj1.aol.com>,
> >
> >> { local $/ = undef;
> >> $_ = <CODE>;
> >> }
> >
> >An alternative I like to bring up at this point:
> >
> > read CODE, $_, -s CODE;
>
> I got "credited" with that idiom, in a "Perl for System Administration".
> I find that exceptionally cool. When we were having the "how to read a
> file" thread here, several months ago, I came up with that one. :)
I think you should follow the lead of amazon.com and patent your
invention.
print ':-)' x 1000;
--
(Just Another) Jeff
------------------------------
Date: Fri, 10 Nov 2000 16:49:23 GMT
From: usad1@gadnet.com (G.A.D.Miles)
Subject: Simple regex problem
Message-Id: <3a0c266f.22654406@news.newsguy.com>
I want to check whether a variable contains more than 1,000
characters. I hoped this would work:
$text =~ /.{1000,}/
but it doesn't.
Oddly this DOES work as a test for greater than 100 characters:
$text =~ /.{100,}/
What should I be doing?
Thanks,
Drummond
------------------------------
Date: 10 Nov 2000 18:07:18 +0000
From: nobull@mail.com
Subject: Re: Simple regex problem
Message-Id: <u9aeb7bt0p.fsf@wcl-l.bham.ac.uk>
usad1@gadnet.com (G.A.D.Miles) writes:
> I want to check whether a variable contains more than 1,000
> characters.
With a regex!?!?
What's wrong with the obvious method of taking the length of the
variable and using a numerical comparison operator?
> I hoped this would work:
>
> $text =~ /.{1000,}/
>
> but it doesn't.
This checks if $text contains 1000 or more successive non-newline
characters. The comma, BTW, is redundant since anything that contains
a sequence of more than 1000 non-newline characters necessarily also
contains a sequence of _exactly_ 1000 non-newline characters.
You could use the /s qualifier to make . match anything including
newlines but in that case I return to my original question of why
don't you just test the length of the string?
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Fri, 10 Nov 2000 16:40:54 GMT
From: "Ben Kennedy" <bkennedy99@home.com>
Subject: Re: STDIN in child process
Message-Id: <qyVO5.104957$td5.15588939@news1.rdc2.pa.home.com>
"Zenja Ivkovic" <zenja@home.com> wrote in message
news:hYpO5.6345$IE2.217510@news1.sshe1.sk.home.com...
> As you can see first I fork() and let the original process do the server
> part and the child process the client part. The server part works fine,
but
> the client part doesn't seem to do anything other then just hang and
receive
> input. The first line in the client part (the else in the big if), the
> "print '1 ';" doesn't even get executed, it won't print the 1 or 2. When
I
> comment the $kline = <STDIN>; line it prints out the 1 and 2 and loops
> correctly.
After a proper fork, the contents of STDIN can be read by either process -
perhaps you are inadvertently slurping it or closing in the parent process?
Try commenting out code in the parent process until you find exactly what is
wrong.
Also, your debugging lines were not getting printed because they did not
contain newline characters - STDOUT is buffered by default, meaning a full
line has be printed before it is displayed - either add newlines or set $|
to some true value, which autoflushes the buffer on every write. Hope this
helps --
--Ben Kennedy
------------------------------
Date: 10 Nov 2000 17:45:23 +0000
From: nobull@mail.com
Subject: Re: Taint mode and file globbing
Message-Id: <u9em0jbu18.fsf@wcl-l.bham.ac.uk>
Jorge Godoy <godoy@conectiva.com> writes:
> my @deletion_list = (<*.htm>, <*.html>, <html/*.htm>,
> <html/*.html>, <HTML.index>);
> unlink @deletion_list;
> This fails the 'taint' check and I want to find a way to do the same
> operation and make it tainted.
By definintion any input from the outside world, such as the list of
files in a directory from glob() or readdir() is tained data.
Data from glob() is doubly tainted because filenames that contain
spaces will be read as multiple filenames.
If you really trust that nobody with malicious intent could have put
any files with names containing spaces in your directory then you can
simply clear the taint flag with:
$_ = /(.*)/ for @deletion_list;
Taint is just a safety catch, if you really want to pull the trigger
you have to release the safety catch - having first checked that the
muzzel is not aimed at your foot.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Fri, 10 Nov 2000 18:48:16 GMT
From: dcrollins@my-deja.com
Subject: VBScript to perl converter?
Message-Id: <8uhfte$dku$1@nnrp1.deja.com>
Is there a tool that will convert Visual Basic
(specifically VBScript) to perl? I'm not looking for something to
produce perfect code, and I know that since BASIC is very procedural it
will not be the most elegant perl script, but from what I know of
VBScript syntax it should be pretty easy to write one that covers 90%
of the operators and all of the assignments.
I'm working on a ClearCase project. Our implementation of
Rational's "ClearQuest" bug tracking system invokes custom VB scripts
to perform ClearCase actions (creating a view, building the config
spec, etc.), but for UNIX clients I need to rewrite the scripts in perl
(there are a lot of them).
Of course I've searched cpan, perlfaq, etc.; I'm about to write my own
converter if I can't find one that someone has written. This seems
like the perfect Comp. Sci. final exam project, so I'm sure there must
be one somewhere.
Thanks,
dcr
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 10 Nov 2000 17:42:48 GMT
From: SB <sbinla@my-deja.com>
Subject: which zip to use
Message-Id: <8uhc2m$a5v$1@nnrp1.deja.com>
Hello,
I grew so tired of dealing with the limitations of dos batch to
control my regular backups to my diskette drive (120 mb superdisk -
great device)
So I want to use Perl, but I've been using command line version of
pkzip to zip stuff up.
Does anyone know how to just simply zip some files up in a single
directory with perl? (using nt 4.0).
PerlZip by Amine something, is 50 bucks! Forget it - I'm sure it's
worth it, but this isn't work-related and the company ain't footin the
bill
Ned Konz wrote the ZIP:Archive, but I don't understand blocks and
members. I just want to zip some files up. Anyone know how to use that
in the most simplest way?
Thanks, Steve
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
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 4865
**************************************