[11740] in Perl-Users-Digest
Perl-Users Digest, Issue: 5340 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 9 14:07:31 1999
Date: Fri, 9 Apr 99 11:00:29 -0700
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, 9 Apr 1999 Volume: 8 Number: 5340
Today's topics:
Re: ==> keys() with hash reference <== <jdf@pobox.com>
Re: =~tr / / /; problem <aqumsieh@matrox.com>
Re: =~tr / / /; problem (Larry Rosler)
Re: absolute path to the running script? <dhenders@cpsgroup.com>
Re: chmod - setting permissions with perl? homelessinseattle@my-dejanews.com
Concurrent IO (Norbert Hahn)
Re: Danger! Near-clueless newbie with a technical ques <cassell@mail.cor.epa.gov>
Re: devide a formular into two html-pages homelessinseattle@my-dejanews.com
Re: email an email notification. <cassell@mail.cor.epa.gov>
Re: Help requested with a Win386 port of a UNIX Perl sc <Allan@due.net>
Re: HELP! Code needed for line of best fit?!?!? <jdf@pobox.com>
Re: HELP! Code needed for line of best fit?!?!? <martin@guest-books.com>
Re: here docs vs qq quote operator. Just personal prefe (Lee)
Re: Hotmail's Homepages (Matthew Bafford)
Re: Hotmail's Homepages <tsuji@zd5.so-net.ne.jp>
How can perl scripts support drag-n-drop in Win32 envir <rmiller@uh.edu>
Re: How do I send an email attachment with sendmail pip <greg.wimpey@waii*removetomail*.com.invalid>
Re: How do i write a program that will spell a word eve <cassell@mail.cor.epa.gov>
Re: How to close all file descriptors ? <Wm.Blasius@ks.sel.alcatel.de>
Re: Is Perl the right tool for the job homelessinseattle@my-dejanews.com
iterate @$list_ref same as @list ? <SpamMeNOT.3pound@iname.com>
Re: minimal pattern matching <cassell@mail.cor.epa.gov>
Re: Move from IIS, ASP, COM, Java to Linux, Apache, mod <cassell@mail.cor.epa.gov>
Object help <jeffbREMOVETHIS@mcguckin.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 09 Apr 1999 11:52:50 -0400
From: Jonathan Feinberg <jdf@pobox.com>
To: Andreas Fischer <Andreas.Fischer@Sun.COM>
Subject: Re: ==> keys() with hash reference <==
Message-Id: <m31zht4wq5.fsf@joshua.panix.com>
Andreas Fischer <Andreas.Fischer@Sun.COM> writes:
> How can I use the reference of a hash for building a keys array?
As documented in perlref,
keys %$href
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Thu, 8 Apr 1999 13:49:13 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
To: lr@hpl.hp.com (Larry Rosler)
Subject: Re: =~tr / / /; problem
Message-Id: <x3yhfqrroiv.fsf@tigre.matrox.com>
[posted and CCed]
lr@hpl.hp.com (Larry Rosler) writes:
>
> [Posted and a courtesy copy sent.]
>
> In article <x73e2bu511.fsf@home.sysarch.com> on 08 Apr 1999 00:09:46 -
> 0400, Uri Guttman <uri@home.sysarch.com >says...
> > >>>>> "G" == George <fred222@mauimail.com> writes:
> >
> > G> I just thought I'd explain a little more. The tr/// operator is
> > G> the "transliterate" operator. It lets you, for instance, switch
> >
> > s/transliterate/translate/
>
> I hate to disagree with my respected co-author, but you've got this
> wrong. Either that, or so do I and so do the authors of the Perl docs.
> This is from perlop:
>
> tr{}{} Transliteration
>
> and similarly for the entries in perlfunc:
>
> tr///
> The transliteration operator. Same as y///. See perlop.
And I hate to disagree with you :-)
My version of the perlfunc doc says:
tr/// The translation operator. Same as y///. See the
perlop manpage.
Of course, Perl's tr/// operator was stolen from the unix function
with the same name. From the manpage of tr:
NAME
tr - translate characters
% perl -v
This is perl, version 5.004_04 built for sun4-solaris
What's happening there?
------------------------------
Date: Fri, 9 Apr 1999 10:54:13 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: =~tr / / /; problem
Message-Id: <MPG.1177dea4aa31c8b998987a@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <x3yhfqrroiv.fsf@tigre.matrox.com> on Thu, 8 Apr 1999
13:49:13 -0400 , Ala Qumsieh <aqumsieh@matrox.com> says...
> lr@hpl.hp.com (Larry Rosler) writes:
...
> > tr///
> > The transliteration operator. Same as y///. See perlop.
>
> And I hate to disagree with you :-)
> My version of the perlfunc doc says:
>
> tr/// The translation operator. Same as y///. See the
> perlop manpage.
>
> Of course, Perl's tr/// operator was stolen from the unix function
> with the same name. From the manpage of tr:
>
> NAME
> tr - translate characters
>
> % perl -v
> This is perl, version 5.004_04 built for sun4-solaris
>
> What's happening there?
What's happening is that the docs were changed for version 5.005_02.
After reviewing the other submissions to this thread and the dictionary
definitions of 'translate' and 'transliterate', I now think this change
was ill-advised, and that 'translate' comes closer to what is meant.
Consider some other capabilities of 'tr' than simply character-to-
character replacement (my ad hoc definitions):
/d : Translate any of a set of characters to no character.
/s : Translate a sequence of identical characters to one character.
The verb 'transliterate' simply wouldn't do here, I think.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 09 Apr 1999 10:42:29 -0500
From: Dale Henderson <dhenders@cpsgroup.com>
Subject: Re: absolute path to the running script?
Message-Id: <87hfqpvlzu.fsf@camel.cpsgroup.com>
>>>>> "J|rgen" == J|rgen Exner <juex@my-dejanews.com> writes:
J|rgen> As pointed out in the UNIX FAQ this is not possible.
J|rgen> Just imagine that the script could have been deleted
J|rgen> _after_ it's execution started.
J|rgen> jue -- J|rgen Exner
It still seems it would have the path information somewhere. It
seems a combination of the current working directory and $0 would
give the desired result. (ofc $0 could be -e which will never be
my case) My problems with that are I can't find the CWD and I have
to account for .. in $0. So what I'm asking for is an _easy_ way
to derive this information. (i.e. technique, module etc.).
--
Dale Henderson <mailto:dhenders@cpsgroup.com>
"Imaginary universes are so much more beautiful than this stupidly-
constructed 'real' one..." -- G. H. Hardy
------------------------------
Date: Fri, 09 Apr 1999 16:14:49 GMT
From: homelessinseattle@my-dejanews.com
Subject: Re: chmod - setting permissions with perl?
Message-Id: <7el91i$nt7$1@nnrp1.dejanews.com>
In article <370A2B11.C835ACFD@pixelfilm.de>,
tim@pixelfilm.de wrote:
> i'm trying to change the permissions from a file in my www-directory
> from 0600 to 0755.
> i tired the following script (plus thousand different scripts):
>
> chmod(0755, '../test.jpg');
> print "done";
>
> it doesn't work.
> does anybody knows why?
(If you're running Win NT, you may be not able to change those permissions.
Although you might not need to anyway.)
In any case, Your path may not be correct.
Try a little debug script to see if you're landing in the right directory.
like :
#-----------------------------------------
$myfile='../test.jpg';
if(-e $myfile){
print "yup, it's the right path";
chmod(0755,$myfile);
}
else{
print "sorry, I can't find the file";
#--------------------------------------
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 09 Apr 1999 15:44:55 GMT
From: hahn@hrz.tu-darmstadt.de (Norbert Hahn)
Subject: Concurrent IO
Message-Id: <370e1e35.27194547@news.tu-darmstadt.de>
Hi,
a have a tiny perl program that evaluates the parameter list, writes
that to STDERR, reads STDIN, does some calculations and
opens a file to append the results. The open statement looks like
open ( OFILE, ">>".$oname) || die "Cannot open ".$oname
I write to OFILE using printf and the exit.
>From time to time it occurs that nothing is writte to OFILE and the
"die" path is never taken!!
When I change the program to write to STDOUT and redirect that to the
file via the shell, everything is ok.
This program may be executed concurrently thus there is some chance
that OFILE is already open by another instantiation of the program.
Operating system is Linux 2.0.36 with pre-patch for 2.0.37 on a
double processor Pentium-II. The Perl interpreter is version 5.004.
Are there any problems known with concurrent writing from within perl?
Norbert
------------------------------
Date: Fri, 09 Apr 1999 09:34:33 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Danger! Near-clueless newbie with a technical question
Message-Id: <370E2C19.1226D17A@mail.cor.epa.gov>
Sandra Carson wrote:
>
> Greetings all. I am new to the Perl language but pretty competent in both C
> and C++
Well, that's a good start. If you also have some experience using some
of
the common unix tools like grep and sed and awk, you're on your way.
> and I am trying to do some bioinformatics-oriented type programming.
> I'm hoping that someone can point me in the right direction.
Well, since you have some programming background already, you might find
either 'Learning Perl' or 'Programming Perl' to have just the level of
info you want. Not only that, but Perl comes with a ton of docs. You
may
have the html version, which can be browsed with your favorite browser.
You *should* have the perldoc program, which will tell you all about
itself
when you type 'perldoc perldoc' in the command window. Be sure to note
the
-f and -q features. They're even handier than posting to this
newsgroup.
> I want to convert an input DNA sequence file into an output file in what's
> called "fasta" format. The input file may contain one or more lines of text
> and line numbers as well as spaces within the DNA sequence (strings of
> 'ACGT' in some order). "fasta" format contains a single line at the
> beginning of the file which begins with the symbol '>' and some descriptive
> text (which is not actually necessary). The sequence is then given as lines
> of characters, without spaces, and each line <80 characters long".
>
> So, I want to:
> a) read in a file ('filename.nuc')
perldoc -f open
perldoc -f close
and read about the <> operator [yes, that really is what the operator
looks like]
> b) strip any extraneous text from the beginning of the file
sounds like a regular expression task, so read about s/// using
perldoc perlop.. and the various regex features using
perldoc perlre
> c) add the '>' line
easy with '.' the concatenation operator, or just in a print() statement
> d) remove spaces and line numbers from the sequence
sounds like tr/// would be more efficient here than s///
tr is also in the perlop section
> e) output the results into a second file ('filename.seq')
open() and close() here, with
print FILEHANDLE list_of_output_stuff;
> Any suggestions/hints/pointers would be highly welcome.
>
> Thanks
> Sandra Carson
My guess is that 'Learning Perl' by Randal Schwartz will be the right
book to get you started. The blue llama book from O'Reilly.
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: Fri, 09 Apr 1999 16:56:37 GMT
From: homelessinseattle@my-dejanews.com
Subject: Re: devide a formular into two html-pages
Message-Id: <7elbg1$pvq$1@nnrp1.dejanews.com>
In article <7ed116$3tq$1@newshost.germany.net>,
101.48179@germanynet.de (Maik Wiege) wrote:
> I want to devide my long form into two small forms on two html-pages.
> On the second page the CGI-Perl-program needs to recognise, from whom the
>second data was sended and the program must concat the new data with the data
>sended on the first page.
This my assumption of your form proccess:
Form 1- collects some information from the user, and after that
form is submitted, the user is sent to the next form.
If the user is supplying unique field values, such as name or email address
on the first form, you can use those for an ID. If not, you can use
a random generator to suply a unique value for each form submittal session.
Your first form page:
<form action=.whatever>
<input type=text name=username>
<input type=text name=unique_ID value=value_of_uniqueID>
<etc.....>
the CGI script stores the temporary first info in, say a DBM file.
$form1results=join(/::/,@all_incoming_data);#<--after you parse the form.
dbmopen(%TEMP,"tempfile",0666);
$TEMP{value_of_unique_ID}="$form1results";
dbmclose(%TEMP);
then the CGI script issues the next half of the form, including the
Unique ID in a hidden field :
<input type=hidden name=unique_ID value=value_of_uniqueID>
the next CGI script will find the previous data,
and append it to the new stuff.
dbmopen(%TEMP,"tempfile",0666);
@olddata=split(/::/,$TEMP{value_of_unique_ID));
@alldata=(@olddata,@the_newest_data);
delete($TEMP{value_of_unique_ID));
Or Something.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 09 Apr 1999 09:48:40 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: email an email notification.
Message-Id: <370E2F68.9EAF84C7@mail.cor.epa.gov>
rajeshn@my-dejanews.com wrote:
>
> Hello,
>
> I have a unique question. How do I notify myself on email
> account rajesh@xyz.com if Im receiving an email at rajesh@abc.com .
> I guess there will be a process that needs to run on the
> mailserver on @xyz.com , but if I can do that then what do I do?
>
> I dont want to use the .forward thing.
>
> Thanks,
> Rajesh.
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
First: this is not an appropriate question for this newsgroup. You
should be asking it in the appropriate comp.mail.* newsgroup, where
lots of people would know the right answer already. Because it is
*not* an uncommon question - at least as you have posed it.
Now then. The '.forward thing' is a useful tool. But if you insist
on not using it, due to something you have failed to tell us about,
you should look at procmail. It has filter rules that let you do
things with different bits of mail. And you can send some to a Perl
filter if you so choose. If at some future date you do, and the Perl
filter [not procmail or your OS] causes you some programming problems,
then come back and show us your code, and perhaps we could help then.
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: Fri, 9 Apr 1999 13:04:40 -0400
From: "Allan M. Due" <Allan@due.net>
Subject: Re: Help requested with a Win386 port of a UNIX Perl script
Message-Id: <7elbao$2mp$1@camel25.mindspring.com>
Christopher Spry wrote in message <7ekv6r$a1t$1@niobium.hgmp.mrc.ac.uk>...
:I am a complete novice at Perl, so please be gentle....
:I had thought that one of the great values of Perl, was that scripts could
:be transported between operating systems. I have a script that runs well
:under IRIX 6.5.2, but which does not 'run' under Perl version 5.003_07 on a
:PC running Windows NT4 sp4. The IRIX version of the script which runs
:perfectly is:
:----------------
:#! /usr/bin/perl -i.bak
:# fix up fonts in HTML web pages
:# turn "Arial" into "Arial, Helvetica, sans-serif"
:# and "Arial, Helvetica" into "Arial, Helvetica, sans-serif"
:
:@ARGV = grep chomp, `find . \\( -name '*.htm' -o -name '*.html'
\\) -print`;
Those look like backticks to me.
:
:while (<>) {
: s/font face="Arial,\s*Helvetica"/font face="Arial, Helvetica,
:sans-serif"/g;
: s/font face="Arial"/font face="Arial, Helvetica, sans-serif"/g;
: s/face="Arial"/face="Arial, Helvetica, sans-serif"/g;
: print;
:}
:---------
:The Win386 version of the script, which fails to run (it does nothing that
I
:can see, even using the -w option) is:
:---------------
:#!c:\perl\bin\perl -i.bak
:# fix up fonts in HTML web pages
:# turn "Arial" into "Arial, Helvetica, sans-serif"
:# and "Arial, Helvetica" into "Arial, Helvetica, sans-serif"
:
:@ARGV = grep chomp, 'c:\usr\local\bin\find c:\public_html -name
:*\.html -print';
Those look like single quotes to me. I think you want backticks in both
places.
:while (<>) {
: s/font face="Arial,\s*Helvetica"/font face="Arial, Helvetica,
:sans-serif"/g;
: s/font face="Arial"/font face="Arial, Helvetica, sans-serif"/g;
: s/face="Arial"/face="Arial, Helvetica, sans-serif"/g;
: print;
:}
:-----------------
:The line that calls the GNU 'find':
:c:\usr\local\bin\find c:\public_html -name *\.html -print
:runs properly when executed at the DOS prompt, so I guess that the problem
:is not there.
:
:Any helpful advice would be appreciated.
:
Since I don't have the same tools you do I can't test this out but you might
want to check the use of single quotes in a situation where backticks seem
called for
HTH
AmD
--
$email{'Allan M. Due'} = ' All@n.Due.net ';
--random quote --
echo "Your stdio isn't very std."
- Larry Wall in Configure from the perl distribution
------------------------------
Date: 09 Apr 1999 11:49:42 -0400
From: Jonathan Feinberg <jdf@pobox.com>
To: "Andrew Weller" <p8e77@keele.ac.uk>
Subject: Re: HELP! Code needed for line of best fit?!?!?
Message-Id: <m34smp4wvd.fsf@joshua.panix.com>
"Andrew Weller" <p8e77@keele.ac.uk> writes:
> With a scattering of points how does one 'filter-out' (average) the
> unwanted points and is left with a line of best fit, which can then
> be saved to a file?
This seems like a question best suited for a news group that discusses
algorithms in general.
ObPerl: there is a Perl module, the PDL, which enables fast operations
on arbitrarily larges matrices. This may be of some help to you.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Fri, 9 Apr 1999 18:28:29 +0100
From: "Martin" <martin@guest-books.com>
Subject: Re: HELP! Code needed for line of best fit?!?!?
Message-Id: <7eldan$ogm$1@newnews.global.net.uk>
>"Andrew Weller" <p8e77@keele.ac.uk> writes:
>
>> With a scattering of points how does one 'filter-out' (average) the
>> unwanted points and is left with a line of best fit, which can then
>> be saved to a file?
>
>This seems like a question best suited for a news group that discusses
>algorithms in general.
I didn't see the original post but there is a formula for the line of
best fit from the points of data (bivariate normal only I think but
fits most data).
The line is y = a + bx
b = Cov(x,y) / Var(X) in other words:
(I'm using E to mean SUM OF/SIGMA, x, y are corresponding data
values, X is the mean of x and Y the mean of the y values and n is the
number of pairs of data)
b = [ (Exy)/n - XY ] / [ (E(x^2))/n - X^2 ]
As the mean must be a point on every line of best fit:
a = Y - bX
So, in Perl. Assume you have two lists @xvalues and @yvalues where
($xvalues[0],$yvalues[0]) is a point in the scattergram etc.
$n = 0;
foreach(@xvalues)
$mean_of_x += $_;
$Exy += ($_ * $yvalues[$n]);
$Exsquared += ($_ * $_);
$n++;
}
foreach(@yvalues) { $mean_of_y += $_ }
$mean_of_x = $mean_of_x / $n;
$mean_of_y = $mean_of_y / $n;
$b = ( ($Exy / $n) - ($mean_of_x * $mean_of_y) ) / ( ($Exsquared / $n) -
($mean_of_x * $mean_of_x) );
$a = $mean_of_y - $b * $mean_of_x;
print "The line of best fit has equation y = $a + $b x";
<maths lesson over>
Martin
------------------------------
Date: Fri, 09 Apr 1999 12:09:41 -0500
From: rlb@intrinsix.ca (Lee)
Subject: Re: here docs vs qq quote operator. Just personal preference?
Message-Id: <B3339E859668246107@204.112.166.88>
tadmc@metronet.com (Tad McClellan) wrote:
>Uri Guttman (uri@home.sysarch.com) wrote:
>
>: here docs are called that because of their ancestry from sh. there they
>: were documents that were 'here' and not in a file, that were fed into
>: stdin. perl uses them as alternative string quotes and should use a
>: different name. i have seen word/line delimited/quoted strings. any
>: ideas on a better term for them?
>
>
> "there docs"?
>
>[...]
>
> "multi-line quotes/docs"
>
>[...]
>
> I think working "quote" into the name would help conceptually.
multiline here/there quote-strings.
Naming conventions by committee.
Lee
------------------------------
Date: Fri, 09 Apr 1999 16:35:42 GMT
From: dragons@dragons.duesouth.net (Matthew Bafford)
Subject: Re: Hotmail's Homepages
Message-Id: <slrn7gs9gh.td.dragons@dragons.duesouth.net>
On Fri, 9 Apr 1999 15:56:38 +1000, Patrick Fong <patfong@yoyo.cc.monash.edu.au>
lucked upon a computer, and thus typed in the following:
) If anyone has been to Hotmail.com, and tried to view the source to their
) homepages, you will not be able to. How does someone protect other people
) from viewing the source to their homepages? (I have seen this question in
) a FAQ at irt.org and the answer is you cant).Perhaps someone would know? I
) am very interested in it because of the security issues involved in it.
Think that through a little. There, that's better.
How the heck could you hide the source of the page from the end user?
That would make the browsers kind of useless, wouldn't it?
) Tnx in advance
HTH, HAND
) P.
--Matthew
------------------------------
Date: Sat, 10 Apr 1999 02:23:50 +0900
From: "Tsuji" <tsuji@zd5.so-net.ne.jp>
Subject: Re: Hotmail's Homepages
Message-Id: <7eldgv$k5s$1@news01dg.so-net.ne.jp>
No, there is no such thing as hiding scripts, until Internet Explorer 5 came
along. IE5 has a new feature that allows scripts to be encoded. It's decoded
on the client side and run, but until someone decides to hack it (which
probably won't be long), there is no way to view encoded IE5 scripts. It
shows up on your browser as a bunch of commented gibberish. The disadvatage
is, of course, that encoded scripts can only be run on IE5, and all other
browsers will ignore it. (BTW, I can also read Hotmail's scripts by simply
going to view source) If a script is operating but you can't see it in the
source, it is probably been linked to an external file (to see the source,
type in the name of the external script file, and the browser will prompt
you to save it or open it. It's simple ascii text). To include a script from
an external file, you'll see a tag like this:
<SCRIPT SRC="external.js" TYPE="text/javascript"
LANGUAGE="JavaScript"></SCRIPT>
Note that this is not script hiding, and anybody can still read the source
easily.
Patrick Fong wrote in message ...
>Hi
>
>I know the answer to this question may violate copyright laws, but perhaps
>someone could give me a hint about the answer.
>
>If anyone has been to Hotmail.com, and tried to view the source to their
>homepages, you will not be able to. How does someone protect other people
>from viewing the source to their homepages? (I have seen this question in
>a FAQ at irt.org and the answer is you cant).Perhaps someone would know? I
>am very interested in it because of the security issues involved in it.
>
>Oh btw, where can I find out about protecting pages from being viewed? As
>in password protect a page? I know of JavaScript capabilities and to some
>extent Perl. I have looked in developer.netscape.com and found nothing and
>also Perl.com. Perhaps someone who is doing WWW stuff professionally may
>be able to point me in the right direction.
>
>Tnx in advance
>
>P.
.
------------------------------
Date: Fri, 9 Apr 1999 12:39:10 -0500
From: "Robert Miller" <rmiller@uh.edu>
Subject: How can perl scripts support drag-n-drop in Win32 environment?
Message-Id: <7ele0a$61k$1@Masala.CC.UH.EDU>
VG8gdGhlIGd1cnVzLi4uDQoNClVuZGVyIEFjdGl2ZXdhcmUgUGVybCBmb3IgV2luMzIsIEkgaGF2
ZSBhIHNjcmlwdCB0aGF0IHJ1bnMgT0sgZnJvbSB0aGUgY29tbWFuZCBsaW5lIChpLmUuIC0gcGVy
bC5leGUgc2NyaXB0LnBsIGFyZzEudHh0KS4gSXMgdGhlcmUgc29tZSBzaW1wbGUgd2F5IHRvIGNy
ZWF0ZSBhIHNob3J0Y3V0IG9yIG90aGVyIEdVSSBvYmplY3QgdGhhdCBJIGNhbiBkcm9wICJhcmcx
LnR4dCIgb24gdG8gZG8gdGhlIHNhbWUgdGhpbmc/IEkgaGF2ZW4ndCBzZWVuIGFueXRoaW5nIGFi
b3V0IHRoaXMgaW4gdGhlIFBlcmwgV2luMzIgRkFRLg0KDQpUaGFua3MsDQotUm9iZXJ0DQoNClJv
YmVydCBXLiBNLiBNaWxsZXIgLyBVbml2LiBvZiBIb3VzdG9uDQo=
------------------------------
Date: 09 Apr 1999 10:11:19 -0600
From: Greg Wimpey <greg.wimpey@waii*removetomail*.com.invalid>
Subject: Re: How do I send an email attachment with sendmail pipe
Message-Id: <sn3e29n594.fsf@ddcspn37.denver.waii.com>
Jonathan Stowe <gellyfish@gellyfish.com> writes:
> You have overlooked the MIME::* modules available from CPAN - I have been
> using the MIME::Lite module to do attachments recently with no effort
> whatsoever really.
I meant to add in my post "There is probably a perl package that does
this." I don't work with MIME on a regular basis, so I've never had
to seek out that package.
Thanks for the information.
--
Greg Wimpey
greg.wimpey@waii*removetomail*.com.invalid
------------------------------
Date: Fri, 09 Apr 1999 10:54:08 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: How do i write a program that will spell a word every way possible?
Message-Id: <370E3EC0.122DE0DF@mail.cor.epa.gov>
[cross-post to c.l.javascript dropped]
Poohba wrote:
>
> I want the program to ask for a work then print that word out every way
> possible. So if the word is "hello" it will print out (hello, holle,
> helol) etc. Or if it possible, it will print out (hell, hole) or anything
> else that might be a word.
>
> * Web Page Designs *
> / poohba@io.com | www.io.com/~poohba\
> ---------------------------------------
> \ For info about me send message with /
> * subject "send file help" *
>
Since you're crossposting, I'll assume you have no code written in
anything
yet. In Perl, it's simple. Use Mark-Jason Dominus' code for
permutations
of a set of letters [get it from DejaNews or his website]. Pluck
/usr/dict/words up for your dictionary [or any other dictionary you
prefer].
Then use the code straight out of the FAQ to find 'the intersection of
two
arrays'. Presto! You're done.
HTH,
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: Fri, 09 Apr 1999 19:03:55 +0200
From: William Blasius #42722 <Wm.Blasius@ks.sel.alcatel.de>
To: RJ <raymondj@raleigh.ibm.com>
Subject: Re: How to close all file descriptors ?
Message-Id: <370E32FB.794BDF32@ks.sel.alcatel.de>
A copy of this post was mailed to <raymondj@raleigh.ibm.com>
RJ wrote:
>
> I am having a problem when I fork a new process from a CGI. The web
> client does not end the connection until the newly created process
> ends (the newly created process does not end so the client's
> connection never ends.)
>
> With a little bit of debugging I see that the web server has access to
> the newly created process through file handle 7 (as seen by the new
> process)
>
> Question: How in perl can you close all file handles? (or even a
> particular one without having a perl FILEHANDLE reference.
>
> In C you could use fcntl(0, F_CLOSEM, 1); but F_CLOSEM does not
> appear to be available in perl.
> raymondj@removethis.raleigh.ibm.com
It's not clear (to me) what you want to accomplish with this. Do you
want to close the file descriptor from the new process? If so, where
is the filehandle you used to open the connection?
This might not give you what you want, anyway. If you expect to open
the filehandle again, you will hang the parent process since it will
not close the fd until it has received the SIGCHILD for the process,
even if the child process has closed the pipe from its end. Both the
explicit close and the implied close (using open on the same handle)
have this problem.
To get around this, you can double-fork your children:
$pid = open($fh, "|-");
die "Couldn't fork to child" unless defined $pid;
if ($pid){ # parent
... parent stuff!
} else {
if ($pid = fork) { exit (0x42) }; # still a child - suicide
...do kid stuff # execute as grandchild - inherit fds
}
This allows the parent to close the fd, but it still gives the error
Warning: unable to close filehandle GEN0 properly. $! is No children
from the close. You will also not get any signals from the children,
if you care about that.
OTOH, I might have completely misunderstood your intentions.
hth
Wm Blasius
Stuttgart
--
...now I'm <wm.blasius@ks.sel.alcatel.de> - no matter what my mail
server says!
------------------------------
Date: Fri, 09 Apr 1999 16:24:12 GMT
From: homelessinseattle@my-dejanews.com
Subject: Re: Is Perl the right tool for the job
Message-Id: <7el9j5$ocs$1@nnrp1.dejanews.com>
In article <370A0F0C.50A9931B@pog.ufl.edu>,
William Sanns <wsanns@pog.ufl.edu> wrote:
> there are many instances where I would just like to
> present the user with a "report" from the database in html format (I
> would have used ASP in my "previous life"). From what I've seen, Perl
> looks like its easy to pick up, but is it capable of creating a "dynamic
> length" html page (the page would have anywhere from 0 to n number of
> records returned to the user based on their selections
Perl would be perfect for the job. Perl can easily display any length HTML
page. You can write a simple script in Perl which would allow you to create
a template for the output form, while inserting any amount of records between
the top of the page and the bottom. If you need help down the road, or would
like to see a sample application that would mirror the script you describe,
let me know, and I'd be happy to help you for nothing. No-one who's ever
learned Perl would consider using any other tool.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 9 Apr 1999 12:32:51 -0500
From: "Jay J" <SpamMeNOT.3pound@iname.com>
Subject: iterate @$list_ref same as @list ?
Message-Id: <qNqP2.42$Ji.544128@rsnws01.mn.mediaone.net>
before I post this wacky routine.. in pseudo-code:
Is there a good reason why foreach'ing (@$list_ref) should act different
than foreach (@list) ?
I'm while {$_=~ /$pattern/ig} matching inside this foreach and exiting the
foreach on <condition> ... In a list-ref scenario it picks up where it left
off on a previous call to this sub, normal list... works like it should*.
thanks..
-Jay J
------------------------------
Date: Fri, 09 Apr 1999 09:58:40 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: minimal pattern matching
Message-Id: <370E31C0.69CAE5D9@mail.cor.epa.gov>
Ronald J Kimball wrote:
>
> <sstarre@my-dejanews.com> wrote:
>
> > Yes Sam, and the reason was that I wanted to give you another opportunity to
> > complain that someone didn't do a doctoral research project on a question
> > before posting it. Honestly, if its SOOOOO difficult to reply without adding
> > in complaints, why bother? You we're doing so well up to the end too...
>
> Perhaps you keep getting these complaints because you continue posting
> questions that show a lack of sufficient research. You're also hostile
> to the very people that you hope will answer your question.
>
> I remember having a discussion with you about this when you first
> started posting to clpm in November. I guess you're still working on
> improving both your research skills and your attitude [*].
> *sigh*
>
> [*] Not that this message will help with the latter. ;)
>
> --
> _ / ' _ / - aka -
> ( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
> / http://www.tiac.net/users/chipmunk/
> "It's funny 'cause it's true ... and vice versa."
Funny. I have had a discussion or two with sstarre and have gotten an
entirely different impression. I would vote for cutting a little slack
here on this one and watching for improvement over time.
Like my vote has ever counted for much. :-)
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: Fri, 09 Apr 1999 10:45:38 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Move from IIS, ASP, COM, Java to Linux, Apache, mod_perl, Java?
Message-Id: <370E3CC2.3B2BCD5D@mail.cor.epa.gov>
Steve Moon wrote:
>
> Hi,
>
> I currently have a system that uses Java Middleware to connect to a back-end
> host using 3270 screen scraping. The UI is all done in vbscript and ASP pages.
> ASP can instantiate the java objects using COM, so getting data in and out is
> quite easy. This works quite well, but in the spirit of fixing things that
> ain't broke:
>
> I would _LOVE_ to move this system over to Perl (vbscript sucks) and at the
> same time dump NT in favor of Unix -- probably Linux.
>
> How can I instantiate the java objects from within Perl, and more specifically,
> from within mod_perl?
>
> Any help appreciated in advance.
>
> Thanks!
> Steve-
Check out JPL, the Java-Perl Library, free from O'Reilly. Written by
Larry Wall, so you know it's awesome. That should do what you want.
But why are you using Java to do the connect to your back-end host?
That doesn't sound like you're playing to Java's strengths. Perl might
be a better solution there too. Or not - I have been wrong before. :-)
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: Fri, 09 Apr 1999 10:23:23 -0600
From: Jeff Beard <jeffbREMOVETHIS@mcguckin.com>
Subject: Object help
Message-Id: <370E297B.69CC304B@mcguckin.com>
Pardon if this is poorly explained but I'm not completely familiar with
Perl jargon or the language.
I'm writing a CGI program using CGI.pm and mod_perl. I think, though,
that this is a Perl language issue I'm dealing with.
What I've done is to put all of my subroutines for this program in a
module. What I'm having trouble with is how to use the $query object
that I define in my program in the module.
As an example, in just a regular CGI program I would grab a bunch of
form data and do something with it:
foreach my $foo ($query->param) {
print "$query->param($foo)\n";
}
What I don't know how to do is share/export/whatever_the_term_is the
$query->param object with the subroutines in the module and be able to
manipulate the data in the same manner.
Could someone shed a little light, please? Any help or directions to
useful docs are appreciated.
Cheers,
Jeff
--
-------------------------------------------------------
Clean up my email address before using it to reply
-------------------------------------------------------
Jeff Beard
McGuckin Hardware
Boulder, CO
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5340
**************************************