[13303] in Perl-Users-Digest
Perl-Users Digest, Issue: 713 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 3 19:07:20 1999
Date: Fri, 3 Sep 1999 16:05:12 -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 Fri, 3 Sep 1999 Volume: 9 Number: 713
Today's topics:
Calling C from Perl <billp@clearcommerce.com>
Can't read WinNT Event Log--- <snoopy@scoobysnack.com>
Re: Case insensitive SQL query mrbog@my-deja.com
Re: Case insensitive SQL query mrbog@my-deja.com
Re: Case insensitive SQL query mrbog@my-deja.com
Re: Counting duplicate list elements in Perl (David H. Adler)
Re: Counting duplicate list elements in Perl <uri@sysarch.com>
Re: Help Please: reading email (Ronald E Jeffries)
How can I return a hash reference from a XSUB? <joern@netcologne.de>
Re: How do I open a HANDLE to two destination <aqumsieh@matrox.com>
how to delete a namespace? <dewittNOyqSPAM@jlab.org>
Re: LWP::Simple <joeyandsherry@mindspring.com>
Re: LWP::Simple <nguyend7@msu.edu>
OH GOD NO mrbog@my-deja.com
Re: Password Protection? <arunas@an!m.org>
Re: printing <aqumsieh@matrox.com>
Re: Problem in CGI.pm module <makkulka@cisco.com>
Pseudo-op qx// and binmode (R. S. K.)
Re: Pseudo-op qx// and binmode <tchrist@mox.perl.com>
Re: Pseudo-op qx// and binmode (Ilya Zakharevich)
Re: Script for downloading and saving web pages <makkulka@cisco.com>
Re: Script to create subshell that sends input/output t <aqumsieh@matrox.com>
Re: Simulating Carriage Returns (Ilya Zakharevich)
Re: using the exec command. (Charles DeRykus)
Re: using the exec command. (Tramm Hudson)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 3 Sep 1999 16:38:12 -0400
From: "Bill" <billp@clearcommerce.com>
Subject: Calling C from Perl
Message-Id: <936391629650@NewsSIEVE.cs.bonn.edu>
Can someone point me in the direction or provide me with a sample C wrapper
to do the following:
From perl: Build a header and detail list.
Ie.
Header
Name
Address
Phone
Detail
Item 1
Price
Qyt
Item 2
Price
Qty
.
.
.
Then make a call with these 2 lists to a C function to process the list.
------------------------------
Date: Fri, 3 Sep 1999 17:24:17 -0400
From: "Snoopydog" <snoopy@scoobysnack.com>
Subject: Can't read WinNT Event Log---
Message-Id: <bYWz3.4167$r6.165358@typhoon.nyroc.rr.com>
has anyone had any had any success/tribulations using Active State's
Win32::EventLog module. I've copied code directly from Dave Roth's
(excellent) book on Win32 Perl. All I get is "Unknown Error". I'm running
the scripts on my local WinNT 4.0 workstation (SP4) with Admin equiv. I can
see all of the events in Event Viewer ( I even close it while running the
script to make sure...). The script seems to be able to create the "new
Event" object, but can't read the log. Even the GetNumber method returns a
valid number. The "while 0 < 1" is intentional...
Thanks in advance for any help.
use Win32::EventLog;
use Win32::AdminMisc;
$secperweek = 7 * 24 * 60 * 60;
$now = time();
$weekago = $now - $secperweek;
$Event = new Win32::EventLog( "System", "" ) ||
die "couldn't open Event Log: $!\n"; ## never dies here...
if ( $Event->GetNumber( $num ) )
{
print "Reading Event Log record Number $num...\n"; ## this seems to work...
$flag = EVENTLOG_BACKWARDS_READ | EVENTLOG_SEEK_READ; ## just followin'
orders...
do
{
if ( $Event->Read( $flag, $num, \%Hash ) ) ## yyyyaaaaak
{
if ( $Hash{EventType} == EVENT_ERRORLOG_TYPE )
{
print "$Hash{Source} $Hash{Computer}\n";
print "I'm getting somewhere\n";
}
}
else
{
undef %Hash;
print "couldn't read Event Log: $!\n"; ## would you shut up already!!
}
## This will cause the next reading the registry to move to the next record.
$num = 0;
## } while ( $weekago < $Hash{TimeGenerated} ); ## this just gave a blank
line... lots of help
} while ( 0 < 1 ); ## a little better
Win32::EventLog::CloseEventLog( $Event->{handle} );
}
------------------------------
Date: Fri, 03 Sep 1999 20:44:20 GMT
From: mrbog@my-deja.com
Subject: Re: Case insensitive SQL query
Message-Id: <7qpbv1$l6$1@nnrp1.deja.com>
Wow, you're right Lauren, I made a wrong turn and ended up in the wrong
newsgroup. I though this was comp.lang.perl.misc, not
alt.rules.fascist.nazi.
I would think you'd save your feather ruffling for someone who posts
something REALLY bad, like spam or a question about where they can find
a good deal on a hard drive, not an innocent question like mine which
you wouldn't consider so unnacceptably off topic if it weren't for the
stick up your ass.
In article <7qmvv2$2no$1@brokaw.wa.com>,
"Lauren Smith" <laurensmith@sprynet.com> wrote:
>
> mrbog@my-deja.com wrote in message <7qmsva$7na$1@nnrp1.deja.com>...
> >
> >I still contest that SQL IS tangentially related to perl, given that
as
> >much as 30 to 40% of people who program perl for a living have to
write
> >code that consults a database. That's in the "duh" category.
>
> I'm pretty sure this is on topic for this group. Could someone help
me
> with typing? I figure that if you program, you have at least a little
> experience with keyboard layout and typing techniques.
>
> Likewise, I've been having problems lately turning on the lights in my
> house. I used to use candles, but now that I've moved into a new
house
> with electricity, I am having trouble with the light switches. Can
> someone send me more information?
>
> TIA
> Lauren
>
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 03 Sep 1999 20:46:41 GMT
From: mrbog@my-deja.com
Subject: Re: Case insensitive SQL query
Message-Id: <7qpc3d$ne$1@nnrp1.deja.com>
Yes, and my feeling is that it sould be about 10% because my god how
goddamn painful is it for you for someone to ask something outside of
your so tightly drawn lines.
In article <DAEz3.181$Of6.6005@nsw.nnrp.telstra.net>,
mgjv@comdyn.com.au (Martien Verbruggen) wrote:
> In article <7qmsva$7na$1@nnrp1.deja.com>,
> mrbog@my-deja.com writes:
>
> > I still contest that SQL IS tangentially related to perl, given
that as
>
> A tangential relationship does not mean that it should be discussed
> here. There are tangential relationships of perl with almost anything
> in the universe. Perl can be used to calculate red-shift factors for
> distant galaxies, but I haven't seen anyone discuss astronomy here.
> Perl can be used to communicate with NTP servers, but you don't see
> people discuss the NTP protocol here.
>
> > much as 30 to 40% of people who program perl for a living have to
write
> > code that consults a database. That's in the "duh" category.
>
> I doubt those figures very much, but lets say they're true (quote
> source, please). That would make the following statements true as
> well:
>
> - n% of Perl coding is related to HTML. HTML should be discussed
> here.
>
> - n% of Perl coding is related to graphics processing. We should
> discuss all graphics formats here.
>
> - n% of Perl coding is related to parsing programming languages foo,
> bar or baz. We should discuss those three languages, their syntax,
> support systems, extensions, and intricacies here.
>
> - n% of Perl is used in controlling the watering system of my cucumber
> greenhouse. We should discuss cucumber growing here.
>
> I'll leave it up to you to decide which number 'n' should for us be
> the reason to allow or disallow discussion of it here. My feeling is
> it should be about 99%. Anything not directly related to perl should
be
> discussed on a different group. Note that there is no mention of
> tangential relationship here, but a direct one.
>
> Martien
> --
> Martien Verbruggen |
> Interactive Media Division | Useful Statistic: 75% of the
people
> Commercial Dynamics Pty. Ltd. | make up 3/4 of the population.
> NSW, Australia |
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 03 Sep 1999 20:47:38 GMT
From: mrbog@my-deja.com
Subject: Re: Case insensitive SQL query
Message-Id: <7qpc56$nn$1@nnrp1.deja.com>
Hey, this worked, thanks a lot. :)
In article <37CC3970.7A101C9F@cisco.com>,
Makarand Kulkarni <makkulka@cisco.com> wrote:
> [ mrbog@my-deja.com wrote:
>
> > My site uses a mySQL database and I need to do a LIKE query that is
> > case insensitive. So, for example:
> > SELECT from dbname where name LIKE "%Joe%";
>
> Do match after you have converted both your args to lowercase or
uppercase.
>
> eg: SELECT from dbname where UPPER( name) LIKE "%JOE%";
>
> > I know this isn't exactly a perl question, sorry.
>
> Thanks. Next time you might find a database/SQL/mySQL related
newsgroup to
> be more helpful.
>
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 3 Sep 1999 21:47:54 GMT
From: dha@panix7.panix.com (David H. Adler)
Subject: Re: Counting duplicate list elements in Perl
Message-Id: <slrn7t0gga.ncn.dha@panix7.panix.com>
In article <x7pv02tdyt.fsf@home.sysarch.com>, Uri Guttman wrote:
>using the trick of }{ to close the -n loop block is not allowed anymore
>in the official rules of the professional perl golf association.
Ah, you're just annoyed that it turned up at the Perl Quiz Show. :-)
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
People don't buy our products because they want a 1/2 inch drill, they
buy our products because they want a 1/2 inch hole.
- reportedly, some exec at Black and Decker
------------------------------
Date: 03 Sep 1999 18:39:26 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Counting duplicate list elements in Perl
Message-Id: <x7yaensjq9.fsf@home.sysarch.com>
>>>>> "DHA" == David H Adler <dha@panix7.panix.com> writes:
DHA> In article <x7pv02tdyt.fsf@home.sysarch.com>, Uri Guttman wrote:
>> using the trick of }{ to close the -n loop block is not allowed anymore
>> in the official rules of the professional perl golf association.
DHA> Ah, you're just annoyed that it turned up at the Perl Quiz Show. :-)
i'm annoyed since it was a bonus question the other team had and they
blew it and i knew the answer. i learned about it from abigail's line
counter trick.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.
------------------------------
Date: Fri, 03 Sep 1999 22:57:25 GMT
From: ronERASEjeffries@ERASEacm.org (Ronald E Jeffries)
Subject: Re: Help Please: reading email
Message-Id: <37d050a6.30479457@news.det.ameritech.net>
Thanks, Martien ...
I'm still somewhat confused, however. I'm not running unix and
whatever make I have on my system (probably a java one) definitely
doesn't grok the makefile.
Is there some way to install the included PM without going through the
make?
So I'm now wondering what else I have to have on my system to install
CPAN modules, and how to do it.
As always, pointing me to the right docs will be sufficient, more
direct help will be welcome.
Thanks,
Ron
On Fri, 03 Sep 1999 01:24:49 GMT, mgjv@comdyn.com.au (Martien
Verbruggen) wrote:
>In article <37cf1fcc.86005997@news.det.ameritech.net>,
> ronERASEjeffries@ERASEacm.org (Ronald E Jeffries) writes:
>> I'm looking for a perl script that will read email from my mailhost,
>> given the host name, user name, password, etc. I haven't been able to
>> find anything that will work.
>
>If your mail can be retrieved with POP3, Net::POP3 might be something
>to have a look at. It's available from any CPAN archive:
>
>http://www.perl.com/CPAN
>
>> Pointers to the right place in the documentation will be appreciated
>
>http://www.perl.com/CPAN/modules
>
>> ... actual working code would be wonderful.
>
>Net::POP3 works fine.
>
>Martien
Ron Jeffries
http://www.XProgramming.com
Disclaimer: I could be wrong -- but I'm not.
(Eagles, "Victim of Love")
------------------------------
Date: Fri, 03 Sep 1999 22:46:45 +0200
From: Joern Reder <joern@netcologne.de>
Subject: How can I return a hash reference from a XSUB?
Message-Id: <37D033B4.2F631485@netcologne.de>
Hello,
I'm new in XS programming. I need to return a hash created in a XSUB to
Perl. I tried to make a reference from the hash and return it as an SV.
OK, the hashref is returned, but the program has a memory leak. :(
Apparently the hash itself is never freed.
Here's my XSUB I use to test the stuff (it simply creates a hash with
the key 'code' and the value '42', nothing special... ;)
SV*
test_hash_return(void)
CODE:
HV* msg_hash;
msg_hash = newHV();
hv_store (msg_hash,
"code", 4,
newSViv (42),
0
);
ST(0) = sv_newmortal();
sv_setsv (ST(0),newRV_noinc((SV*) msg_hash));
Please also answer via email if it's no effort for you, because I like
to fix this as soon as possible, and email *is* faster than usenet.
Thanks,
Joern
--
Joern Reder -- joern@netcologne.de
supporting: http://www.zyn.de/
unbelievable: http://www.netcologne.de/~nc-joernre/
------------------------------
Date: Fri, 3 Sep 1999 16:01:54 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: How do I open a HANDLE to two destination
Message-Id: <x3y906nwyq5.fsf@tigre.matrox.com>
akluyskens@my-deja.com writes:
> Does someone know how to open a filehandle to two different destination
> (<STDOUT> and a file). I need the same behavior as the "tee" command.
Please don't post the same question more than once. Especially with
different subjects. This is considered bad netiquette, and might lead
some knowledgeable people to ignore any further posts from you.
Thanks,
--Ala
------------------------------
Date: Fri, 03 Sep 1999 15:17:35 -0700
From: shane dewitt <dewittNOyqSPAM@jlab.org>
Subject: how to delete a namespace?
Message-Id: <0a0133f8.313c0998@usw-ex0106-043.remarq.com>
how would i delete the namespace 'T'?
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: Fri, 3 Sep 1999 15:41:06 -0400
From: <joeyandsherry@mindspring.com>
Subject: Re: LWP::Simple
Message-Id: <7qp886$j2n$1@nntp6.atl.mindspring.net>
I've tried to use the use statement, received the error that it couldn't be
located....
Joey
------------------------------
Date: 3 Sep 1999 22:14:18 GMT
From: Dan Nguyen <nguyend7@msu.edu>
Subject: Re: LWP::Simple
Message-Id: <7qph7q$hs$1@msunews.cl.msu.edu>
joeyandsherry@mindspring.com wrote:
: I've tried to use the use statement, received the error that it couldn't be
: located....
Oh okay.... try libwww-perl it should be included in there.
--
Dan Nguyen | It is with true love as it is with ghosts;
nguyend7@msu.edu | everyone talks of it, but few have seen it.
dnn@debian.org | -Maxime De La Rochefoucauld
25 2F 99 19 6C C9 19 D6 1B 9F F1 E0 E9 10 4C 16
------------------------------
Date: Fri, 03 Sep 1999 20:39:40 GMT
From: mrbog@my-deja.com
Subject: OH GOD NO
Message-Id: <7qpbma$a1$1@nnrp1.deja.com>
I'm on your killfile?! OH NO.
In article <RFEz3.185$Of6.6005@nsw.nnrp.telstra.net>,
mgjv@comdyn.com.au (Martien Verbruggen) wrote:
> In article <7qmtav$81o$1@nnrp1.deja.com>,
> mrbog@my-deja.com writes:
>
> > Guess yet again, my friend. While it is certainly possible that
someone
> > can program perl their whole life and never touch a database, at
least
> > 30% of all profession programmers WILL deal with SQL at some point
if
> > not frequently. That's what I call a tangential relation.
>
> See my other post about comments to this little gem of reasoning.
>
> >> >And BTW mysql.com doesn't solve my problem.
> >>
> >> then you didn't look hard enough
> >
> > By your logic there's no point in having a newsgroup, because
everyone
> > should "just read the documentation" and if anyone has a question,
then
> > they "didn't look hard enough".
>
> No. newsgroups exist to discuss the topic that they were created for.
> Not anything 'tangentially related' to that. If you allow all
> tangential relations, nothing is off-topic.
>
> By being so arrogantly contrary on this subject, and refusing to
> accept the long established rules of this group, you have made
> yourself magically appear in the killfiles of many people. Refusing to
> accept what you now have been told a few times will only end you up in
> more. Meaning that if you ever really need help with Perl, you'll be
> very likely to not be heard by the people you most want help from.
>
> You do not make the rules for this group. They've been here for quite
> a while, and your blinkered reasoning will not change them.
>
> Welcome to my killfile.
>
> Martien
> --
> Martien Verbruggen |
> Interactive Media Division | In the fight between you and
the world,
> Commercial Dynamics Pty. Ltd. | back the world - Franz Kafka
> NSW, Australia |
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 3 Sep 1999 02:14:32 -0600
From: "Arunas Salkauskas" <arunas@an!m.org>
Subject: Re: Password Protection?
Message-Id: <37cf8374@news.cadvision.com>
There are other forms of password control, but the require configuration of
the server to support them.
You could check with your ISP to find out whether they support anything like
.htaccess files, and then start looking in a www server newsgroup.
Implementing a password in clientside Javascript is like hanging the key on
a nail next to a locked door. And with your method, you actually forgot to
lock the door, but you pointed that out.
--
- Arunas Salkauskas
High Point Designs
www.highpointdesigns.com
Yellow Beetle wrote in message <7qmrfg$h48$1@garnet.nbnet.nb.ca>...
>Thank You for your help, yes I double checked that
>link. I did not know that it lead to something that made
>you dowload a program. It should be fixed now. How
>well do you think this will work for the average computer
>user? I would like to make it so you that you can't go to
>index3.html without going to index.html. Unfortunitly I
>don't have a cgi-bin, is there any other way to do it, or
>can I link it to another cgi-bin that I could get for free?
>
>I don't know Perl at all, so I wouldn't know how to make
>a script to do this, do you know of anyone that would make
>one for me, or is this hard to do?
>
>Thank You For Your Help,
>
>Jimmy
>theromroom@hotmail.com
>
>- Original Message -----
>From: Stéphane Gauthier <ughridk@abchotmail.com>
>Newsgroups: comp.lang.perl.misc
>Sent: Thursday, September 02, 1999 6:04 PM
>Subject: Re: Password Protection?
>
>
> I went to your page.
>1- I don't think it's a good idea to force your users to download a
>software
>to see your website. I refused to download the software but I've found
>another way to pick your password. A password in JavaScript is to easy to
>pick. I've just change my set-up to not execute JavaScript and went to
>index2.html. When I check the source code, I've seen the password.
>
>2- So, you need another way. I don't know if you have access to a cgi-bin
>directory but if yes, you should make a sub-directory of cgi-bin. You save
>your index3.html there. At that time, nobody will be able to read that page
>directly. You make a Perlscript which check the password and read the file
>for them and print it to the standard output. Every time they will want to
>see your page, they will have to enter the password again.
>
>But, if somebody goes to your page regularly, I don't think he or she will
>click on the banner every time. They will just enter the password anyway!
>
>Stéphane Gauthier
>
>
>
>
>
>
------------------------------
Date: Fri, 3 Sep 1999 15:59:37 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: printing
Message-Id: <x3yaer3wyty.fsf@tigre.matrox.com>
dgold1@my-deja.com writes:
> Is there a way to include printer control characters in an HTML doc. I
This has nothing to do with Perl.
> need to force page breaks, adjust headers and footers while printing
> some pages. I am using a PERL cgi-script to generate the HTML. I have
> tried counting lines, characters, etc... but depending on what is being
> printing the counts are off.
The fact that you are using a Perl script to generate the HTML does
not make this a Perl related question. Please ask in a relevant
newsgroup that discusses HTML.
--Ala
------------------------------
Date: Fri, 03 Sep 1999 15:51:23 -0700
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: Problem in CGI.pm module
Message-Id: <37D050EB.B9928C2E@cisco.com>
[ Ruiming Chen wrote:
> My problem is if I checked an item in name1, but do NOT checked any item
> in name2. I got
> name1=b
> only. But I want the output also shows name2 even it has null value,
> like
> name1=b
> name2=
> How can I do that?
The CGI param name2 will not be sent during form submission at all.
@fields will not have an entry for name2 at all. The only way to
do this is to specify the default name of a button in name2 group which
should
appear checked when the form is displayed. CGI.pm's methods
radio_group() can do this for you.
--
------------------------------
Date: 03 Sep 1999 13:47:06 PDT
From: NOrJUNKsEMAILk@nojunkemail.net (R. S. K.)
Subject: Pseudo-op qx// and binmode
Message-Id: <7qpc4a$19u@chronicle.concentric.net>
Keywords: Backtick, qx//, binmode, "special variable"
On operating systems like Windows NT, there is no way that I know
of for a Perl programmer to cause the output of an executable-quoted
literal
$output = qx/command-with-binary-output-on-stdout/;
to be read in binary mode (without CRLF/LF translation).
One may, of course, code around this:
open B, "command-with-binary-output-on-stdout |";
binmode B;
$/ = undef;
$output = <B>;
but that's rather long for a PERL code-around.
I guess we're running out of "special variables"--but I'd like to
see one added that would allow a japh to make all qx// return their
output WITHOUT translation on such operating systems.
Any comments on this? It's a small matter, but one of the big appeals
of Perl is the extreme brevity with which one can specify very complex
tasks, and, developed in a UNIX world, naturally this is just the sort
of thing that might be overlooked. I think, as a matter of fact, that
the presence of a "\x1A" byte in a backquoted literal will actually be
interpreted as an EOF condition, sometimes, in addition to the corruption
that will occur when "\x0D\x0A" sequences get turned into "\x0A" bytes.
Thank you.
=====
To avoid unwanted junk e-mail, I am posting this with falsified Headers.
Bonafide correspondence may be addressed to:
r s k (at) concentric (dot) net
=====
------------------------------
Date: 3 Sep 1999 15:48:42 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Pseudo-op qx// and binmode
Message-Id: <37d0423a@cs.colorado.edu>
Keywords: Backtick, qx//, binmode, "special variable"
In comp.lang.perl.misc,
NOrJUNKsEMAILk@nojunkemail.net (R. S. K.) writes:
With a mail address like that, I'm certainly not going to
bend over backwards to reply to you.
:On operating systems like Windows NT, there is no way that I know
:of for a Perl programmer to cause the output of an executable-quoted
:literal
: $output = qx/command-with-binary-output-on-stdout/;
:to be read in binary mode (without CRLF/LF translation).
There are two solutions:
1) Install an operating system that isn't congenitally
brain-damaged. I'm sorry, but this text/binary
thing is completely idiotic.
2) Do what perlsec suggests.
--tom
--
"Everything should be made as simple as possible, but not simpler."
-- Albert Einstein.
------------------------------
Date: 3 Sep 1999 23:01:42 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Pseudo-op qx// and binmode
Message-Id: <7qpk0m$4au$1@charm.magnus.acs.ohio-state.edu>
Keywords: Backtick, qx//, binmode, "special variable"
[A complimentary Cc of this posting was sent to Tom Christiansen
<tchrist@mox.perl.com>],
who wrote in article <37d0423a@cs.colorado.edu>:
> :On operating systems like Windows NT, there is no way that I know
> :of for a Perl programmer to cause the output of an executable-quoted
> :literal
> : $output = qx/command-with-binary-output-on-stdout/;
> :to be read in binary mode (without CRLF/LF translation).
>
> There are two solutions:
>
> 1) Install an operating system that isn't congenitally
> brain-damaged. I'm sorry, but this text/binary
> thing is completely idiotic.
There is no operating system that isn't congenitally brain-damaged.
> 2) Do what perlsec suggests.
3) There is a quasi-decision on $^B on p5p, but nobody had tuits to
implement it. Anyone is welcome to implement it.
Ilya
------------------------------
Date: Fri, 03 Sep 1999 15:56:16 -0700
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: Script for downloading and saving web pages
Message-Id: <37D05210.E9EEA4B9@cisco.com>
[ Sethuraman Baranidharan wrote:
> I need a simple perl script that downloads web pages and saves it in
> files (including images). Earlier I obtained two scripts webURL and
> webget both of which were downloading only text.
These techniques are beautifully described in the book
"Web Client Programming with Perl -- Clinton Wong."
Here is the book excerpt and sample code ready for you to use!!
http://webreview.com/pub/97/12/12/bookshelf/index.html
--
------------------------------
Date: Fri, 3 Sep 1999 16:03:16 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Script to create subshell that sends input/output to a socket
Message-Id: <x3y7lm7wynv.fsf@tigre.matrox.com>
Dominic Da Silva <dsdasilva@earthlink.net> writes:
> I am trying to write a script to start of a shell (ie take commands and
> execute them),
> but also have any screen info sent to a socket.
> It would be basically like the typescript command, except that out put
> will be redirected
> to a socket rather than a file.
> Any help will be appreciated.
What exactly is the help you are seeking? I can cook really good eggs
if you want :)
--Ala
------------------------------
Date: 3 Sep 1999 22:55:31 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Simulating Carriage Returns
Message-Id: <7qpjl3$49q$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to Larry Rosler
<lr@hpl.hp.com>],
who wrote in article <MPG.123996bef7a1c480989f15@nntp.hpl.hp.com>:
> > > >OSes and have 32-bit time_t. It is unsigned, but 32-bit. Of course,
> > > >being based on gcc, EMX *could* make it long long.... Go figure...
> > >
> > > Not if they cared about C89 conformance.
> >
> > Well, if C89 mandates 32-bitness of time_t, thus y2038 bug (such
> > stupidity I would not expect even from a standard committee), IMO: the
> > hell with C89.
>
> I assume C89 means the ANSI/ISO C Standard.
>
> About time_t, the Standard says simply that it must be an arithmetic
> type 'capable of representing times'.
Thanks for confirming my opinion and refuting one of Alan Curry.
> Your statement that 'such stupidity I would not expect even from a
> standard committee' is grossly insulting, and totally inappropriate
> unless you have personal experience serving on such a committee, which
> didn't rise to your technical expectations. Which committee might that
> be, and how did you deal with the problem?
In Russian, there is a proverb that "Uninvited guest is worse than a
Tatar". There is a joke that goes approximately like that:
After an official protest from a delegation of Tatarian republic the
Supreme Soviet declares that the proverb should now read
"Uninvited guest is better than a Tatar".
> PS: In case my personal hurt isn't obvious, let me spell it out: I was
> the first Technical Editor and Chairman of the Language Subcommittee of
> the ANSI X3J11 (C Standards) Committee. Never in my professional career
> have I had the opportunity of working with a smarter, more level-headed,
> and more well-intentioned group of experts, who were trying to cope with
> pressures of existing implementations and competing economic
> motivations. No one who has not participated should dare to sling mud
> the way you have.
Is it the same people who gave us POSIX? ;-)
Anyway, no matter how smart are the members, the total intelligence of
a committee is typically lower than of the worst member. One cannot
go agains human nature. Witness the p5p disaster...
Ilya
------------------------------
Date: Fri, 3 Sep 1999 19:58:39 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: using the exec command.
Message-Id: <FHI25r.5tn@news.boeing.com>
In article <5wlz3.127$D16.7485@nsw.nnrp.telstra.net>,
Martien Verbruggen <mgjv@comdyn.com.au> wrote:
>In article <FHEoIp.GM9@news.boeing.com>,
> ced@bcstec.ca.boeing.com (Charles DeRykus) writes:
>
>$user = '; rm -rf /;';
>
>> exec 'echo "unsubscribe nacs-announce" | /usr/lib/sendmail -f \
>> $user\@nacs.net majrdomo\@nacs.net';
>> die "exec failed: $!";
>
Certainly a legitimate concern elsewhere but not here.
sendmail - not the shell - will be in control to confront
any wickedness:
sendmail -f ; rm -rf /;@nacs.net...
rm... User unknown
-rf... User unknown
HTH,
--
Charles DeRykus
------------------------------
Date: 3 Sep 1999 15:08:22 -0600
From: hudson@swcp.com (Tramm Hudson)
Subject: Re: using the exec command.
Message-Id: <7qpdc6$2pg@llama.swcp.com>
Keywords: troll troll troll
ced@bcstec.ca.boeing.com (Charles DeRykus) originally wrote:
> exec 'echo "unsubscribe nacs-announce" | /usr/lib/sendmail -f \
> $user\@nacs.net majrdomo\@nacs.net';
> die "exec failed: $!";
then Martien Verbruggen <mgjv@comdyn.com.au> suggested:
> $user = '; rm -rf /;';
finally Charles DeRykus <ced@bcstec.ca.boeing.com> answered:
> Certainly a legitimate concern elsewhere but not here.
You're correct that there is no concern here -- the exec will create
a process with the arguments:
echo "unsubscribe nacs-announce" | /usr/lib/sendmail -f \
$user@nacs.net majrdomo@nacs.net
Note the single quotes wrapping the entire line. Martien's evil
$user will never be expanded by Perl. But this will be handled
by the shell since it contains shell meta characters (| and $).
Most likely the command that will be run is:
echo "unsubscribe nacs-announce" | /usr/lib/sendmail -f \
@nacs.net majrdomo@nacs.net
unless there is a $user in the local environment.
> sendmail - not the shell - will be in control to confront
> any wickedness:
>
> sendmail -f ; rm -rf /;@nacs.net...
>
> rm... User unknown
> -rf... User unknown
Did you try this with the correct quotes on the line to exec?
I can assure you that the shell invoked to handle the command
string -will- interpret that statement in the worst possible
fashion. Again, read
perldoc -f exec
for details on shell expansion of command lines.
> HTH,
No, it didn't.
Tramm
--
o hudson@swcp.com tbhudso@cs.sandia.gov O___|
/|\ http://www.swcp.com/~hudson/ H 505.323.38.81 /\ \_
<< KC5RNF @ N5YYF.NM.AMPR.ORG W 505.284.24.32 \ \/\_\
0 U \_ |
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 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.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. Due to their sizes, neither the Meta-FAQ nor
the FAQ are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq" from
almanac@ruby.oce.orst.edu.
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 713
*************************************