[7642] in Perl-Users-Digest
Perl-Users Digest, Issue: 1268 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 4 02:07:50 1997
Date: Mon, 3 Nov 97 23:00:20 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 3 Nov 1997 Volume: 8 Number: 1268
Today's topics:
7-digit version numbers (was Re: Perl 5.004_04 is avail <Russell_Schulz@locutus.ofB.ORG>
Re: 7-digit version numbers (was Re: Perl 5.004_04 is a (brian d foy)
Re: [repost] File handle attached to a function? (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Best way to test for decimal values that may contain co (Sandy Herring)
Combining two files into a two-column file (Steffen Kluge)
Re: Creating a new file each day?? <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Re: Creating a new file each day?? (brian d foy)
Re: Grabbing Pixels <ryanr@poolpros.com>
Re: HELP: splitting a word in perl (Martien Verbruggen)
How do I......? (Eric Phillips)
Re: How do I......? (brian d foy)
Re: Inserting characters into a string. <alecto@=bogusstring=pe.net>
Re: Making script wait (Matthew Cravit)
Perl Assignment!! <andee@hcpd.com>
Re: Perl Assignment!! (brian d foy)
Re: Perl, Sendmail, CGI <markm@nortel.ca>
Re: Perl, Sendmail, CGI <justin@nectar.com.au>
Puzzle: palindromep <brenner@lbrenner.ne.mediaone.net>
Re: Real Newbie Question <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Re: running remote shelll under suid perl script ? <justin@nectar.com.au>
Re: running remote shelll under suid perl script ? (brian d foy)
Re: Seeking Year 2000 checker OR comment stripper for C (Tad McClellan)
slow server <tfaith@NOSPAMaye.net>
Re: sockets on win95 <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Re: sub-totaling lines in a file?? <alecto@.bogusstring.pe.net>
Type="file" and CGI <leurmy@akula.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 3 Nov 1997 23:54:11 +0000
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: 7-digit version numbers (was Re: Perl 5.004_04 is available (Maintenance Release 4 for Perl5.004))
Message-Id: <19971103.235411.1j3.rnr.w164w_-_@locutus.ofB.ORG>
timbo@ig.co.uk (Tim Bunce) writes:
> The development track is focused on major enhancements to Perl
> and will typically have a fairly long major release cycle. Work
> on 5.005 (which will include threading and improved compiler
> support) is underway now. Alpha releases for 5.005 have
> subversion numbers starting from 5.004_50.
would there be any difficulty in actually using the two `0's after
the 5? I mean, perl 4 only ever got up to 4.036 -- two digits (one
and a half digits, almost) were enough.
unfortunately, I think this whole scheme promotes the `don't trust
version x.0' silliness that well-tested, publicly-reviewed software
avoids much better than retail software.
or used to avoid.
--
Russell_Schulz@locutus.ofB.ORG Shad 86c
------------------------------
Date: Mon, 03 Nov 1997 23:43:20 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: 7-digit version numbers (was Re: Perl 5.004_04 is available (Maintenance Release 4 for Perl5.004))
Message-Id: <comdog-ya02408000R0311972343200001@news.panix.com>
In article <19971103.235411.1j3.rnr.w164w_-_@locutus.ofB.ORG>, Russell Schulz <Russell_Schulz@locutus.ofB.ORG> wrote:
>timbo@ig.co.uk (Tim Bunce) writes:
>
>> The development track is focused on major enhancements to Perl
>> and will typically have a fairly long major release cycle. Work
>> on 5.005 (which will include threading and improved compiler
>> support) is underway now. Alpha releases for 5.005 have
>> subversion numbers starting from 5.004_50.
>unfortunately, I think this whole scheme promotes the `don't trust
>version x.0' silliness that well-tested, publicly-reviewed software
>avoids much better than retail software.
well, some versions aren't meant to be trusted!
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 03 Nov 97 22:21:02 -0500
From: bsa@void.apk.net (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Subject: Re: [repost] File handle attached to a function?
Message-Id: <345e94e0$3$ofn$mr2ice@speaker>
In <63d214$13k$1@daily.bbnplanet.com>, on 10/31/97 at 04:46 PM,
jgloudon@bbn.remove.com (Jason Gloudon) said:
+-----
| : Given some of the newer file-handle functionality in Perl, is it
| : possible to somehow attach a file handle to a function, as follows? ...
| With object oriented code, you can "attach a file handle to" methods.
+--->8
With Perl 5.004, you can tie a filehandle.
--
brandon s. allbery [Team OS/2][Linux] bsa@void.apk.net
cleveland, ohio mr/2 ice's "rfc guru" :-) KF8NH
Memo to MLS: End The Burn Scam --- Doug Logan MUST GO! FORZA CREW!
------------------------------
Date: 4 Nov 1997 02:48:04 GMT
From: sandy@herring.org (Sandy Herring)
Subject: Best way to test for decimal values that may contain commas
Message-Id: <63m2d4$e1o$1@www.structured.net>
I've written a script that converts data to comma separated value
format. One requirement is that non-numerics (alpha or alphanumeric) are
quoted and numerics are not quoted. Unfortunately, the numerics I
encounter _may_ have commas. The FAQ shows how to determine whether a
scalar is a number, whole, integer, or float - but not if it has
imbedded commas. e.g.,
123,456
123,456.
-123,456
123,456.78
are numeric, whereas junk like 123.456,789 or 1234,567 would not be.
Here's the code snippet I've come up with that deals with this problem
(assume the value to be examined is in `$datavalue')...
$numeric = 1;
if ($datavalue =~ /,/) {
@burst = split(/,/, $datavalue);
$lastone = pop @burst;
$numeric=0
unless ($lastone =~ /^(\d{3}|\d{3}\.\d*)$/);
$firstone = shift @burst;
$numeric=0
unless ($firstone =~ /^-?(\d{1,3})$/);
for (@burst) {
$numeric = 0, last
unless /^\d{3}$/;
}
} else {
$numeric = 0
unless ($datavalue =~ /^-?(\d+\.?\d*|\.\d*)$/);
}
$datavalue = '"'.$datavalue.'"'
unless $numeric;
BTW, this script must work under Perl5 as well as *sigh* Perl4 (please,
no flames - that's not *my* choice). Anyone have a slicker way to
accomplish this task?
Sandy
--
Sandy Herring finger for Geek Code Peck of Pickled Pisces
sandy@herring.org bigfish@sns-access.com http://www.herring.org/
------------------------------
Date: 4 Nov 1997 12:25:28 +1100
From: kluge@fujitsu.com.au (Steffen Kluge)
Subject: Combining two files into a two-column file
Message-Id: <63lti8$3d$1@syd0128.fujitsu.com.au>
Cheers perl-divers!
I thought I gradually translate my trusty collection of awk and
sed scripts into perl and came across the following problem:
When combining two text files side-to-side in order to produce a
two-column file I'm usually using something along the lines of:
awk '{printf "%s", $0; getline < F2; printf " %s\n", $0}' F2=f2.txt f1.txt
Now, I tried a2p which actually produced working perl code from the
above! However, the script produced is more than 25 lines long...
I'm wondering whether I overlooked the obvious, and there is some
one-liner for doing this in perl, too.
Thanks in advance
Steffen.
BTW, if this is a FAQ that I missed doing a (perl-)search of the FAQs,
please respond to my e-mail address.
--
Steffen Kluge <kluge@fujitsu.com.au>
Fujitsu Australia Ltd
Keywords: photography, Mozart, UNIX, Islay Malt
--
------------------------------
Date: Mon, 3 Nov 1997 20:14:00 -0800
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: Creating a new file each day??
Message-Id: <63m7e6$des@bgtnsc03.worldnet.att.net>
What can I say? I ran the program before I posted it and it worked on my Win
95/ActiveState environment. I got the information from Perl 5 for Dummies
(pages 135-140), which says that you should try this out on your own system
to see what the various formatting commands return, and that's good advice
in any case. Probably %02d will work in situations where %2.2d will return
something other than (for instance) 04.
I should say that in general, if you're faced with a choice among any of the
alternatives below, you should consider them in this order:
1) Whatever works with your particular implementation of Perl
2) Whatever advice Randal gives you
3) Whatever advice I give you, after you check it first
4) The direct opposite of #3 if #3 doesn't work :D
--- Creede Lambard
Minister of Irregular Expressions
Programming Republic of Perl
Mike Stok wrote in message <63le70$mvc@news-central.tiac.net>...
>In article <345e375e.256934392@news.supernews.com>,
>Ronald L. Parker <ron@farmworks.com> wrote:
>
>>Here's what the online help for my C compiler says about that...
>>
>>Type |
>>Char | Effect of [.prec] (.n) on Conversion
>>----------------------------------------------------------------------
>>diouxX | Specifies that at least n digits are printed. If input
>> | argument has less than n digits, output value is left-padded
>>
>> | with zeros. If input argument has more than n digits, the
>> | output value is not truncated.
>>
>>I don't know if Perl inherits this behavior, but at least one runtime
>>library supports it.
>
>It seems to,
>
>[mike@stok mike]$ perl -e 'printf "%4.4d\n", 3'
>0003
>[mike@stok mike]$ perl -v
>
>This is perl, version 5.004_04 built for i586-linux
>
>(and in the old 5.003 at work....)
>
>Mike
>
>--
>mike@stok.co.uk | The "`Stok' disclaimers"
apply.
>http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A
9C
>http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7
41
>stok@colltech.com | Collective Technologies
(work)
------------------------------
Date: Mon, 03 Nov 1997 23:55:52 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Creating a new file each day??
Message-Id: <comdog-ya02408000R0311972355520001@news.panix.com>
In article <63m7e6$des@bgtnsc03.worldnet.att.net>, "Creede Lambard" <fearless@io.com> wrote:
>I should say that in general, if you're faced with a choice among any of the
>alternatives below, you should consider them in this order:
>
>1) Whatever works with your particular implementation of Perl
>2) Whatever advice Randal gives you
>3) Whatever advice I give you, after you check it first
>4) The direct opposite of #3 if #3 doesn't work :D
somewhere between 1) and 2) should be
a) What Tad tells everyone (RTFM)
b) What Tom P. tells everyone (visit CPAN)
:)
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 03 Nov 1997 20:24:28 -0800
From: Ryan Rose <ryanr@poolpros.com>
Subject: Re: Grabbing Pixels
Message-Id: <345EA37B.D8CAD2E9@poolpros.com>
Tom Phoenix wrote:
> On Mon, 3 Nov 1997, Ryan Rose wrote:
>
> > I'm looking to open up a graphic file (either jpg, or gif), grab a few
> > pixels, and determine the average RGB value. Is there anyway to do
> > something like this?
>
> Yes. You may find some helpful modules on CPAN, or you may use Perl to
> work directly with binary files. Good luck!
>
> --
Are there any packages out theer that I can do this with... I'm sorry.. I'm
going to need a little more help to get me started on accomplishing this..
Ryan
------------------------------
Date: 4 Nov 1997 01:37:41 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: HELP: splitting a word in perl
Message-Id: <63lu95$mo4$1@comdyn.comdyn.com.au>
In article <andyrut-0111971132170001@lnk1-ppp-1.binary.net>,
andyrut@usa.net (Andy Rutledge) writes:
> Is there any way to split a string into an array with each element in the
> array being a different letter of the string?
my $str = "Some string";
my @ar = split(//, $str);
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au |
Commercial Dynamics Pty. Ltd. | What's another word for Thesaurus?
NSW, Australia |
------------------------------
Date: Mon, 03 Nov 1997 06:22:38 GMT
From: e.phillips@mindspring.com (Eric Phillips)
Subject: How do I......?
Message-Id: <345d6cba.17872087@news.mindspring.com>
Hello all, I have a question about Perl.
I want a script that can be called from an <IMG> tag and write to that
image tag.
For instance, the tag <IMG src="/cgi-bin/random_img.pl"> would go to a
random image.
How do I do this, without using SSI. This is all leading up to a
banner rotator that I am building myself, for my needs, but am not
really an expert at Perl. Please let me know!!
------------------------------
Date: Tue, 04 Nov 1997 00:00:17 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: How do I......?
Message-Id: <comdog-ya02408000R0411970000170001@news.panix.com>
In article <345d6cba.17872087@news.mindspring.com>, e.phillips@mindspring.com wrote:
>I want a script that can be called from an <IMG> tag and write to that
>image tag.
>
>For instance, the tag <IMG src="/cgi-bin/random_img.pl"> would go to a
>random image.
simply output the proper MIME type then the image data.
there are plenty of examples of this sort of thing in most hit
counter thingys.
good luck :)
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: 4 Nov 1997 03:32:31 GMT
From: alecto <alecto@=bogusstring=pe.net>
Subject: Re: Inserting characters into a string.
Message-Id: <63m50f$h5c$1@nntp.pe.net>
Andy Rutledge <andyrut@usa.net> wrote:
>Ok, how would I go about inserting a certain character after every fourth
>letter in a string?
>Like turning "firefighter" into "fireXfighXter" or something. Using perl
>code of course. Doing it manually isn't nearly as fun. :o)
here's one way:
#! /usr/bin/perl -w
die " Usage: $0 filename\n Error: $!" unless @ARGV;
while (<>) {
$_ =~ s/(....)/$1X/g;
print;
}
------------------------------
Date: 3 Nov 1997 19:39:42 -0800
From: mcravit@best.com (Matthew Cravit)
Subject: Re: Making script wait
Message-Id: <63m5du$n7q$1@shell3.ba.best.com>
In article <wqwwipcway.fsf@grok.imgen.bcm.tmc.edu>,
Andrew D. Arenson <arenson@grok.imgen.bcm.tmc.edu> wrote:
>
> I'd like to make my script wait for 5 minutes at a certain
>point. What's the best way to do this?
sleep(5*60);
Do "perldoc -f sleep" for more details.
/MC
--
Matthew Cravit, N9VWG | Experience is what allows you to
E-mail: mcravit@best.com (home) | recognize a mistake the second
mcravit@taos.com (work) | time you make it.
------------------------------
Date: Mon, 03 Nov 1997 22:28:15 -0800
From: Andrea Miller <andee@hcpd.com>
Subject: Perl Assignment!!
Message-Id: <345EC07F.708@hcpd.com>
Hello!!! I am working on a Perl Lab assignment that is due in my OS
Interface class here at DSU here in Madison,SD. However, I am having
some difficulties with the assignment. For the assignment we have to
write a perl language beautifying application that will take a text file
and do the following:
If the word Bruce appears anyplace and even in multiple places on
a line, your first name will be substituted.
If a line ends with a period then put the output after that line
leave two blank lines ("\n\n\n"")
On the next line after a line with a period, insert 5 blank lines
before you write out the line (like starting a new paragraph)
Change the words Perl (any case) to all Upper Case (PERL) anyplace they
occur in the text file.
I seem to be having problems if a line ends with a period and have to
insert 2 blank lines. I also have problems if the next line after a
line with a period, insert 5 blanks. How do you do those two parts?
Please respond back to this if you know anything about PERL!! Thanks!!!
Andrea
------------------------------
Date: Mon, 03 Nov 1997 23:51:16 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Perl Assignment!!
Message-Id: <comdog-ya02408000R0311972351160001@news.panix.com>
In article <345EC07F.708@hcpd.com>, andee@hcpd.com wrote:
>Hello!!! I am working on a Perl Lab assignment that is due in my OS
>Interface class here at DSU here in Madison,SD. However, I am having
>some difficulties with the assignment. For the assignment we have to
>write a perl language beautifying application that will take a text file
>and do the following:
perhaps you could be more specific about which parts are giving you
trouble. for instance, what have you already tried and how does it
not do what you expect?
normally i would just give some examples, but that might defeat the
purpose of this assignment :)
> If the word Bruce appears anyplace and even in multiple places on
>a line, your first name will be substituted.
sounds like you want the substitution operator, since you want to
substitute.
> If a line ends with a period then put the output after that line
>leave two blank lines ("\n\n\n"")
again you can use the substitution operator and find things at the
end of a string by using anchoring.
> On the next line after a line with a period, insert 5 blank lines
>before you write out the line (like starting a new paragraph)
does this make sense based on the previous substitution?
> Change the words Perl (any case) to all Upper Case (PERL) anyplace they
>occur in the text file.
what kind of school is this! i think you want to do that the other
way around!
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
DOS has poisoned society
------------------------------
Date: 03 Nov 1997 22:39:10 -0500
From: Mark Mielke <markm@nortel.ca>
Subject: Re: Perl, Sendmail, CGI
Message-Id: <lq1wwipqqe9.fsf@bmerhe83.nortel.ca>
dsiebert@gate.net (David Siebert) writes:
> Does anyone have some good sample code for using sendmail in a perl script?
>
Yeah... i use it really cheaply for my CGI to report changes in a database.
sub sendmail
{
my $content = shift;
$content =~ s/^\.$/../g;
open(sendmail_p, "| /usr/lib/sendmail -t") ||
return 0;
print sendmail_p $content;
print sendmail_p "\n" if substr($content, -1) ne "\n";
print sendmail_p ".\n";
close(sendmail_p);
$? == 0;
}
sendmail(qq`To: $request->{Email}
From: srpinst\@nortel.ca (SRP Installs)
Subject: XUE 5.5 request for $request->{SiteName}
Reply-To: srpinst\@nortel.ca
Your XUE 5.5 request for $request->{SiteName} has been cancelled.
Please contact SRP Installs if you require more information.
Regards,
SRP Installs
`);
Sorry it's so minimal... i just cut+pasted some code i threw together
a long time ago...
mark
-- _________________________
. . _ ._ . . .__ . . ._. .__ . . . .__ | Northern Telecom Ltd. |
|\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ | Box 3511, Station 'C' |
| | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, ON K1Y 4H7 |
markm@nortel.ca / al278@freenet.carleton.ca |_______________________|
------------------------------
Date: Tue, 04 Nov 1997 14:55:17 +1100
From: Justin Wills <justin@nectar.com.au>
Subject: Re: Perl, Sendmail, CGI
Message-Id: <345E9CA4.769E38E0@nectar.com.au>
--------------113902369E4DA387B4FA6E6F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
David Siebert wrote:
> Does anyone have some good sample code for using sendmail in a perl script?
go to CPAN, and get Net::SMTP;
--
Regards,
Justin Wills
justin@nectar.com.au
--------------113902369E4DA387B4FA6E6F
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
David Siebert wrote:
<BLOCKQUOTE TYPE=CITE>Does anyone have some good sample code for using
sendmail in a perl script?</BLOCKQUOTE>
<P>go to CPAN, and get Net::SMTP;
<BR>
<PRE>--
Regards,
Justin Wills
justin@nectar.com.au</PRE>
</HTML>
--------------113902369E4DA387B4FA6E6F--
------------------------------
Date: 04 Nov 1997 02:06:21 -0500
From: A Man of the 90's <brenner@lbrenner.ne.mediaone.net>
Subject: Puzzle: palindromep
Message-Id: <m2en4x16ky.fsf@lbrenner.ne.mediaone.net>
I was reading the unrolling a loop section of Mastering Regular
Expressions and started thinking about palindromes. The problem
is given the string:
a) dgfdabcdefedcbatrd
b) dgfdab cd ef edc batrd
Write a pattern that returns:
a) abcdefedcba
b) ab cd ef edc ba
Instead of just:
a) efe
b) ef e
The middle char is optional(?).
Anyway I thought this was an interesting and challenging pattern,
I'm curious what others come up with. I am working on it myself.
If you send results to brenner@lbrenner.ne.medioane.net with
Subject: PALINDROMEP, I will post the results on:
http://lbrenner.ne.mediaone.net/palindromep.html
with timings and author.
--
________________________________________________________________
__ _-==-=_,-.
Leonhard Brenner /--`' \_@~@.--<
Thinking People Inc. `--'\ \ <___>.
E-mail: brenner@lbrenner.ne.mediaone.net \ \\ " /
Phone: (508)-647-4074 >=\\_/`<
/= | \_/
_/=== \__/
________________________________________________________________
------------------------------
Date: Mon, 3 Nov 1997 21:39:01 -0800
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: Real Newbie Question
Message-Id: <63mcdd$rk4@mtinsc05.worldnet.att.net>
>Anders Thelemyr (anderst@XISPX.se) wrote:
> Hmm... I was unclear, sorry for that. What I meant was that there seem to
> be some kind of "plug-in" to Win95 that enables one to run perl programs
> and my question was how that wurks.
>
>
You don't need a separate "plug-in" to get Perl to work on Windows 95. You
install Perl, set the paths properly (system PATH variable for the
executable, @INC for the libraries) and you're ready to run (almost) any
Perl program out there. (There are some Unix functions that don't exist on
any Wintel platform, but for the most part you don't need 'em, and there are
some things the jury seems to still be out on, like sockets, but for the
most part, if it's Perl it'll run on Windows 95.)
If you're interested in Perl and CGi a good place to start is "Learning Perl
on Win32 Systems," which you'll see referred to in this group as The Gekko
Book after the animal on its cover. Chapter 18 covers Perl and CGI. However,
make sure you get a good grounding in the first 17 chapters first. :D
--- Creede Lambard
Minister of Irregular Expressions
Programming Republic of Perl
------------------------------
Date: Tue, 04 Nov 1997 14:54:14 +1100
From: Justin Wills <justin@nectar.com.au>
To: kimtan@lucent.com
Subject: Re: running remote shelll under suid perl script ?
Message-Id: <345E9C65.5A7B223B@nectar.com.au>
--------------38E730F9C448C70EE11194D0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
kimtan@lucent.com wrote:
try %ENV{'PATH'}
> I have the follwing script :
>
> ENV{'PATH'}='/usr/bin:/usr/local/bin';
>
> $result = `remsh remotehost -l remoteuser './getresult';
>
> it complain about unsafe ENV{PATH};
>
> here getresult is another regular perl script on the remote machine.
>
> I then tried this :
>
> $result='remsh remotehost -l remoteuser 'export
> PATH=/usr/bin;./getresult';
>
> this won't work, I then tried to put the ENV{PATH} setting in the remote
> perl script "getresult", this won't work also.
>
> The script runs fine under Solaris, but not under HP where it is using
> suidperl.
>
> Any suggestion ?
>
> -------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
--
Regards,
Justin Wills
justin@nectar.com.au
--------------38E730F9C448C70EE11194D0
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
kimtan@lucent.com wrote:
<P>try %ENV{'PATH'}
<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>I have the follwing script :
<P>ENV{'PATH'}='/usr/bin:/usr/local/bin';
<P>$result = `remsh remotehost -l remoteuser './getresult';
<P>it complain about unsafe ENV{PATH};
<P>here getresult is another regular perl script on the remote machine.
<P>I then tried this :
<P>$result='remsh remotehost -l remoteuser 'export
<BR>PATH=/usr/bin;./getresult';
<P>this won't work, I then tried to put the ENV{PATH} setting in the remote
<BR>perl script "getresult", this won't work also.
<P>The script runs fine under Solaris, but not under HP where it is using
<BR>suidperl.
<P>Any suggestion ?
<P>-------------------==== Posted via Deja News ====-----------------------
<BR> <A HREF="http://www.dejanews.com/">http://www.dejanews.com/</A>
Search, Read, Post to Usenet</BLOCKQUOTE>
<PRE>--
Regards,
Justin Wills
justin@nectar.com.au</PRE>
</HTML>
--------------38E730F9C448C70EE11194D0--
------------------------------
Date: Tue, 04 Nov 1997 00:04:43 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: running remote shelll under suid perl script ?
Message-Id: <comdog-ya02408000R0411970004430001@news.panix.com>
In article <345E9C65.5A7B223B@nectar.com.au>, Justin Wills <justin@nectar.com.au> wrote:
>try %ENV{'PATH'}
okay.
#!/usr/bin/perl -w
%ENV{'PATH'} = '/dev/null';
__END__
# Can't use subscript on hash deref, near "'PATH'}"
# (Did you mean $ or @ instead of %?)
# Execution of x aborted due to compilation errors.
darn. i thought i was going to do something cool! ;)
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 3 Nov 1997 22:08:42 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Seeking Year 2000 checker OR comment stripper for C/C++
Message-Id: <a47m36.cvn.ln@localhost>
Bob Weissman (weissman@netcom.com) wrote:
: ... I'd be happy with a script which simply
: removes all comments from C and C++ source, including multi-line
: comments. Then I could code the rest myself, but I'm not enough of a
: perl wiz to know how to strip multi-line comments.
You don't need to be a perl wiz, you just need to know how to read ;-)
Perl FAQ, part 6:
"How do I use a regular expression to strip C style comments
from a file?"
: (Yes, I know the C
: preprocessor will strip comments, but it also does other nasty things
: like expand #include directives, which I don't want to do.)
: I've looked on CPAN and searched the web, but haven't seen anything like
: this. Any help will be greatly appreciated.
You did not check the Perl FAQ before posting to the Perl newsgroup?
Baaaad 'net citizen...
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 03 Nov 1997 23:49:15 -0500
From: TFaith <tfaith@NOSPAMaye.net>
Subject: slow server
Message-Id: <345EA94B.F33E8631@NOSPAMaye.net>
I have a very slow server. I have a cgi that sends e-mail to everyone in
an array and it takes a few minutes. Is it possible to print out to the
user a "Thanks, everything worked fine" message while the program is
still busy e-mailing?
--
TFaith
tfaith@leo.aye.net
http://leo.aye.net/~tfaith
------------------------------
Date: Mon, 3 Nov 1997 21:30:32 -0800
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: sockets on win95
Message-Id: <63mbtf$qd1@mtinsc05.worldnet.att.net>
I think there's something about the way Windows 95 implements sockets that
Perl doesn't like (or vice versa, or something). I've tried to implement a
socket to my NNTP server so I could pull in news articles, but so far I
either get a "runtime exception" error or it just doesn't work (it dies if
you check). A friend of mine suggests that it might be because Windows 95 is
not a full 32-bit operating system and some of the socket implementation is
16 bit. I don't know for sure.
One thing I haven't tried yet is using a different socket DLL than the
WINSOCK.DLL (or WSOCK32.DLL, I forget) that comes with Win95. A 32-bit
Trumpet winsock might be better. If anyone has tried this, please let the
rest of us poor Win95 types know.
--- Creede Lambard
Minister of Irregular Expressions
Programming Republic of Perl
Dirk Palme wrote in message <345DA83F.3D4@softing.com>...
>i would connect two computers (one as client and the other as server )
>on win95 by sockets.
>
>but the instruction
> socket( SERVER, $AF_INET, $SOCK_STREAM, $proto) or
> die "Could not open socket : $!\n";
>never opens a socket.
>
>there is no problem on winnt.
>
>is there a way to open a socket on win95 ?
------------------------------
Date: 4 Nov 1997 03:19:29 GMT
From: alecto <alecto@.bogusstring.pe.net>
Subject: Re: sub-totaling lines in a file??
Message-Id: <63m481$g17$1@nntp.pe.net>
Burt Lewis <burt@ici.net> wrote:
>This is what my file looks like:
>cell1.gif - Sat Jul 19 14:42:28 EDT 1997 - 207.180.9.135
>amsoil.gif - Sat Jul 20 14:42:28 EDT 1997 - 207.180.9.135
>freitas.gif - Sat Jul 20 14:43:26 EDT 1997 - 207.180.9.135
>coopbank.gif - Sat Jul 20 14:43:27 EDT 1997 - 207.180.9.135
>morseins.gif - Sat Jul 21 14:50:56 EDT 1997 - 207.180.9.135
>morseins.gif - Sat Jul 21 14:50:57 EDT 1997 - 207.180.9.135
>coopbank.gif - Sat Jul 22 14:52:21 EDT 1997 - 207.180.9.135
>freitas.gif - Sat Jul 22 14:52:22 EDT 1997 - 207.180.9.135
>freitas.gif - Sat Aug 19 14:52:22 EDT 1997 - 207.180.9.135
>I need to find all the same groupings of the month and day and count how
>many in the groups.
>The results I'm looking for is something like:
>Jul 19 = 1 line
>Jul 20 = 3 lines
>Jul 21 = 2 lines
>Jul 22 = 2 lines
>Aug 19 = 1 lines
>The result needs to be sorted in this order.
=================================================================
I'd be tempted to -not- use perl for this since it's so easy to do
something like:
awk '{print $3" "$4" "$5}' file | uniq -c
=================================================================
------------------------------
Date: Tue, 04 Nov 1997 01:45:19 -0500
From: Francois <leurmy@akula.com>
Subject: Type="file" and CGI
Message-Id: <345EC47F.D583A028@akula.com>
I'm trying to process a file sent by a form using the <input
type="file"> tag.
If I use the enctype="multipart/form-data" attribute in my <form> tag, I
transfer nothing.
On the other hand, if I remove the enctype="multipart/form-data"
attribute, then I only transfer the path as a value.
Any idea??
Thanks,
Francois
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". 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". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 1268
**************************************