[25303] in Perl-Users-Digest
Perl-Users Digest, Issue: 7548 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 21 18:05:54 2004
Date: Tue, 21 Dec 2004 15:05:06 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 21 Dec 2004 Volume: 10 Number: 7548
Today's topics:
Re: generating a session id ioneabu@yahoo.com
Re: generating a session id <1usa@llenroc.ude.invalid>
Re: generating a session id ioneabu@yahoo.com
Re: generating a session id ioneabu@yahoo.com
Re: Good practice to detect empty string? <abigail@abigail.nl>
Re: HowTo tell if from cmd_line || httpd <abigail@abigail.nl>
Re: Is zero even or odd? <see@sig.com>
Re: Is zero even or odd? <vlfiscus.xyz@mcn.net>
Re: Is zero even or odd? <spikeywan@bigfoot.com>
Re: Is zero even or odd? <t-tammaru@c0mca$t.net>
Re: Is zero even or odd? <matternc@comcast.net>
Re: Is zero even or odd? <jwkenne@attglobal.net>
Re: Is zero even or odd? (IFR LIT MET\)
Re: Is zero even or odd? <nospam@nandj.freeserve.co.uk>
Re: Newbie question <x3v0-usenet@yahoo.com>
problem installing GD-2.19 <ax178@wp.pl>
Re: problem installing GD-2.19 <x3v0-usenet@yahoo.com>
Re: Read mail file? (Linux) <abigail@abigail.nl>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 21 Dec 2004 10:14:20 -0800
From: ioneabu@yahoo.com
Subject: Re: generating a session id
Message-Id: <1103652860.452237.201220@f14g2000cwb.googlegroups.com>
I implemented the session id idea into my present code, keeping the
interface of my subs the same but only changing the implementation and
it worked perfectly. The calling code has no idea it is no longer
dealing with Apache:Session:MySQL. It can request a new session,
validate a current session, or delete an ended session. The MySQL
sessions table still looks the same, just that the a_session column is
unused (I wasn't really using it anyway). The id that I am generating
with:
sub make_sess_id
{
my $count=32;
my @array=('a' .. 'z', '0' .. '9'); #thanks for help here!
my $out;
for (my $i=0;$i<$count;$i++) {$out .= $array[rand(36)]}
return $out;
}
appear identical to the ones Apache:Session:MySQL was creating. I
will look at their implementation later when I get a chance.
wana
------------------------------
Date: 21 Dec 2004 20:57:45 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: generating a session id
Message-Id: <Xns95C6A2623165Aasu1cornelledu@132.236.56.8>
ioneabu@yahoo.com wrote in news:1103652860.452237.201220
@f14g2000cwb.googlegroups.com:
> I implemented the session id idea into my present code, keeping the
> interface of my subs the same but only changing the implementation and
> it worked perfectly.
I guess you entertain a more interesting notion of perfect.
> sub make_sess_id
> {
> my $count=32;
> my @array=('a' .. 'z', '0' .. '9'); #thanks for help here!
> my $out;
> for (my $i=0;$i<$count;$i++) {$out .= $array[rand(36)]}
> return $out;
> }
Indent you code!
> appear identical to the ones Apache:Session:MySQL was creating.
As we all know, appearances can be deceptive.
> I will look at their implementation later when I get a chance.
In the mean time, pray a lot.
--
A. Sinan Unur
1usa@llenroc.ude.invalid
(remove '.invalid' and reverse each component for email address)
------------------------------
Date: 21 Dec 2004 14:38:34 -0800
From: ioneabu@yahoo.com
Subject: Re: generating a session id
Message-Id: <1103668714.136707.223230@f14g2000cwb.googlegroups.com>
#!/usr/bin/perl
use strict;
use warnings;
use Digest::MD5;
#Their way
my $length = 32;
print substr(Digest::MD5::md5_hex(Digest::MD5::md5_hex(time(). {}.
rand(). $$)), 0, $length),"\n";
#my way
my @array = ('a' .. 'z', '0' .. '9');
my $out;
for (my $i=0;$i<$length;$i++) {$out .= $array[rand(36)]}
print "$out\n";
The first method is from Apache:Session:MySQL. Why is it any better
than my version for generating a random 32 character string? If it's a
big difference in 'randomness' I could just use their way to generate
my ids. I still don't need the whole implementation of
Apache:Session:MySQL for my current purposes. If their is no
significant difference in the secure randomness of the generated
strings, I prefer not to use extra modules unnecessarily.
Thanks!
wana
------------------------------
Date: 21 Dec 2004 14:41:26 -0800
From: ioneabu@yahoo.com
Subject: Re: generating a session id
Message-Id: <1103668886.899769.238400@f14g2000cwb.googlegroups.com>
And they're not even using the whole alphabet! Just hex. I use a-z
and 0-9 :-)
------------------------------
Date: 21 Dec 2004 21:50:41 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Good practice to detect empty string?
Message-Id: <slrncsh6lh.non.abigail@alexandra.abigail.nl>
Keith Keller (kkeller-usenet@wombat.san-francisco.ca.us) wrote on
MMMMCXXX September MCMXCIII in <URL:news:vq7k92xjqo.ln2@goaway.wombat.san-francisco.ca.us>:
== On 2004-12-21, ipellew@pipemedia.co.uk <ipellew@pipemedia.co.uk> wrote:
== >
== > Pls advise the perlophiliacs method of deciding a string is empty.
== >
== > I am using
== > if ( $@ || $c_var eq "" ) {
== > but constantly read `eq` is expensive.
==
== ...and using $@ in the absence of an eval is silly.
==
== Is there something wrong with
==
== if ($c_var)
Well, if you are going to comment about using $@ in the absence of
an eval, using 'if ($c_var)' is equally silly. There's no assignment
to $c_var, so it's false, and the then part of the if is never executed
anyway, so we could simple remove the entire then part.
Or perhaps we could say the then part isn't present, so the given
line won't compile, and hence, the program won't run. So we could
just replace the entire program with an empty file.
Or did you just assume the then part would be present in the real
code, and that there would be an assignment to $c_var as well?
If so, why couldn't assume there would be an eval statement?
== ? It's not exactly the same, but since you provide no context it's
== hard to know what you really need.
Why would you think the OP wants something else then "deciding a string
is empty". It's not a silly thing to do.
Abigail
--
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
"\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
"\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'
------------------------------
Date: 21 Dec 2004 22:02:59 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: HowTo tell if from cmd_line || httpd
Message-Id: <slrncsh7ci.non.abigail@alexandra.abigail.nl>
ipellew@pipemedia.co.uk (ipellew@pipemedia.co.uk) wrote on MMMMCXXX
September MCMXCIII in <URL:news:1103587542.071028.220550@c13g2000cwb.googlegroups.com>:
{} Hi all;
{}
{} Whats a sure fire way to tell I am executed from either httpd or
{} command line? At the moment, I decide on HTTP_USER_AGENT having a
{} value to say I am from httpd.
What are you looking for? A sure fire way, that works even if the
user tries to sabotage you? Or do you fully control the environment?
An environment variable works if it's an environment you control,
but it's entirely possible to set up (any) environment variable and
run a program from the command line.
{} This needs to work whatever the platform / server.
Abigail
--
print 74.117.115.116.32.97.110.111.116.104.101.114.
32.80.101.114.108.32.72.97.99.107.101.114.10;
------------------------------
Date: Tue, 21 Dec 2004 16:29:55 GMT
From: "Nicholas O. Lindan" <see@sig.com>
Subject: Re: Is zero even or odd?
Message-Id: <7cYxd.6011$Z47.424@newsread2.news.atl.earthlink.net>
"Steven Lord" <slord@mathworks.com> wrote in
> Just FYI, if you're performing arithmetic using the IEEE 754 standard, then
> n/0 for n not equal to ...
Ever hear the one about the Grandmother and blowing eggs?
IEEE passed a standard. Well, heck then, the issue is settled.
Lets all go home.
--
Nicholas O. Lindan, Cleveland, Ohio
Consulting Engineer: Electronics; Informatics; Photonics.
Remove spaces etc. to reply: n o lindan at net com dot com
psst.. want to buy an f-stop timer? nolindan.com/da/fstop/
------------------------------
Date: Tue, 21 Dec 2004 17:13:53 GMT
From: "Vince Fiscus, KB7ADL" <vlfiscus.xyz@mcn.net>
Subject: Re: Is zero even or odd?
Message-Id: <lRYxd.5995$9j5.872@newsread3.news.pas.earthlink.net>
Gactimus <gactimus@xrs.net> wrote in news:10sdnunotbnere2@corp.supernews.com:
> I know 0 is neither negative or positive but what about odd/even? I think
> it's even.
>
> Odd numbers start at 1 and go every other number 1,3,5,7;1,-1,-3,-5,-7
> Even starts at 2 and go every other number 2,4,6,8;2,0,-2,-4,-6,-8
An even number plus an even number equals an even number.
An odd number plus an even number equals an odd number.
An odd number plus an odd number equals an even number.
0 + 1 = odd number
0 + 2 = even number, 2 is not odd, so zero must be even.
KB7ADL
------------------------------
Date: Tue, 21 Dec 2004 16:56:40 -0000
From: "Richard S Beckett" <spikeywan@bigfoot.com>
Subject: Re: Is zero even or odd?
Message-Id: <cq9kpp$ajn$1@newshost.mot.com>
"BB" <BB@BB.BB> wrote
> There are black holes stealing odd socks out of
> my laundry.
No, that's me.
------------------------------
Date: Tue, 21 Dec 2004 12:44:24 -0500
From: "Tam/WB2TT" <t-tammaru@c0mca$t.net>
Subject: Re: Is zero even or odd?
Message-Id: <VK6dnSw-tLV__VXcRVn-jg@comcast.com>
<mmeron@cars3.uchicago.edu> wrote in message
news:tURxd.14$35.4459@news.uchicago.edu...
> In article <32p53dF3paevvU1@individual.net>, "Alfred Z. Newmane"
> <a.newmane.remove@eastcoastcz.com> writes:
>>Nicholas O. Lindan wrote:
>>> "John Sefton" <john@petcom.com> wrote
>>>
>>>> 0 can't be divided by itself,
>>>
>>> Sure it can: 0 / 0 = 0 * (1 / 0) = 0 * infinity = 1
>>>
>>> It works if the only three numbers in the universe are
>>> 0, 1, and infinity -- A number system that seems very
>>> suited to usenet.
>>
>>Except for the fact that: 0 / 0 = undefined
>>
>>Or actually more correct: n / 0 = undefined
>>
> The two are not the same.
>
> The definition of the ratio a/b is
>
> a/b = r iff b*r = a
>
> for the case of n/0 there is no r such that r*0 = n (follows from the
> definition of zero. Therefore n/0 (for non zero n) *does not exist*.
>
> On the other hand, for 0/0, every r qualifies since for every r, r*0 =
> 0 (the definition of zero, again). Therefore, 0/0 is truly undefined,
> in the sense that it is impossible to *uniquely* assign a value to the
> ratio r.
>
> Mati Meron | "When you argue with a fool,
> meron@cars.uchicago.edu | chances are he is doing just the same"
It depends on how you get there, [sin(x)]/x is certainly defined for all
values of x including 0 and infinity.
Tam
------------------------------
Date: Tue, 21 Dec 2004 13:34:57 -0500
From: Chris Mattern <matternc@comcast.net>
Subject: Re: Is zero even or odd?
Message-Id: <VcqdnSLtcP9M8VXcRVn-jw@comcast.com>
Tam/WB2TT wrote:
>
> It depends on how you get there, [sin(x)]/x is certainly defined for all
> values of x including 0 and infinity.
>
> Tam
No, it most certainly is *not*. [sin(x)]/x for x=0 is
0/0 and is undefined. The *limit as x approaches 0* of
[sin(x)]/x is 1, but that's not even vaguely the same
thing. The difference is huge.
--
Christopher Mattern
"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"
------------------------------
Date: Tue, 21 Dec 2004 14:23:20 -0500
From: "John W. Kennedy" <jwkenne@attglobal.net>
Subject: Re: Is zero even or odd?
Message-Id: <CQ_xd.8743$Gy.2564@fe12.lga>
Alfred Z. Newmane wrote:
> Thats becuase, when translated to reality, that statement becomes (0)^2
> = 0, because 0 has no sign. I really wish people would stop trying to
> spread the false hood that0 actually has a sign.
In the days before IEEE format, at least one FORTRAN was designed to
read, write, and test equality on -0.0, so that it could be used as NaN
(usually for "datum missing"), but I grant that having a real NaN is
ever so much nicer.
--
John W. Kennedy
"I want everybody to be smart. As smart as they can be. A world of
ignorant people is too dangerous to live in."
-- Garson Kanin. "Born Yesterday"
------------------------------
Date: Tue, 21 Dec 2004 14:28:08 -0500
From: "Richards Noah \(IFR LIT MET\)" <Noah.Richards@infineon.com>
Subject: Re: Is zero even or odd?
Message-Id: <cq9tga$odv$1@athen03.muc.infineon.com>
"Fred Bloggs" <nospam@nospam.com> wrote in message
news:41C7FD4F.3060902@nospam.com...
>
>
> David Kastrup wrote:
> > Fred Bloggs <nospam@nospam.com> writes:
> >
> >
> >>Alfred Z. Newmane wrote:
> >>
> >>>Nicholas O. Lindan wrote:
> >>>
> >>>
> >>>>"John Sefton" <john@petcom.com> wrote
> >>>>
> >>>>
> >>>>
> >>>>>0 can't be divided by itself,
> >>>>
> >>>>Sure it can: 0 / 0 = 0 * (1 / 0) = 0 * infinity = 1
> >>>>
> >>>>It works if the only three numbers in the universe are
> >>>>0, 1, and infinity -- A number system that seems very
> >>>>suited to usenet.
> >>>
> >>>Except for the fact that: 0 / 0 = undefined
> >>>Or actually more correct: n / 0 = undefined
> >>>
> >>
> >>0/0={ SET OF ALL INTEGERS }
> >>
> >>n/0= NULL SET for n<>0
> >>
> >>It is very well-defined.
> >
> >
> > So { SET OF ALL INTEGERS } = 0/0 = (0+0)/0 = (2*0)/0 = 2*(0/0)
> > = 2* {SET OF ALL INTEGERS } = {SET OF ALL EVEN INTEGERS}?
> >
> > Odd.
> >
>
> Wrong- where do you get off saying (2*0)/0= 2*(0/0) ?
>
How about the following:
(2 * 0) / 0 = (2 * 0) * (1 / 0 ) <- Definition of division as the
inverse of multiplication
(2 * 0) * (1 / 0) = 2 * (0 * (1 / 0)) <- Associative property of
multiplication
2 * (0 * (1 / 0)) = 2 * (0 / (0 / 1)) <- Definition of division
2 * (0 / (0 / 1)) = 2 * (0 / 0) <- 0 / 1 = 0
He was just leaving out some unnecessary steps, being as that they are
rather common and generally just understood.
Of course, this is following the same strange assumptions of the fact that 0
/ 0 is a defined operation, or that 0 has an inverse.
------------------------------
Date: Tue, 21 Dec 2004 20:36:30 +0000
From: Nick Atty <nospam@nandj.freeserve.co.uk>
Subject: Re: Is zero even or odd?
Message-Id: <h92hs05a3c534br1d3qk92vr36ge435uef@4ax.com>
[huge cross-posting continued remorselessly - fu to rec.puzzles 'cos
that's where I read it]
On Mon, 20 Dec 2004 15:36:15 GMT, "Nicholas O. Lindan" <see@sig.com>
wrote:
>"John Sefton" <john@petcom.com> wrote
>
>> 0 can't be divided by itself,
>
>Sure it can: 0 / 0 = 0 * (1 / 0) = 0 * infinity = 1
>
>It works if the only three numbers in the universe are
>0, 1, and infinity -- A number system that seems very
>suited to usenet.
Someone, and I can't remember who, once said something to the effect
that all computer programs should work like this. They should allow no
instances of something, one instance of it, or any number at all.
It's not a bad idea - think how many bugs are a result of programs
dealing with far more things than the programmer ever expected.
And let's not, please, have the endless(!) debate about whether infinity
means anything to computers, whether C is a turing complete language
etc.
Please.
--
On-line canal route planner: http://www.canalplan.org.uk
(Waterways World site of the month, April 2001)
------------------------------
Date: Tue, 21 Dec 2004 16:38:10 -0500
From: Ken <x3v0-usenet@yahoo.com>
Subject: Re: Newbie question
Message-Id: <6J0yd.11934$FE.11839@fe37.usenetserver.com>
Dave Weaver wrote:
> On Mon, 20 Dec 2004 09:37:47 -0500, Ken <x3v0-usenet@yahoo.com> wrote:
>
>> Try this instead:
>>
>> prepare();
>>
>> You can't call subroutines without the parentheses.
>
>
> Yes you can, as long as the sub has been defined before the call:
>
> [davew@localhost tmp] $ perl
> #!/usr/bin/perl
> use strict;
> use warnings;
>
> sub wotsit {
> print "here\n";
> }
>
> wotsit;
> __END__
> here
> [davew@localhost tmp] $
>
> Define the sub after the call, however, and it fails:
>
> [davew@localhost tmp] $ perl
> #!/usr/bin/perl
> use strict;
> use warnings;
>
> wotsit;
>
> sub wotsit {
> print "here\n";
> }
> __END__
> Bareword "wotsit" not allowed while "strict subs" in use at - line 5.
> Execution of - aborted due to compilation errors.
> [davew@localhost tmp] $
>
Cool I didn't know that. Still, probably not a good habit to get into.
- Ken
------------------------------
Date: Tue, 21 Dec 2004 21:10:28 +0100
From: vertigo <ax178@wp.pl>
Subject: problem installing GD-2.19
Message-Id: <cqa06s$scr$1@nemesis.news.tpi.pl>
Hello
I can not install GD-2.19.
I tried with gd-2.0.33 and perl 5.6.8:
#perl Makefile.PL
#make
and everything was fine, but:
#make test
PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/GD..........Can't load './blib/arch/auto/GD/GD.so' for module GD:
./blib/arch/auto/GD/GD.so: undefined symbol: gdFontGetGiant at
/usr/local/lib/perl5/5.8.6/i686-linux/DynaLoader.pm line 230.
at t/GD.t line 13
Compilation failed in require at t/GD.t line 13.
BEGIN failed--compilation aborted at t/GD.t line 13.
dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-10
Failed 10/10 tests, 0.00% okay
t/Polyline....Can't load '/root/log3/GD-2.19/blib/arch/auto/GD/GD.so'
for module GD: /root/log3/GD-2.19/blib/arch/auto/GD/GD.so: undefined
symbol: gdFontGetGiant at
/usr/local/lib/perl5/5.8.6/i686-linux/DynaLoader.pm line 230.
at /root/log3/GD-2.19/blib/lib/GD/Polyline.pm line 45
Compilation failed in require at
/root/log3/GD-2.19/blib/lib/GD/Polyline.pm line 45.
BEGIN failed--compilation aborted at
/root/log3/GD-2.19/blib/lib/GD/Polyline.pm line 45.
Compilation failed in require at t/Polyline.t line 10.
BEGIN failed--compilation aborted at t/Polyline.t line 10.
dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED test 1
Failed 1/1 tests, 0.00% okay
Failed 2/2 test scripts, 0.00% okay. 11/11 subtests failed, 0.00% okay.
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/GD.t 255 65280 10 19 190.00% 1-10
t/Polyline.t 255 65280 1 2 200.00% 1
make: *** [test_dynamic] Error 2
i tried on different versions of perl, libdg and GD but nothing helped.
When i installed gd-2.0.30 insted of 2.0.33 i received:
#perl Makefile.PL
#make
and everything was fine, but:
#make test
PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/GD..........Can't load './blib/arch/auto/GD/GD.so' for module GD:
./blib/arch/auto/GD/GD.so: undefined symbol: gdImageGifAnimAddPtr at
/usr/local/lib/perl5/5.8.6/i686-linux/DynaLoader.pm line 230.
at t/GD.t line 13
Compilation failed in require at t/GD.t line 13.
BEGIN failed--compilation aborted at t/GD.t line 13.
dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-10
Failed 10/10 tests, 0.00% okay
t/Polyline....Can't load '/root/log3/GD-2.19/blib/arch/auto/GD/GD.so'
for module GD: /root/log3/GD-2.19/blib/arch/auto/GD/GD.so: undefined
symbol: gdImageGifAnimAddPtr at
/usr/local/lib/perl5/5.8.6/i686-linux/DynaLoader.pm line 230.
at /root/log3/GD-2.19/blib/lib/GD/Polyline.pm line 45
Compilation failed in require at
/root/log3/GD-2.19/blib/lib/GD/Polyline.pm line 45.
BEGIN failed--compilation aborted at
/root/log3/GD-2.19/blib/lib/GD/Polyline.pm line 45.
Compilation failed in require at t/Polyline.t line 10.
BEGIN failed--compilation aborted at t/Polyline.t line 10.
dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED test 1
Failed 1/1 tests, 0.00% okay
Failed 2/2 test scripts, 0.00% okay. 11/11 subtests failed, 0.00% okay.
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/GD.t 255 65280 10 19 190.00% 1-10
t/Polyline.t 255 65280 1 2 200.00% 1
make: *** [test_dynamic] Error 2
Why ? Where's problem ?
Thanx
Michal
------------------------------
Date: Tue, 21 Dec 2004 16:28:50 -0500
From: Ken <x3v0-usenet@yahoo.com>
Subject: Re: problem installing GD-2.19
Message-Id: <nA0yd.11932$FE.8004@fe37.usenetserver.com>
vertigo wrote:
> Hello
>
> I can not install GD-2.19.
> I tried with gd-2.0.33 and perl 5.6.8:
> #perl Makefile.PL
> #make
>
> and everything was fine, but:
> #make test
>
<snipped out lots of errors>
I'm not sure what your problem is, but I can tell you what I did to
install GD which works perfectly (but only after many, many tries). I
documented all my steps but your mileage may vary. I did this on Red Hat
and Fedora; I'm not sure what OS you are using.
First of all, I made sure I installed the latest versions of libpng,
jpeg libs, freetype2, and gd (in that order). I then installed GD.pm. I
used the default installation directories for everything (GD doesn't
seem to like custom paths). Here's how I did it:
add the lib path (Red Hat/Fedora specific I think)
----------------
add /usr/local/lib to /etc/ld.so.conf
run ldconfig -v
install libpng
--------------
cp over scripts/makefile.linux to ../makefile
make && make install
install jpeg libs
-----------------
./configure --enable-shared
make && make install
install freetype2
-----------------
./configure
make && make install
install gd
----------
./configure --enable-shared
make && make install
install GD.pm
-------------
LD_LIBRARY_PATH="/usr/local/lib"
export LD_LIBRARY_PATH
perl Makefile.PL
make && make test && make install
------------------------------
Date: 21 Dec 2004 22:12:44 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Read mail file? (Linux)
Message-Id: <slrncsh7us.non.abigail@alexandra.abigail.nl>
Alfred Z. Newmane (a.newmane.remove@eastcoastcz.com) wrote on MMMMCXXIX
September MCMXCIII in <URL:news:32oujoF3olkqnU1@individual.net>:
** Joe Smith wrote:
** > David Efflandt wrote:
** >> On Tue, 14 Dec 2004 10:04:17 -0800, Crom <xxxx@yyyy.zzzz> wrote:
** >>
** >>> How can I parse my mail spool file? Like in /var/spool/mail (and I
** >>> think the mailbox file in my home dir follows the same format.)
** >>
** >>
** >> In the main spool file any line that begins with "From " (From
** >> followed by a space, which as a regex would be /^From / ) marks the
** >> start of the next message. Not sure if From is always capitalized.
** >> This is not to be confused with "From:" (w/colon) which is within
** >> headers, if present.
** >
** > Other than the first line of the file, the delimiter is "\n\nFrom ".
** > The blank line before "^From " is required. It is always capitalized.
**
** But it can stil show up in the message body text can it not? If all it
** is doing is checking for what you described above, it seems it could
** easily be broken by putting that in the message body text:
**
** ---- MSG BODY BEGIN
**
**
** ^From
**
**
** ----- MSN BODY END
**
** Do mail handlers (ie sendmail) it take any actualy to (temporarly)
** handle such cases?
Yup. Such lines are typically stored as '>From' in the mailbox.
Abigail
--
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 7548
***************************************