[13771] in Perl-Users-Digest
Perl-Users Digest, Issue: 1181 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 27 21:52:30 1999
Date: Wed, 27 Oct 1999 18:52:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <941075531-v9-i1181@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 27 Oct 1999 Volume: 9 Number: 1181
Today's topics:
Format Statement <randy.m.briggin@delphiauto.com>
Re: Format Statement (Randal L. Schwartz)
Frames with perl <jacques@istac.rcanaria.es>
Re: Frames with perl <gellyfish@gellyfish.com>
Re: Frames with perl <jouardet@stud.ntnu.no>
Freezing objects for storage into a database <swensenj@bellsouth.net>
Re: Freezing objects for storage into a database (Abigail)
Re: Freezing objects for storage into a database (Damian Conway)
Re: Freezing objects for storage into a database (Ilya Zakharevich)
FTP through a proxy <j_f9NOj_SPAM@yahoo.com.invalid>
Re: Getting Parent directory from path!!!!!!!!!!!!!!!!! (Martien Verbruggen)
Re: Getting Parent directory from path!!!!!!!!!!!!!!!!! <gellyfish@gellyfish.com>
Re: Getting Parent directory from path!!!!!!!!!!!!!!!!! krun@my-deja.com
guestbook script error <y0013515@tu-bs.de>
Re: guestbook script error <scottlm@visi.com>
Re: guestbook script error (Abigail)
Re: guestbook script error <rootbeer@redcat.com>
Re: guestbook script error <gellyfish@gellyfish.com>
help building Pg on Red Hat 6.0 Linux? (Alan Mead)
help downloaded files appended to file, search for info (kevin anderson)
Re: help downloaded files appended to file, search for <dchristensen@california.com>
Re: help downloaded files appended to file, search for (Martien Verbruggen)
Help! Missing Cookies! richardstands@my-deja.com
Re: Help! Missing Cookies! richardstands@my-deja.com
Re: Help! Missing Cookies! <james_peregrino@harvard.edu>
HELP!! <drostaman@hotmail.com>
Re: HELP!! <dchristensen@california.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 25 Oct 1999 16:14:17 -0400
From: "Randy Briggin" <randy.m.briggin@delphiauto.com>
Subject: Format Statement
Message-Id: <7v2dlp$luq$1@kocrsv08.delcoelect.com>
Hi
I am new to Perl and I am writing a tracking program using Perl/Tk I put a
Print File button and wrote a sub function to accomadate this feature. The
sub function has formated output plus a header on each page using the _TOP
option but for some reason I can only get one successful print out of the
data after you print once the next time you print it leaves off the header
info on the first page from this time on. I have found that if I close the
program and restart it it seems to fix the problem the first time you print
after a restart but goes back to the same way as before. Can anyone help me
please, or is this the way the format statement is suppose to work?
Thanks
------------------------------
Date: 26 Oct 1999 09:33:30 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Format Statement
Message-Id: <m1yacqxesl.fsf@halfdome.holdit.com>
>>>>> "Randy" == Randy Briggin <randy.m.briggin@delphiauto.com> writes:
Randy> Can anyone help me please, or is this the way the format
Randy> statement is suppose to work?
What part of the description in "perldoc perlform" doesn't fit your
observed behavior? Did you check there first before coming to a
newsgroup?
print "Just another Perl hacker,"
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Wed, 27 Oct 1999 12:03:35 -0100
From: Jacques Bulchand Gidumal <jacques@istac.rcanaria.es>
Subject: Frames with perl
Message-Id: <3816F827.D84112CF@istac.rcanaria.es>
I have a HTML page with two frames. In the first, I have a FORM that
calls a perl script. I would like the perl script to write on the second
frame, so the form on the first frame will stay there. How can I do
this?
Jacques
------------------------------
Date: 27 Oct 1999 14:53:46 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Frames with perl
Message-Id: <381703ea_1@newsread3.dircon.co.uk>
Jacques Bulchand Gidumal <jacques@istac.rcanaria.es> wrote:
> I have a HTML page with two frames. In the first, I have a FORM that
> calls a perl script. I would like the perl script to write on the second
> frame, so the form on the first frame will stay there. How can I do
> this?
>
If you are using the module CGI.pm then you should see the section in
its documentation entitled:
WORKING WITH NETCAPE FRAMES
Alternatively you should look in the CGI faq at :
<http://www.webthing.com/tutorials/cgifaq.html>
If you then still have questions you should address them to the group:
comp.infosystems.www.authoring.cgi
as the solution is not specific to Perl.
/J\
--
"Tony Blair. Make it so" - Patrick Stewart
------------------------------
Date: Wed, 27 Oct 1999 16:37:48 +0200
From: Guillaume Jouardet <jouardet@stud.ntnu.no>
To: Jacques Bulchand Gidumal <jacques@istac.rcanaria.es>
Subject: Re: Frames with perl
Message-Id: <38170E3C.B5091F00@stud.ntnu.no>
In your form :
<form action="..." method="..." target="name_of_the_other_frame">
</form>
Jacques Bulchand Gidumal wrote:
>
> I have a HTML page with two frames. In the first, I have a FORM that
> calls a perl script. I would like the perl script to write on the second
> frame, so the form on the first frame will stay there. How can I do
> this?
>
> Jacques
--
Guillaume Jouardet
http://www.stud.ntnu.no/~jouardet
Herman Krags Vei 1-51, 7050 Trondheim, NORWAY
+ 47 73 88 97 56
------------------------------
Date: Mon, 25 Oct 1999 19:56:40 -0400
From: Jesse Swensen <swensenj@bellsouth.net>
Subject: Freezing objects for storage into a database
Message-Id: <B43A6677.AF7%swensenj@bellsouth.net>
I can't believe there isn't something out there already that will do this,
but I haven't found anything.
I would like to create a class that will freeze the variables and save them
to a database. I was thinking of creating a method called register that
would take as it parameters the name of variables and store them in an
array, $class->register("myVar"). Then the last thing to be done when
rendering a page is to freeze all the registered variables and create a
string that could be stored in a database. Then the first thing when the
next page is rendered would be to recreate all the variables so the
environment would be just like you left it. Yes, this is state for web
pages.
There are several references to modules/classes that will handle the
freezing part and I can make them work on a few variables or objects. What
I can't seem to figure out is how to gather up the registered variables and
serialize them dynamically.
If you have some ideas or have already solved this problem, I would love to
here from you. I have spent a week on this and my boss is getting nervous.
Jesse Swensen
swensenj@bellsouth.net
------------------------------
Date: 26 Oct 1999 03:42:35 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Freezing objects for storage into a database
Message-Id: <slrn81aqb0.fji.abigail@alexandra.delanet.com>
Jesse Swensen (swensenj@bellsouth.net) wrote on MMCCXLVI September
MCMXCIII in <URL:news:B43A6677.AF7%swensenj@bellsouth.net>:
() I can't believe there isn't something out there already that will do this,
() but I haven't found anything.
()
() I would like to create a class that will freeze the variables and save them
() to a database. I was thinking of creating a method called register that
() would take as it parameters the name of variables and store them in an
() array, $class->register("myVar"). Then the last thing to be done when
() rendering a page is to freeze all the registered variables and create a
() string that could be stored in a database. Then the first thing when the
() next page is rendered would be to recreate all the variables so the
() environment would be just like you left it. Yes, this is state for web
() pages.
()
() There are several references to modules/classes that will handle the
() freezing part and I can make them work on a few variables or objects. What
() I can't seem to figure out is how to gather up the registered variables and
() serialize them dynamically.
()
() If you have some ideas or have already solved this problem, I would love to
() here from you. I have spent a week on this and my boss is getting nervous.
Well, if you put all the variables in a hash, and then save the hash,
it should work. The drawback of that is extra punctuation, and some
loss of what 'use strict;' does for you.
The other possibility is to tie your variables into some package
that will do the registration and freezing.
Abigail
--
perl -wle\$_=\<\<EOT\;y/\\n/\ /\;print\; -eJust -eanother -ePerl -eHacker -eEOT
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 26 Oct 1999 01:35:50 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: Freezing objects for storage into a database
Message-Id: <7v30hm$rdo$1@towncrier.cc.monash.edu.au>
Jesse Swensen <swensenj@bellsouth.net> writes:
>I can't believe there isn't something out there already that will do this,
>but I haven't found anything.
>I would like to create a class that will freeze the variables and save them
>to a database. I was thinking of creating a method called register that
>would take as it parameters the name of variables and store them in an
>array, $class->register("myVar"). Then the last thing to be done when
>rendering a page is to freeze all the registered variables and create a
>string that could be stored in a database. Then the first thing when the
>next page is rendered would be to recreate all the variables so the
>environment would be just like you left it. Yes, this is state for web
>pages.
>There are several references to modules/classes that will handle the
>freezing part and I can make them work on a few variables or objects. What
>I can't seem to figure out is how to gather up the registered variables and
>serialize them dynamically.
>If you have some ideas or have already solved this problem, I would love to
>here from you. I have spent a week on this and my boss is getting nervous.
There's an entire chapter on exactly this problem in "Object Oriented Perl"
<www.manning.com/Conway/>
The obvious disclaimer applies.
Damian
------------------------------
Date: 26 Oct 1999 03:21:58 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Freezing objects for storage into a database
Message-Id: <7v36om$erl$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to Jesse Swensen
<swensenj@bellsouth.net>],
who wrote in article <B43A6677.AF7%swensenj@bellsouth.net>:
> I would like to create a class that will freeze the variables and save them
> to a database.
Instead of using the variables, use hash elements. Then freeze/thaw
the hash. Or (worse) create a hash names => value and assign to/from
symbol table at freeze/thaw time.
Ilya
------------------------------
Date: Tue, 26 Oct 1999 06:00:42 -0700
From: Frederic <j_f9NOj_SPAM@yahoo.com.invalid>
Subject: FTP through a proxy
Message-Id: <0a0133f8.0acc697f@usw-ex0102-011.remarq.com>
Does anyone happen to know where I could find
examples of perl scripts that connect
to a remote host through a firewall or socks
server? Net::FTP documentation is way too
terse for a beginner, I guess. Or if you have a few
pointers as to how to debug this script... Life looks
drab enough when all you've got to work with is
"Unknown error" in $@ :-)
use Net::FTP;
$ftp = Net::FTP->new("some.host.name", 'Firewall'
=> "firewall's.host.name", 'Port' => 1080);
$ftp->login("anonymous", "j_f9@yahoo.com");
$ftp->cwd("/pub");
$ftp->get("file");
$ftp->quit;
Or maybe it's the way libnet has been installed
on my machine.
FTP transfers to any hosts is a breeze, but
that proxy server is something else.
Greetings,
Frederic
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: Wed, 27 Oct 1999 00:38:41 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Getting Parent directory from path!!!!!!!!!!!!!!!!!!!!!!
Message-Id: <lQrR3.141$qU2.3502@nsw.nnrp.telstra.net>
[Your newsreader has a chronology problem. Your response actually came
before the bit you respond to. Please reverse the clock on your
system]
On Tue, 26 Oct 1999 13:52:26 GMT,
krun@my-deja.com <krun@my-deja.com> wrote:
> In article <slrn813dqe.dii.mgjv@wobbie.heliotrope.home>,
> mgjv@comdyn.com.au wrote:
> > Fine.. there are the examples of the contents of your file, but what
> > exactly do you want to do? What are you aiming for? What do the first,
> > third and tenth example need to become, for example?
[snip description]
> the path is just one level in, and the parent is the root directory,
> we want to place a zero in that spot of the array.
> For example:
> .\foo
> .\ppc603\delivery\release\static\Measurement\Sequence\libSBB@@
> .\ppc603\delivery\release\static\Measurement\Sequence\libSDD@@
> .\ppc603\delivery\release\static\Measurement\Sequence\libSSL@@
> .\ppc603\delivery\release\static\medmake_ppc@@
> .\vxworks603@@
>
> this would return:
> 0
> Sequence
> Sequence
> Sequence
> static
> 0
Ok, this example is something I can work with :) Your description
unfortunately still didn't help much. Maybe instead of using words
like 'root' and 'parent', which in the case of directories already
have a meaning, which is not the same as yours, you should use
something like level, but ok.
It would have also been nice if you had shown us some code, like what
have you tried already? But ok. Here goes nothing..
This is one way, using a regex.
#!/usr/local/bin/perl5.00502 -w
use strict;
while (<DATA>)
{
chomp;
m#\\?([^\\]+)\\[^\\]+$#;
my $path = ($1 eq '.') ? 0 : $1;
print "$path\n";
}
__DATA__
.\foo
.\ppc603\delivery\release\static\Measurement\Sequence\libSBB@@
.\ppc603\delivery\release\static\Measurement\Sequence\libSDD@@
.\ppc603\delivery\release\static\Measurement\Sequence\libSSL@@
.\ppc603\delivery\release\static\medmake_ppc@@
.\delivery\medmake_ppc@@
.\vxworks603@@
OUTPUT
0
Sequence
Sequence
Sequence
static
delivery
0
It could be shorter, It could contain more checks for errors. But it
should give you an idea how to go about it. It would have been a
little shorter if instead of a '0', a '.' would have been allowed :)
Martien
--
Martien Verbruggen |
Interactive Media Division | This matter is best disposed of from
Commercial Dynamics Pty. Ltd. | a great height, over water.
NSW, Australia |
------------------------------
Date: 26 Oct 1999 16:25:31 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Getting Parent directory from path!!!!!!!!!!!!!!!!!!!!!!
Message-Id: <3815c7eb_2@newsread3.dircon.co.uk>
krun@my-deja.com wrote:
> Hello, What we are looking for is a bit tricky. SUppose the path of a
> file is :
> .\ppc603\delivery\release\static\Measurement\Sequence\libSBB@@
> We need to get the parent of the path which is "Sequence". We need to
> hold the spot into an array so we can compare it with another array
> from a different file looking at the same spot becuase we are comparing
> directory structures of two diff. files. Now, our problem is that when
> we have a path with that looks like :
So what have you tried already and found not to work ...
/J\
--
"I thought homogenous culture was a kind of yogurt used to alleviate
thrush" - Ben Elton
------------------------------
Date: Tue, 26 Oct 1999 13:52:26 GMT
From: krun@my-deja.com
Subject: Re: Getting Parent directory from path!!!!!!!!!!!!!!!!!!!!!!
Message-Id: <7v4bmo$149$1@nnrp1.deja.com>
Hello, What we are looking for is a bit tricky. SUppose the path of a
file is :
.\ppc603\delivery\release\static\Measurement\Sequence\libSBB@@
We need to get the parent of the path which is "Sequence". We need to
hold the spot into an array so we can compare it with another array
from a different file looking at the same spot becuase we are comparing
directory structures of two diff. files. Now, our problem is that when
we have a path with that looks like :
.\vxworks69@@
or
.\ibrk@@
the path is just one level in, and the parent is the root directory,
we want to place a zero in that spot of the array.
For example:
.\foo
.\ppc603\delivery\release\static\Measurement\Sequence\libSBB@@
.\ppc603\delivery\release\static\Measurement\Sequence\libSDD@@
.\ppc603\delivery\release\static\Measurement\Sequence\libSSL@@
.\ppc603\delivery\release\static\medmake_ppc@@
.\vxworks603@@
this would return:
0
Sequence
Sequence
Sequence
static
0
Thank you in advance
In article <slrn813dqe.dii.mgjv@wobbie.heliotrope.home>,
mgjv@comdyn.com.au wrote:
> [Please, do not shout in posts to Usenet, especially not in the
subject
> line. It's rude]
>
> On Fri, 22 Oct 1999 20:58:27 GMT,
> krun@my-deja.com <krun@my-deja.com> wrote:
> > We have a file with a lot of paths. We are trying to get the parent
of
> > these path's into an array called @parent. If no parent exists in
the
> > case of ".\foo" a zero should be placed in that spot of the array
so we
> > know that no parent exist at that location.
>
> Ok... let me try to parse that. You have got a file, which you read
into
> an array. Each line of the file is a path on a DOS box.
>
> And now you lose me. 'We are trying to get the parent of these paths'
> and 'If no parent exists in the case of ".\foo"' simply make
absolutely
> no sense to me. A directory always has a parent, denoted by '..'. On
DOS
> I believe the only exception to that is the root directory on each
> drive, right? So.. The only time you don't have a parent is when it's
a
> root directory. But even with all that, your questions make no sense..
> (I don't know about Macs)
>
> >
> > Example of a few paths in the file:
>
> Fine.. there are the examples of the contents of your file, but what
> exactly do you want to do? What are you aiming for? What do the first,
> third and tenth example need to become, for example?
>
> More info.
>
> Martien
> --
> Martien Verbruggen |
> Interactive Media Division | Failure is not an option. It comes
> Commercial Dynamics Pty. Ltd. | bundled with your Microsoft product.
> NSW, Australia |
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 26 Oct 1999 17:14:46 +0200
From: Wolfgang Schmiesing <y0013515@tu-bs.de>
Subject: guestbook script error
Message-Id: <3815C566.4345@tu-bs.de>
I wrote a guestbook script which works most of the time but
when I repost the form data, the first two or three lines of
my guestbook/HTML-file are deleted. What can I do?
------------------------------
Date: Wed, 27 Oct 1999 10:08:47 -0500
From: Scott McGerik <scottlm@visi.com>
Subject: Re: guestbook script error
Message-Id: <3817157F.F6B30E3D@visi.com>
Abigail wrote:
> Wolfgang Schmiesing (y0013515@tu-bs.de) wrote on MMCCXLVII September
> MCMXCIII in <URL:news:3815C566.4345@tu-bs.de>:
> [] I wrote a guestbook script which works most of the time but
> [] when I repost the form data, the first two or three lines of
> [] my guestbook/HTML-file are deleted. What can I do?
>
> Put some irrelevant stuff in the first 2 or 3 lines; then it
> doesn't matter.
haha!
Scott McGerik
------------------------------
Date: 27 Oct 1999 07:29:22 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: guestbook script error
Message-Id: <slrn81ds06.bjj.abigail@alexandra.delanet.com>
Wolfgang Schmiesing (y0013515@tu-bs.de) wrote on MMCCXLVII September
MCMXCIII in <URL:news:3815C566.4345@tu-bs.de>:
[] I wrote a guestbook script which works most of the time but
[] when I repost the form data, the first two or three lines of
[] my guestbook/HTML-file are deleted. What can I do?
Put some irrelevant stuff in the first 2 or 3 lines; then it
doesn't matter.
Abigail
--
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Tue, 26 Oct 1999 14:44:40 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: guestbook script error
Message-Id: <Pine.GSO.4.10.9910261444170.29843-100000@user2.teleport.com>
On Tue, 26 Oct 1999, Wolfgang Schmiesing wrote:
> I wrote a guestbook script which works most of the time but
> when I repost the form data, the first two or three lines of
> my guestbook/HTML-file are deleted. What can I do?
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.
http://www.perl.com/CPAN/
http://www.cpan.org/
http://www.cpan.org/doc/FAQs/cgi/idiots-guide.html
http://www.cpan.org/doc/manual/html/pod/
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 26 Oct 1999 19:52:25 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: guestbook script error
Message-Id: <7v50pp$inu$1@gellyfish.btinternet.com>
On Tue, 26 Oct 1999 17:14:46 +0200 Wolfgang Schmiesing wrote:
> I wrote a guestbook script which works most of the time but
> when I repost the form data, the first two or three lines of
> my guestbook/HTML-file are deleted. What can I do?
Either :
A) Dont repost the form data.
or
B) Give us a sign.
Doris is on holiday and PSI::ESP doesnt work on the last tuesday of the
month..
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Tue, 26 Oct 1999 19:53:04 GMT
From: adm@ipat.com (Alan Mead)
Subject: help building Pg on Red Hat 6.0 Linux?
Message-Id: <381602e7.106583892@news.soltec.net>
Anyone get Pg from the pgsql_perl5-1.8.1 package to build on a stock
Red Hat 6.0 Linux system. It comes with PostgreSQL 6.4.2-3 and I have
all the RPMs installed (the "base", devel, and client).
Pg.xs is written like so:
#include "libpq-fe.h"
#include "libpq-int.h" /* need this for sizeof(PGresult) */
And I guess the "" syntax looks for the headers locally. They are in
/usr/include/pgsql but if I edit these two lines to look there, I get
other errors. I could copy the entire directory tree but it seems
like I'm missing the way to tell the compiler where to look. This is
probably a trival C question but, alas, I know next to none. You help
is very much appreciated!
-Alan
------------------------------
Date: Wed, 27 Oct 1999 17:10:06 GMT
From: andersjk@sol-invictus.org (kevin anderson)
Subject: help downloaded files appended to file, search for info..help...
Message-Id: <381731a6.546973486@news.isar.de>
Hi all,
i just need a pointer in the right direction!! the rest i should be
able to figure out...
we get these email leads so far my program logs into the pop3 server
on a sun machine and retrieves just the body and appends all messages
to file. this 'data' file has then for example 10 email bodies they
all have the same format for example
name: joe blow
company: blah blah inc.
and so on about seven 'fields' i would like to have the name, company
etc. formated in another file like comma delimited so it reads the
'data' file picks out 'name' 'company' and writes to data1 in a row
joe blow, blah blah inc.,user@host.com
mr.smith,ork ork inc, user@host.com
till the whole 'data' file is read then extracted to data1
i see that while(<>) reads line by line etc...
i just need to see the path how to get there... then i can reverse
engineer, unless this is too complicated... i am a newbie...be
gentle...
thanks in advance,
kevin anderson...
------------------------------
Date: Wed, 27 Oct 1999 14:45:13 -0700
From: "David Christensen" <dchristensen@california.com>
Subject: Re: help downloaded files appended to file, search for info..help...
Message-Id: <38176eae$1_1@news5.newsfeeds.com>
kevin anderson wrote in message <381731a6.546973486@news.isar.de>...
>this 'data' file has then for example 10 email bodies they all have the
same format for example
>
>name: joe blow
>company: blah blah inc.
>
>and so on about seven 'fields' i would like to have the name, company
>etc. formated in another file like comma delimited so it reads the
>'data' file picks out 'name' 'company' and writes to data1 in a row
>
>joe blow, blah blah inc.,user@host.com
>mr.smith,ork ork inc, user@host.com
>
>till the whole 'data' file is read then extracted to data1
That's a great first program to write in Perl!
I'd suggest you get your hands on the right "Learning Perl" book (Llama
for Un*x, Gecko for Win), starting reading, and especially doing the
exercises. After reading about arrays and hashes, you'll start getting
ideas for storage. After reading about string matching/ regular
expressions, you'll know how to pick out the fields. I'll bet you will
be able to write the above program before you're half way through the
book. :-)
--
David Christensen
dchristensen@california.com
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Wed, 27 Oct 1999 23:08:04 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: help downloaded files appended to file, search for info..help...
Message-Id: <oBLR3.75$z73.2028@nsw.nnrp.telstra.net>
On Wed, 27 Oct 1999 17:10:06 GMT,
kevin anderson <andersjk@sol-invictus.org> wrote:
> Hi all,
>
> i just need a pointer in the right direction!! the rest i should be
> able to figure out...
>
> we get these email leads so far my program logs into the pop3 server
> on a sun machine and retrieves just the body and appends all messages
> to file. this 'data' file has then for example 10 email bodies they
> all have the same format for example
>
> name: joe blow
> company: blah blah inc.
>
> and so on about seven 'fields' i would like to have the name, company
> etc. formated in another file like comma delimited so it reads the
> 'data' file picks out 'name' 'company' and writes to data1 in a row
>
> joe blow, blah blah inc.,user@host.com
> mr.smith,ork ork inc, user@host.com
>
> till the whole 'data' file is read then extracted to data1
>
> i see that while(<>) reads line by line etc...
You could use that, and you could parse these lines yourself, but you
might be able to save yourself a lot of trouble by getting one of the
modules from CPAN. There are quite a few there that deal with mail,
and I know for a fact that one of them specifically gives you access
to the headers.
# lynx http://www.cpan.org/modules/
[The module list]
[19) Mail and Usenet news]
I believe Mail::Field is the one you want. It comes in a package
called MailTools by Graham Barr, which contains many good Mail
goodies.
Martien
--
Martien Verbruggen |
Interactive Media Division | For heaven's sake, don't TRY to be
Commercial Dynamics Pty. Ltd. | cynical. It's perfectly easy to be
NSW, Australia | cynical.
------------------------------
Date: Tue, 26 Oct 1999 16:40:50 GMT
From: richardstands@my-deja.com
Subject: Help! Missing Cookies!
Message-Id: <7v4lii$92o$1@nnrp1.deja.com>
I have not been able to find a post concerning this anomaly, perhaps
because it is not one and will just prove my ignorance about Perl5 and
cookies.
I originally created a small script to set a cookie(FreeBSD, Apache,
IExplorer 4)when called using CGI::Cookie. After setting the cookie I
was easily able to find the file in my
\Winnt\profiles\administrator\cookies dir. I then wanted to retest the
script so I deleted this particular cookie file and reran the script
but the cookie file never reappeared. The script gave no error so I
wrote a companion script that looks for the cookie and returns the data
from it. I figured it just wasn't being set anymore but lo and behold
the cookie is always set as the data returned is always correct.
Nonetheless I cannot find eveidence of this cookie anywhere on my local
hard drive and I have *looked* - checked all drives, checked all hidden
files, etc. Does anyone have any idea where this magical cookie data is
being stored and why another cookie.txt file is not being created for
it after the first one was bagged? Thanks a lot!
-Rich
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 27 Oct 1999 13:18:43 GMT
From: richardstands@my-deja.com
Subject: Re: Help! Missing Cookies!
Message-Id: <7v6u3g$sa0$1@nnrp1.deja.com>
In article <x7hfjeau0e.fsf@bert.dce.harvard.edu>,
James Peregrino <james_peregrino@harvard.edu> wrote:
> richardstands@my-deja.com writes:
>
> > I have not been able to find a post concerning this anomaly, perhaps
> > because it is not one and will just prove my ignorance about Perl5
and
> > cookies.
> >
> > I originally created a small script to set a cookie(FreeBSD, Apache,
> > IExplorer 4)when called using CGI::Cookie. After setting the cookie
I
> > was easily able to find the file in my
> > \Winnt\profiles\administrator\cookies dir. I then wanted to retest
the
> > script so I deleted this particular cookie file and reran the script
> > but the cookie file never reappeared.
>
> What's the expiration date of this cookie? If you provide no
> expiration time then the cookie good for the time the browser is
active and
> the browser is free just to keep the cookie in memory. (However IE4
might
> put every cookie to the hard disk and then delete the cookie when
exiting.
> I'm not sure. Betcha the behavior differs from version to version.)
>
> -James
>
> --
> James Peregrino
> Harvard Div. Continuing Education
>
Yup, adding the "-expires => '+n'" did the trick! And I *know* read
that chapter in the O'Reilly Mod Ref book too. Guess I'll get some
glasses :o) Thanks!
-Rich
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 26 Oct 1999 13:53:21 -0400
From: James Peregrino <james_peregrino@harvard.edu>
Subject: Re: Help! Missing Cookies!
Message-Id: <x7hfjeau0e.fsf@bert.dce.harvard.edu>
richardstands@my-deja.com writes:
> I have not been able to find a post concerning this anomaly, perhaps
> because it is not one and will just prove my ignorance about Perl5 and
> cookies.
>
> I originally created a small script to set a cookie(FreeBSD, Apache,
> IExplorer 4)when called using CGI::Cookie. After setting the cookie I
> was easily able to find the file in my
> \Winnt\profiles\administrator\cookies dir. I then wanted to retest the
> script so I deleted this particular cookie file and reran the script
> but the cookie file never reappeared.
What's the expiration date of this cookie? If you provide no
expiration time then the cookie good for the time the browser is active and
the browser is free just to keep the cookie in memory. (However IE4 might
put every cookie to the hard disk and then delete the cookie when exiting.
I'm not sure. Betcha the behavior differs from version to version.)
-James
--
James Peregrino
Harvard Div. Continuing Education
------------------------------
Date: Mon, 25 Oct 1999 14:45:25 -0700
From: "nick" <drostaman@hotmail.com>
Subject: HELP!!
Message-Id: <7v2j3c$a5v$1@oak.prod.itd.earthlink.net>
How would one go about getting the value name from the string below if you
did not know what you were looking for:
c:\ud\name\something
name will actually be a persons name and I must be able to read in the name
from a file path in a text file and then search the rest of the file for the
value. Any suggestions, and yes I've read the Perlfaq...
Thanks,
Nick
------------------------------
Date: Mon, 25 Oct 1999 16:20:43 -0700
From: "David Christensen" <dchristensen@california.com>
Subject: Re: HELP!!
Message-Id: <7v2nnm$bkc$1@pollux.dnai.com>
Nick:
> How would one go about getting the value name from the string
> below if you did not know what you were looking for:
>
> c:\ud\name\something
split() is your friend:
#! perl -w
use strict;
my $path = $ARGV[0];
my @pieces = split /\\/, $path;
my $name = $pieces[2];
print "$name\n";
Sample run:
C:\david\code\perl\foo>perl foo c:\ud\nick\something
nick
C:\david\code\perl\foo>perl foo c:\ud\david\something
david
--
David Christensen
dchristensen@california.com
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 1181
**************************************