[23481] in Perl-Users-Digest
Perl-Users Digest, Issue: 5694 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 22 11:05:47 2003
Date: Wed, 22 Oct 2003 08:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 22 Oct 2003 Volume: 10 Number: 5694
Today's topics:
Re: -w <abigail@abigail.nl>
Re: <$fh> question <jminicoz@optonline.net>
Re: commands, which is better <robertw@nospam.acm.org>
Re: DBI & primary keys <someone@somewhere.com>
Error checking on File I/O <jminicoz@optonline.net>
Re: escape email quotes news@roaima.freeserve.co.uk
exe2perl - the C version . . . <goth1938@hotmail.com>
Re: exe2perl - the C version . . . <robertw@nospam.acm.org>
Re: Further on Taint - exact code that has the problem <xx087@freenet.carleton.ca>
Re: parse boolean logic (David Combs)
Re: performance arrays vs hashes <jminicoz@optonline.net>
Re: Perl and IIS - script runs but 'The page cannot be (stew dean)
Re: Perl and IIS - script runs but 'The page cannot be (stew dean)
Re: Perl and IIS - script runs but 'The page cannot be <asu1@c-o-r-n-e-l-l.edu>
Re: PGP in perl? <rp60@hotmail.com>
Re: PGP in perl? (Susan Foster)
Re: Quick Perl question <spam@thecouch.homeip.net>
Re: Regex to extract row data from text (Copy of data i <timbenz@timbenz.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 22 Oct 2003 09:00:36 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: -w
Message-Id: <slrnbpchpk.jqa.abigail@alexandra.abigail.nl>
Brad Baxter (bmb@ginger.libs.uga.edu) wrote on MMMDCCIII September
MCMXCIII in <URL:news:Pine.A41.4.58.0310211627160.15228@ginger.libs.uga.edu>:
&& One of Abigail's signature lines:
&&
&& perl -swleprint -- -_=Just\ another\ Perl\ Hacker
&&
&& This one I actually got. Except for the '-w' part. Does -w serve a
&& specific function in this case over and above its usual one? Just a case
&& of an inquiring mind ...
The -w made you think, didn't it? So, it does have a function...
Abigail
--
perl -swleprint -- -_=Just\ another\ Perl\ Hacker
------------------------------
Date: Wed, 22 Oct 2003 12:05:33 GMT
From: "Joe Minicozzi" <jminicoz@optonline.net>
Subject: Re: <$fh> question
Message-Id: <houlb.35733$6j.6142219@news4.srv.hcvlny.cv.net>
Abigail's solution is probably your best bet. The <> operator has two
functions: one is the readline equivalent and the other is file name
globbing (matching a wildcard file pattern). The way Perl decides what you
want is by examining what's between the angle brackets at compile time. If
anything more complicated than a filehandle or a simple scalar variable is
between the angle brackets, Perl will interpret it as a file name globbing
request. Using readline avoids any ambiguity, as does calling glob if you
want file name globbing.
"Neil Shadrach" <neil.shadrach@corryn.com> wrote in message
news:bn2p86$hgg$2@visp.bt.co.uk...
> Abigail wrote:
>
> > Neil Shadrach (neil.shadrach@corryn.com) wrote on MMMDCCII September
> > MCMXCIII in <URL:news:bn0th1$hgg$1@visp.bt.co.uk>:
> > !!
> > !! If I have a few lines like this which work fine:
> > !!
> > !! my $fh=$p->{'fh'};
> > !! while (<$fh>)
> > !! { # loop contents
> > !! }
> > !!
> > !! How do I avoid resorting to temporary variable $fh?
> > !! I've had a look at the perlop pages but all is still not clear to me
:(
> >
> >
> > Parsing of the content of <> is tricky. One way of solving it is
> > by not using <>, which is just a shorthand for calling readline:
> >
> > while (defined ($_ = readline $p -> {fh})) {
> > # Your loop here
> > }
>
> Thanks for that. Not as pretty as I'd hoped but enlightening nonetheless.
>
------------------------------
Date: Wed, 22 Oct 2003 09:46:34 -0400
From: Robert Wallace <robertw@nospam.acm.org>
Subject: Re: commands, which is better
Message-Id: <3F968A3A.C7C2E224@nospam.acm.org>
Tedd Hansen wrote:
>
> Using the first one, Perl receives data directly and you process it line by
> line.
> Using the second method will give the OS (and Perl) a chance to buffer data
> and write chunks to your variable.
.....
whoa
thanks for the analysis folks
looks like i've got a load of research ahead of me.
------------------------------
Date: Wed, 22 Oct 2003 13:40:00 +0100
From: "Bigus" <someone@somewhere.com>
Subject: Re: DBI & primary keys
Message-Id: <bn5tr3$qk8@newton.cc.rl.ac.uk>
"Tore Aursand" <tore@aursand.no> wrote in message
news:pan.2003.10.21.10.48.34.573607@aursand.no...
> On Tue, 21 Oct 2003 09:40:42 +0100, Bigus wrote:
> > I'm inserting a new record into a MySQL table using Perl DBI. I need to
> > retrieve the unique primary key that's created automatically by the db
as
> > the new record is inserted.
>
> You could try this approach:
>
> # do the insert
> my $id = $stInsert->{'mysql_insertid'};
That's work excellently and is easier than using the LAST_INSERT_ID. I'm
likely to stick with mySQL aswell since along with the phpmyadmin web
interface it's nice and easy to use :) I was gonna ask where
'mysql_insertid' comes from but just found it in the DBD-mysql docs.
> In the early days I created an application which would run on a set of
> different database systems. The solution was to use an extra field in
> every table as a lookup field (see above). Surely not a clever way to do
> it, but it worked very well.
[..code..]
> Quite hairy, huh? :-)
Yes :) That's what I was kind of considering I might have to do.
Bigus
------------------------------
Date: Wed, 22 Oct 2003 13:28:05 GMT
From: "Joe Minicozzi" <jminicoz@optonline.net>
Subject: Error checking on File I/O
Message-Id: <FBvlb.37521$6j.6505926@news4.srv.hcvlny.cv.net>
This is kind of an oddball question, but it's been bugging me for a while.
How does one check for an error when reading a file?
Unless I've misread the documentation (about 100 times), getting undef from
a readline means EOF _or_ error. I've been working with Perl since version
5 came out and the only way I've found to discern between EOF and error is
to use IO::Handle::error. I've been using the following code to do this:
# The following bit of skullduggery is used to load as little of the IO
module
# as possible while defining &IO::Handle::error, which is defined in the XS
# part of the IO module, version 1.20.
use IO 1.20 () ;
BEGIN
{
# Check that &IO::Handle::error was defined.
die "$ProgName: &IO::Handle::error not defined by IO XS module;"
unless defined &IO::Handle::error ;
}
...
$line = readline HANDLE ;
# Check for read error. This uses Perl's *foo{THING} syntax.
# (See Making References in the perlref manpage.)
if (*HANDLE{IO}->error()) # read error
{
...
}
else # EOF
{
...
}
Assuming I haven't missed something, if there are any Perl historians,
language lawyers or source code gurus out there, I'd like to know why it's
not easier to error check a readline. Error checking a print is much
simpler -- the return value of print indicates success or failure. However,
error checking a write would appear to require use of IO::Handle::error too;
Perl documentation does not indicate any return value. (Thankfully, I
almost never use write.)
------------------------------
Date: Wed, 22 Oct 2003 08:55:17 +0100
From: news@roaima.freeserve.co.uk
Subject: Re: escape email quotes
Message-Id: <5oph61-epc.ln1@news.roaima.co.uk>
Sam Holden <sholden@flexal.cs.usyd.edu.au> wrote:
>> print MAIL "From: whoever@wherever\n";
> Why don't you try that and see what actually happens. Turning on
> warnings will make the problem blindingly obvious.
Yes. Point taken, oops.
> That's completely different from the OP's question, since his @ symbol
> isn't in a double quoted perl string according to his description.
Agreed. It's completely different, and I don't believe I have answered
my own question. I stand by my question, which is why the OP feels that
they needs to escape an @ symbol inside a variable.
Chris
--
@s=split(//,"Je,\nhn ersloak rcet thuarP");$k=$l=@s;for(;$k;$k--){$i=($i+1)%$l
until$s[$i];$c=$s[$i];print$c;undef$s[$i];$i=($i+(ord$c))%$l}
------------------------------
Date: Wed, 22 Oct 2003 15:52:23 +0800
From: "Just in" <goth1938@hotmail.com>
Subject: exe2perl - the C version . . .
Message-Id: <bn5cvo$aph$1@news01.intel.com>
I know exe2perl exists, but I remember there being a C program written by an
Indian gentlemen that can extract Perl from executable files generated with
applications like perlapp and perl2exe.
Anyone know where I can get hold of it?
Bests,
Just in
------------------------------
Date: Wed, 22 Oct 2003 09:55:33 -0400
From: Robert Wallace <robertw@nospam.acm.org>
Subject: Re: exe2perl - the C version . . .
Message-Id: <3F968C55.C602ED9C@nospam.acm.org>
Just in wrote:
>
> I know exe2perl exists, but I remember there being a C program written by an
> Indian gentlemen that can extract Perl from executable files generated with
> applications like perlapp and perl2exe.
>
> Anyone know where I can get hold of it?
interesting...
http://www.programmersheaven.com/zone27/cat850/18594.htm
http://www.freesoftboard.de/board/phpbb/archive/topic/28781-1.html
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=exe2perl
------------------------------
Date: 22 Oct 2003 13:00:33 GMT
From: Glenn Jackman <xx087@freenet.carleton.ca>
Subject: Re: Further on Taint - exact code that has the problem
Message-Id: <slrnbpcvsk.9ko.xx087@smeagol.ncf.ca>
Ben <2stormts@nemontel.net> wrote:
> $rez = system($command);
[...]
> pogmaker absolutely will not run.
Find out why:
if ($rez != 0) {
print "<p>'$command' exits status: ", $rez/256, "</p><pre>$!</pre>";
}
--
Glenn Jackman
NCF Sysadmin
glennj@ncf.ca
------------------------------
Date: Wed, 22 Oct 2003 13:32:29 +0000 (UTC)
From: dkcombs@panix.com (David Combs)
Subject: Re: parse boolean logic
Message-Id: <bn60td$sp7$1@reader1.panix.com>
In article <pkent77tea-B78571.19551008102003@pth-usenet-02.plus.net>,
pkent <pkent77tea@yahoo.com.tea> wrote:
>In article <blup92$o8i$1@news.rz.uni-karlsruhe.de>,
> Steffen Müller <sv99oya02@sneakemail.com> wrote:
>
>> Thomas Reat wrote:
>> > I have a perl script that must take some boolean logic as input.
>> > Something like:
>> >
>> > ((a || b) & !c) || d || (e && f)
>> >
>> > Is there any module out there that can help me parse this? And
>> > evaluate it as well?
>...
>> As Sam pointed out earlier, Parse::RecDescent can easily parse such
>> expressions. You can find a working example grammar for more involved
>> *arithmetic* expressions in the Math::Symbolic::Parser module that is
>...
>
>Also, I've found Yapp really good.
>http://search.cpan.org/~fdesar/Parse-Yapp-1.05/lib/Parse/Yapp.pm
>
>It was pretty simple to implement arbitrary arithmetic and logical
>expressions. To implement just the boolean logic as you have above would
>be even easier. In my implementation I used the parser to create a tree
>of nodes, of arbitrary depth, and then an evaluation routine walked over
>that tree, recursively, deciding its truth (because all you need to get
>as a result is a true or false value).
Kent, perhaps you could post your code here, so we could
all learn how to do this very-useful kind of task?
Thanks!
David
------------------------------
Date: Wed, 22 Oct 2003 12:52:36 GMT
From: "Joe Minicozzi" <jminicoz@optonline.net>
Subject: Re: performance arrays vs hashes
Message-Id: <o4vlb.36850$6j.6356473@news4.srv.hcvlny.cv.net>
What the others have said about arrays and hashes being apples and oranges
is true, but here's one way to think of it: A Perl array is like arrays in
most languages -- it's a collection of data indexed by a number. A Perl
hash can be thought of as an array, but it's not indexed by a number, but by
a string. So, to look up something in an array, you can say "$array[23]"
but you can't say "$array['abcd']. (Actually, you can but you'll get
$array[0].) You _can_ say "$hash{'abcd'}" or "$hash{'whatever I damn well
please'}" and actually, you don't need the quotes; "$hash{abcd}" works just
as well. You can even say "$hash{99}" but the 99 will be interpreted as a
string so it's the same as "$hash{'99'}.
So now you might ask, "Well, if I can index a hash like I can index an
array, why should I use an array?" There are two reasons: maintaining
element order, and performance. As some of the others said, a hash is
implemented using a hashing algorithm on the index (which in Perl, we call a
key), and this results in the elements being stored in a seemingly random
order. So if you create a hash with keys from 'A' to 'J' and the read the
hash back using something sequential like a foreach loop, you won't get them
back in 'A' to 'J' order. If you create an array with indexes from 1 to 10
and read it back sequentially, you get them back in 1 to 10 order. This
property of arrays is very useful when using the array as a stack or a
queue, where, if you add an element at the end, it has to stay at the end.
Perl's push, pop, shift and unshift functions manipulate arrays in just this
way.
The other reason is performance. Although it is somewhat variable, I've
seen estimates that it is about 20% faster to use an array instead of a
hash. But don't let that sway you too much. If you need data to be indexed
using a string, then a hash is just what you want. But if you can
conveniently use a number as the index, an array is a better choice. And if
you want a stack or a queue or a plain list, an array is really the only
choice.
Hope this helps. You might also look up 'hashing' or 'hash algorithm' in
Google to get a better understanding of how a hash works.
"Thomas" <sctommi@gmx.net> wrote in message
news:5a1109df.0310210608.4d46b69d@posting.google.com...
> hi,
>
> i dont know enough of perl to describe,
> using hashes is better than using arrays...(or isnt so ?)
> i dont know how to ask some 'google' machine for this kind of question,
> but i hope we have some "perl guru's" here, whose like to answer
>
> best regards
> Thomas
------------------------------
Date: 22 Oct 2003 04:17:59 -0700
From: stewart@webslave.dircon.co.uk (stew dean)
Subject: Re: Perl and IIS - script runs but 'The page cannot be displayed'
Message-Id: <2b68957a.0310220317.22629956@posting.google.com>
"A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu> wrote in message news:<Xns941B70CB78211asu1cornelledu@132.236.56.8>...
> stewart@webslave.dircon.co.uk (stew dean) wrote in
> news:2b68957a.0310210253.38464359@posting.google.com:
>
> > This is not a pure Perl problem but is to do with the running of Perl
> > on IIS.
> >
> > I now have two scripts that run without errors (I'm using strict) but,
> > for some reason, will not display the simple 'Done!' page built into
> > the script. Instead the server gives me 'The page cannot be
> > displayed'.
>
> And we are supposed to divine what is going on without seeing a line of
> code?
The code it's self, although clunky no doubt compared to the abilities
of many, works fine. It's processing a large XML file and spitting out
webpages. With a smaller XML file it displays Done - with a larger one
it apears to time out. I've checked it for errors by putting a dummy
error in there but it only shows up that error.
> > I have run it on a local IIS set up with no problems but on the main
> > server I continue to get this error. As I have no error messages other
> > than page not displayed I'm not sure what I can tweak to get it to
> > work. Maybe there's an error log I could look at?
>
> There probably is. Why don't you look at it?
I don't know if there is an error log or where it would be if there
was. Any suggestions suggested.
> > I need to get a HTML page displayed at the end so I can then do futher
> > steps but so far cannot.
>
> ...
>
> > Any help appreciated.
>
> To get any help, you'll need top provide some information. Also, make
> sure this is not a web server configuration or CGI issue. Please refer to
> the posting guidelines for this group at
>
> http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
>
> Without at least seeing a short example script that illustrates the
> problem you are having, it is impossible to say anything.
The script is fine. I have many scripts running quite happily except
for the two hardest working scripts, both are fine when you give them
a short XML file but large ones cause problems. The server is hefty
enough to handle them (memory etc is all fine) so I'm thinking it's a
set up issue with IIS.
I'm looking to see if anyone else has a similair problem.
Stew Dean
------------------------------
Date: 22 Oct 2003 04:27:54 -0700
From: stewart@webslave.dircon.co.uk (stew dean)
Subject: Re: Perl and IIS - script runs but 'The page cannot be displayed'
Message-Id: <2b68957a.0310220327.4dc68db3@posting.google.com>
James Willmore <jwillmore@remove.adelphia.net> wrote in message news:<20031021114710.504263f7.jwillmore@remove.adelphia.net>...
> On 21 Oct 2003 03:53:24 -0700
> stewart@webslave.dircon.co.uk (stew dean) wrote:
>
> > This is not a pure Perl problem but is to do with the running of
> > Perl on IIS.
> >
> > I now have two scripts that run without errors (I'm using strict)
> > but, for some reason, will not display the simple 'Done!' page built
> > into the script. Instead the server gives me 'The page cannot be
> > displayed'.
> >
> > I have run it on a local IIS set up with no problems but on the main
> > server I continue to get this error. As I have no error messages
> > other than page not displayed I'm not sure what I can tweak to get
> > it to work. Maybe there's an error log I could look at?
>
> This questions begs one to ask - "Did you read the documentation for
> IIS?". Errors from your script _should_ be there for you to examine.
The errors for the script are not going to be in the documentation. I
have a rather hefty manual I could spend a few weeks reading but I
very much doubt it will resolve my issue.
> >
> > I need to get a HTML page displayed at the end so I can then do
> > futher steps but so far cannot.
> >
> > I'm running ActiveState Perl 5.8 with IIS 5 on a Windows 2000 box.
> >
> > Any help appreciated.
>
> Please start by RTM :-) Also, run the script at the command line.
> Any errors should show there - and be identical (with all things being
> equal) to the error messages in the error log.
When it comes down to the combination of technolgies i'm using the
manuals don't cut it. The perl ones are aimed at Unix users and the
IIS help files don't (help that is). I have some heft books on IIS
and, quite frankly, it's a soul destoying paper chase form tech term
to tech term.
I've been online for about nine years now - the interweb superexpress
freeway always delivers answers that dead tree media often cannot. I
wouldnt ask if it the solution was in the pile of vegetable cells on
my desk.
Stew Dean
>
> HTH
>
> --
> Jim
>
> Copyright notice: all code written by the author in this post is
> released under the GPL. http://www.gnu.org/licenses/gpl.txt
> for more information.
>
> a fortune quote ...
> In English, every word can be verbed. Would that it were so in
> <our programming languages.
------------------------------
Date: 22 Oct 2003 14:55:43 GMT
From: "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu>
Subject: Re: Perl and IIS - script runs but 'The page cannot be displayed'
Message-Id: <Xns941C6F2D4438Easu1cornelledu@132.236.56.8>
stewart@webslave.dircon.co.uk (stew dean) wrote in
news:2b68957a.0310220327.4dc68db3@posting.google.com:
> James Willmore <jwillmore@remove.adelphia.net> wrote in message
> news:<20031021114710.504263f7.jwillmore@remove.adelphia.net>...
>> On 21 Oct 2003 03:53:24 -0700
>> stewart@webslave.dircon.co.uk (stew dean) wrote:
>>
>> > This is not a pure Perl problem but is to do with the running of
>> > Perl on IIS.
>> >
>> > I now have two scripts that run without errors (I'm using strict)
>> > but, for some reason, will not display the simple 'Done!' page
>> > built into the script. Instead the server gives me 'The page cannot
>> > be displayed'.
>> >
>> > I have run it on a local IIS set up with no problems but on the
>> > main server I continue to get this error. As I have no error
>> > messages other than page not displayed I'm not sure what I can
>> > tweak to get it to work. Maybe there's an error log I could look
>> > at?
>>
>> This questions begs one to ask - "Did you read the documentation for
>> IIS?". Errors from your script _should_ be there for you to examine.
>
> The errors for the script are not going to be in the documentation. I
> have a rather hefty manual I could spend a few weeks reading but I
> very much doubt it will resolve my issue.
The manual would tell you where to find the error logs so you can find
out what is wrong, and maybe give us a clue. That is not too much to ask.
> I've been online for about nine years now - the interweb superexpress
> freeway always delivers answers that dead tree media often cannot. I
> wouldnt ask if it the solution was in the pile of vegetable cells on
> my desk.
So, you cannot be bothered to check the error logs, and tell us what is
in there, but somehow we are supposed to divine what is going on ...
Interesting attitude.
In the time you took to type up all these replies as to why you won't
check the error logs, you could have checked the error logs, and posted
some information that could have been helpful in figuring out the
problem.
--
A. Sinan Unur
asu1@c-o-r-n-e-l-l.edu
Remove dashes for address
Spam bait: mailto:uce@ftc.gov
------------------------------
Date: Wed, 22 Oct 2003 10:39:08 GMT
From: "Russel Pearson" <rp60@hotmail.com>
Subject: Re: PGP in perl?
Message-Id: <g7tlb.9246$V11.2700@charlie.risq.qc.ca>
eeee.... where do you define $outfile variable ?
Russel
"Susan Foster" <susan_foster@rinkworks.com> a écrit dans le message de
news:8b231359.0310211102.36e78587@posting.google.com...
> I've been scanning several of the previous posts to this group, and
> have tried several methods, but I have been unsuccessful in all my
> attempts to be able to PGP encrypt a file from a .pl.
>
> First try was by using PGPSimple - before I go any further, I'll
> mention that I am running this program on a Linux box (shouldn't make
> a difference, but thought I would say it to be complete). Anyway, I
> basically took the CPAN man page example, set them with my settings,
> and tried to encrypt. After many adjustments, I have had the program
> run - but received no output. Below is what I have set (with
> strategic changes for privacy, of course):
>
> use Crypt::PGPSimple;
>
> my $pgp_config_files = "~/.pgp";
> my $pgp_version = "6.5.8";
> my $pgp_path = "/usr/bin/pgp";
> my $pgp_temp_file_path="/tmp/";
> $ENV{"PGPPATH"} = $pgp_config_files;
> my ($objPGP) = new Crypt::PGPSimple;
> $objPGP->Version($pgp_version);
> $objPGP->PgpExePath($pgp_path);
> $objPGP->PgpKeyPath("$pgp_config_files");
> $objPGP->PgpTempDir($pgp_temp_file_path);
> my $pgp_public_key_user_id="blah\@blah.com";
> my $output_file = "$outfile" . ".pgp";
> my $plain_text_message = `cat $outfile`;
> $objPGP->PublicKey($pgp_public_key_user_id);
> $objPGP->PlainText($plain_text_message);
> $objPGP->Encrypt;
> my $encrypted_message = $objPGP->EncryptedText;
> print "Message:$encrypted_message\n";
>
> The program runs, but nothing comes out of the encryption - I don't
> get anything at all.
>
> I also tried an example from this group, which uses open2 - it seems
> to use options that are not valid for my version of PGP, and I can't
> figure out what are the comparable options in my version.
>
> I hate to be vague - if I need to give more detail, please let me know
> - I'd love to get any sort of help - I've been bashing my head over
> this for 2 days!
>
> Susan
------------------------------
Date: 22 Oct 2003 07:16:35 -0700
From: susan_foster@rinkworks.com (Susan Foster)
Subject: Re: PGP in perl?
Message-Id: <8b231359.0310220616.1f88e379@posting.google.com>
The piece posted below is only a part of the program - I wanted to
focus on the PGP part only. The rest of the program is concerned with
opening a flat file and reformatting it to the client's needs.
$outfile is defined there - and the program uses use strict, so I am
definitely sure that $outfile is defined.
Susan
"Russel Pearson" <rp60@hotmail.com> wrote in message news:<g7tlb.9246$V11.2700@charlie.risq.qc.ca>...
> eeee.... where do you define $outfile variable ?
>
> Russel
>
>
> "Susan Foster" <susan_foster@rinkworks.com> a écrit dans le message de
> news:8b231359.0310211102.36e78587@posting.google.com...
> > I've been scanning several of the previous posts to this group, and
> > have tried several methods, but I have been unsuccessful in all my
> > attempts to be able to PGP encrypt a file from a .pl.
> >
> > First try was by using PGPSimple - before I go any further, I'll
> > mention that I am running this program on a Linux box (shouldn't make
> > a difference, but thought I would say it to be complete). Anyway, I
> > basically took the CPAN man page example, set them with my settings,
> > and tried to encrypt. After many adjustments, I have had the program
> > run - but received no output. Below is what I have set (with
> > strategic changes for privacy, of course):
> >
> > use Crypt::PGPSimple;
> >
> > my $pgp_config_files = "~/.pgp";
> > my $pgp_version = "6.5.8";
> > my $pgp_path = "/usr/bin/pgp";
> > my $pgp_temp_file_path="/tmp/";
> > $ENV{"PGPPATH"} = $pgp_config_files;
> > my ($objPGP) = new Crypt::PGPSimple;
> > $objPGP->Version($pgp_version);
> > $objPGP->PgpExePath($pgp_path);
> > $objPGP->PgpKeyPath("$pgp_config_files");
> > $objPGP->PgpTempDir($pgp_temp_file_path);
> > my $pgp_public_key_user_id="blah\@blah.com";
> > my $output_file = "$outfile" . ".pgp";
> > my $plain_text_message = `cat $outfile`;
> > $objPGP->PublicKey($pgp_public_key_user_id);
> > $objPGP->PlainText($plain_text_message);
> > $objPGP->Encrypt;
> > my $encrypted_message = $objPGP->EncryptedText;
> > print "Message:$encrypted_message\n";
> >
> > The program runs, but nothing comes out of the encryption - I don't
> > get anything at all.
> >
> > Susan
------------------------------
Date: Wed, 22 Oct 2003 06:14:59 -0400
From: Mina Naguib <spam@thecouch.homeip.net>
Subject: Re: Quick Perl question
Message-Id: <IMslb.52756$SH1.1864723@wagner.videotron.net>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
MDS wrote:
> Hi there,
>
> Is there an easy way to write a Perl script for UNIX that returns the
> user to the command line on execution, other than using ./myscript.pl
> 2>&1 or ./myscript.pl & ?
The easiest way is:
use Proc::Daemon;
Proc::Daemon::Init;
The manual way is to do everything manually that the above module's documentation says to do, see:
perldoc -f fork
You can usually get away with just:
fork && exit;
But you're better off using the very first approach.
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/llineS99pGMif6wRAtLMAKCV9/GBS2nDYStHCt8EbFvAfKV2cgCgmUjH
BGsExklcv5ahikcEU/Y56D4=
=pJHR
-----END PGP SIGNATURE-----
------------------------------
Date: Wed, 22 Oct 2003 14:50:32 GMT
From: TimBenz <timbenz@timbenz.com>
Subject: Re: Regex to extract row data from text (Copy of data included)
Message-Id: <Xns941C4FC4C8411timbenztimbenzcom@66.75.162.196>
Thanks for all the replies. Sorry for having been remiss in not posting the
exact data, but it's proprietary trading data for our money management
firm, so I didn't know what I could post. Here is a representative piece,
however, that I don't think should worry anyone:
NAME OF ISSUER TITLE OF CUSIP MARKET AMOUNT SH/PRINV
DISC OTHER VOTING AUTHORITY
21ST CENTURY INS GRP COMMON 90130N103 974 70700 SH SOLE
70700 0 0
3COM CORP COMMON 885535104 5156 873949 SH SOLE
873949 0 0
3M COMPANY COMMON 88579Y101 36846 533460 SH SOLE
527760 0 5700
3M COMPANY COMMON 88579Y101 2735 39596 SH
OTHER 39596 0 0
IBM CORP COMMON 88179Y101 735 35110 SH SOLE
35110 0 0
As you can see, the structure is fairly open, and even the tab/space
structure changes depending on the size of entry in the first column.
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 5694
***************************************