[25581] in Perl-Users-Digest
Perl-Users Digest, Issue: 7825 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 24 18:05:50 2005
Date: Thu, 24 Feb 2005 15:05:22 -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 Thu, 24 Feb 2005 Volume: 10 Number: 7825
Today's topics:
Re: [perl-python] exercise: partition a list by equival <ptmcg@austin.rr.com>
Re: BerkeleyDB locking question <Paul.Marquess@btinternet.com>
Re: Bizarre precedence quirk (bug?) <jkrugman345@yahbitoo.com>
Re: CPAN problem <xrsr@rogerware.com>
Re: CPAN problem (Anno Siegel)
Re: cperl-mode and emacs-21.4 brocken? <rh62121@yahoo.com>
Division/math bug in perl? <snail@localhost.com>
Re: Division/math bug in perl? <darkon.tdo@gmail.com>
Re: Division/math bug in perl? <1usa@llenroc.ude.invalid>
Re: Division/math bug in perl? <matternc@comcast.net>
Re: Division/math bug in perl? <stampes@xilinx.com>
Re: Division/math bug in perl? (Anno Siegel)
Re: Division/math bug in perl? <notvalid@email.com>
Re: Division/math bug in perl? <1usa@llenroc.ude.invalid>
Re: Division/math bug in perl? <a.newmane.remove@eastcoastcz.com>
Re: Division/math bug in perl? <flavell@ph.gla.ac.uk>
Re: Division/math bug in perl? <snail@localhost.com>
Re: Division/math bug in perl? <notvalid@email.com>
Re: Division/math bug in perl? <snail@localhost.com>
Having Trouble Recursing a Function <die@spammer.die>
Re: How to generate random emails? <mark.clements@kcl.ac.uk>
Re: How to handle " use module qw/abc/ " in the module <eric-amick@comcast.net>
Re: How to tell if a subroutine arg is a constant <jonny@windmillwalton.demon.co.uk>
Re: How to tell if a subroutine arg is a constant <notvalid@email.com>
Re: Intercepting data flow between 2 apps <hackeras@gmail.com>
Re: Intercepting data flow between 2 apps <1usa@llenroc.ude.invalid>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 24 Feb 2005 13:43:12 -0800
From: "Paul McGuire" <ptmcg@austin.rr.com>
Subject: Re: [perl-python] exercise: partition a list by equivalence
Message-Id: <1109281392.068212.11420@f14g2000cwb.googlegroups.com>
A slightly better version, only walks the set of cumulative list of
sets once per pairing.
-- Paul
. import sets
.
. input = [[1, 2], [3, 4], [2, 3], [4, 5]]
. input = [[1, 2], [3, 4], [4, 5]]
. input = [[1, 2],[2,1], [3, 4], [4, 5],[2,2],[2,3],[6,6]]
.
.def merge(pairings):
. ret = []
. for a,b in pairings:
. aset = None
. bset = None
. for s in ret:
. if not aset and a in s:
. aset = s
. if not bset and b in s:
. bset = s
. if aset and bset:
. break
. else:
. if aset:
. aset.add(b)
. elif bset:
. bset.add(a)
. else:
. ret.append(sets.Set([a,b]))
. continue
. if aset is not bset:
. ret.remove(aset)
. ret.remove(bset)
. ret.append(aset.union(bset))
.
. return [list(s) for s in ret]
.
.print merge(input)
------------------------------
Date: Thu, 24 Feb 2005 21:40:29 -0000
From: "Paul Marquess" <Paul.Marquess@btinternet.com>
Subject: Re: BerkeleyDB locking question
Message-Id: <386vufF5kehhoU1@individual.net>
"Dan Wilga" <dwilga-MUNGE@mtholyoke.edu> wrote in message
news:dwilga-MUNGE-C19577.12012324022005@nap.mtholyoke.edu...
> In article <F4qdnVz0qfBRBIDfRVnyiA@giganews.com>,
> "Mark" <admin@asarian-host.net> wrote:
>
> > -rw------- 1 nobody nobody 8192 Feb 24 09:54 __db.001
> > -rw------- 1 nobody nobody 1318912 Feb 24 09:54 __db.002
> > -rw------- 1 nobody nobody 368640 Feb 24 09:54 __db.003
> > -rw------- 1 nobody nobody 49152 Feb 24 09:54 whitelist
> >
> > The whitelist db only has 10 or so entries in it (for test only, of
> > course). Why the huge overhead? "__db.002" almost seems to suggest it
>
> I'm sure Paul or someone else knows the exact purpose of each of these
> files off the top of his head, but I do know they are all necessary,
> mostly for locking. These three don't usually increase in size.
> Different env creation options produce differently-numbered env files.
>
> In general, you shouldn't delete these files unless you find that the DB
> needs to be re-created from scratch, is corrupt, or a process grabbed a
> lock and didn't properly release it. So you really only get a
> performance hit the first time, when the files are actually created.
Nice summary Dan. The only thing I would add is to make sure that these
"environment" files must be stored on a local disk. Berkeley DB locking
doesn't work on network drives.
Paul
------------------------------
Date: Thu, 24 Feb 2005 19:05:22 +0000 (UTC)
From: J Krugman <jkrugman345@yahbitoo.com>
Subject: Re: Bizarre precedence quirk (bug?)
Message-Id: <cvl8hi$5dl$1@reader2.panix.com>
*blush*
Thanks for cluebricks.
jill
--
To s&e^n]d me m~a}i]l r%e*m?o\v[e bit from my a|d)d:r{e:s]s.
------------------------------
Date: Thu, 24 Feb 2005 20:39:15 GMT
From: roger <xrsr@rogerware.com>
Subject: Re: CPAN problem
Message-Id: <Xns960780C49D66Drsrrogerwarecom@207.225.159.8>
Robert Sedlacek <phaylon@dunkelheit.at> wrote in
news:pan.2005.02.24.18.13.35.591988@dunkelheit.at:
> roger wrote:
>
>> Can anyone help?
>
> Don't you have any mirrors specified for your cpan?
>
Thanks for replying.
I have added ftp://ftp.mednor.net/pub/mirrors/CPAN/
as a mirror, but it makes no difference.
And like I say, the files were downloaded and now reside
in my current directory.
------------------------------
Date: 24 Feb 2005 21:37:39 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: CPAN problem
Message-Id: <cvlhf3$dr$2@mamenchi.zrz.TU-Berlin.DE>
roger <xrsr@rogerware.com> wrote in comp.lang.perl.misc:
> Robert Sedlacek <phaylon@dunkelheit.at> wrote in
> news:pan.2005.02.24.18.13.35.591988@dunkelheit.at:
>
> > roger wrote:
> >
> >> Can anyone help?
> >
> > Don't you have any mirrors specified for your cpan?
> >
>
> Thanks for replying.
>
> I have added ftp://ftp.mednor.net/pub/mirrors/CPAN/
> as a mirror, but it makes no difference.
>
> And like I say, the files were downloaded and now reside
> in my current directory.
That isn't where they ought to be. You probably have no .cpan directory
configured.
Anno
------------------------------
Date: Thu, 24 Feb 2005 20:39:02 +0100
From: "Radomir Hejl" <rh62121@yahoo.com>
Subject: Re: cperl-mode and emacs-21.4 brocken?
Message-Id: <cvlah0$ad5$1@ns.felk.cvut.cz>
"Mike Dowling" <mike53@moocow.tu-bs.de> píše v diskusním příspěvku
news:slrnd1bmnm.q7.mike53@moocow.localhost...
>I had no problems with cperl-mode with emacs-21.3.
> With emacs-21.4, it still works, but only if started manually (M-x
> cperl-mode). Starting automaticall with
>
> (autoload 'perl-mode "cperl-mode" "alternate mode for editing Perl
> programs" t)
>
> in the .emacs file fails. Instead, I get the message:
>
> File mode specification error: (error "Autoloading failed to define
> function perl-mode")
>
> Any clues, anybody?
>
> Cheers,
> M. Dowling
>
I installed emacs 21.4.2 on solaris and was surprised to have only
cperl-mode 4.32 version.
So I replaced it with 5.0 version from
http://math.berkeley.edu/~ilya/software/emacs/
and it works seamlessly. Most annoying thing for me was ignoring \(a,b,..)
syntax which I suppose was fixed in 4.35.
In .emacs I have
(defalias 'perl-mode 'cperl-mode)
(setq cperl-syntaxify-by-font-lock t)
Radek
------------------------------
Date: Thu, 24 Feb 2005 12:46:47 -0800
From: "Snail" <snail@localhost.com>
Subject: Division/math bug in perl?
Message-Id: <cvleei$on4$1@news.astound.net>
Why is this:
$ perl -e 'print (int (-2.6), "\n")'
-2
Shouldn't it be -3? I thought converting from float to int is supposed
to give the integer part, which is -3, and not round towards zero, as it
seems to be doing, resulting in -2? For that matter, why does c/c++ do
this too?
Any hand calculator I've tried gives -3 for int (-2.6), like a texas
instruments graphing calc.
To it's credit, perl correctly does mod func correctly:
$ perl -e 'print (-13 % 5, "\n")'
2
Where as in c/c++ you get -3, which is mathematically incorrect. (Any
hand calculator I've tried gives 2 for the above operation.)
------------------------------
Date: Thu, 24 Feb 2005 21:05:44 -0000
From: darkon <darkon.tdo@gmail.com>
Subject: Re: Division/math bug in perl?
Message-Id: <Xns9607A3BB75C8Cdkwwashere@216.168.3.30>
Snail <snail@localhost.com> wrote:
> Why is this:
>
> $ perl -e 'print (int (-2.6), "\n")'
> -2
>
> Shouldn't it be -3? I thought converting from float to int is
int() isn't really converting, it's just returning the integer part
of the number. See the docs.
> supposed to give the integer part, which is -3, and not round
But the integer part of -2.6 is -2, not -3.
> towards zero, as it seems to be doing, resulting in -2? For that
> matter, why does c/c++ do this too?
I don't know about c/c++, but this behaviour is explicitly documented
for Perl's int():
<quote>
int EXPR
int
Returns the integer portion of EXPR. If EXPR is omitted, uses
$_. You should not use this function for rounding: one because
it truncates towards 0, and two because machine representations
of floating point numbers can sometimes produce counterintuitive
results.
</quote>
------------------------------
Date: Thu, 24 Feb 2005 21:16:41 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Division/math bug in perl?
Message-Id: <Xns9607A597AB70asu1cornelledu@127.0.0.1>
"Snail" <snail@localhost.com> wrote in news:cvleei$on4$1@news.astound.net:
> Subject: Division/math bug in perl?
Might arrogant coming from someone who is unable to read and understand
the documentation:
> Why is this:
>
> $ perl -e 'print (int (-2.6), "\n")'
> -2
C:\> perldoc -f int
int EXPR
int Returns the integer portion of EXPR. If EXPR is omitted, uses
$_. You should not use this function for rounding: one because
it truncates towards 0, and two because machine
representations of floating point numbers can sometimes
produce counterintuitive results. For example,
"int(-6.725/0.025)" produces -268 ...
Sinan
------------------------------
Date: Thu, 24 Feb 2005 16:18:54 -0500
From: Chris Mattern <matternc@comcast.net>
Subject: Re: Division/math bug in perl?
Message-Id: <PYydnXUIXMUj2YPfRVn-iA@comcast.com>
Snail wrote:
> Why is this:
>
> $ perl -e 'print (int (-2.6), "\n")'
> -2
>
> Shouldn't it be -3? I thought converting from float to int is supposed
> to give the integer part, which is -3,
Er, huh? >>-2<<.6. The integer part of that sure looks like -2 to me.
^^
> and not round towards zero, as it
> seems to be doing, resulting in -2? For that matter, why does c/c++ do
> this too?
>
> Any hand calculator I've tried gives -3 for int (-2.6), like a texas
> instruments graphing calc.
>
> To it's credit, perl correctly does mod func correctly:
>
> $ perl -e 'print (-13 % 5, "\n")'
> 2
>
> Where as in c/c++ you get -3, which is mathematically incorrect. (Any
> hand calculator I've tried gives 2 for the above operation.)
--
Christopher Mattern
"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"
------------------------------
Date: Thu, 24 Feb 2005 14:14:29 -0700
From: Jeff Stampes <stampes@xilinx.com>
Subject: Re: Division/math bug in perl?
Message-Id: <cvlg3l$e8g2@xco-news.xilinx.com>
Snail wrote:
> Why is this:
>
> $ perl -e 'print (int (-2.6), "\n")'
> -2
Because the docs say this:
stampes@flux[15] stampes > perldoc -f int
int EXPR
int Returns the integer portion of EXPR. If EXPR is omitted, uses
$_. You should not use this function for rounding: one because
it truncates towards 0, and two because machine representations
of floating point numbers can sometimes produce counterintu-
itive results. For example, "int(-6.725/0.025)" produces -268
rather than the correct -269; that's because it's really more
like -268.99999999999994315658 instead. Usually, the
"sprintf", "printf", or the "POSIX::floor" and "POSIX::ceil"
functions will serve you better than will int().
------------------------------
Date: 24 Feb 2005 21:49:21 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Division/math bug in perl?
Message-Id: <cvli51$dr$3@mamenchi.zrz.TU-Berlin.DE>
Snail <snail@localhost.com> wrote in comp.lang.perl.misc:
> To it's credit, perl correctly does mod func correctly:
>
> $ perl -e 'print (-13 % 5, "\n")'
> 2
>
> Where as in c/c++ you get -3, which is mathematically incorrect. (Any
There is no universal definition of the modulo operation for negative
(or zero) operands. Mathematicians (and implementors) are free to define
it in any way they please.
> hand calculator I've tried gives 2 for the above operation.)
Oh.
Anno
------------------------------
Date: Thu, 24 Feb 2005 21:50:47 GMT
From: Ala Qumsieh <notvalid@email.com>
Subject: Re: Division/math bug in perl?
Message-Id: <X_rTd.9055$Pz7.3342@newssvr13.news.prodigy.com>
A. Sinan Unur wrote:
> "Snail" <snail@localhost.com> wrote in news:cvleei$on4$1@news.astound.net:
>
>
>>Subject: Division/math bug in perl?
>
>
> Might arrogant coming from someone who is unable to read and understand
> the documentation:
I have read earlier posts from others pointing out that your comments
can be a bit harsh sometimes, and I agree with them. Your reply here
seems to me too condescending and uncalled for.
Personally, I value your contribution to clpmisc, but I urge you to
exercise more care before posting.
Just my two cents,
--Ala
------------------------------
Date: Thu, 24 Feb 2005 22:12:43 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Division/math bug in perl?
Message-Id: <Xns9607AF1734D9Basu1cornelledu@127.0.0.1>
Ala Qumsieh <notvalid@email.com> wrote in
news:X_rTd.9055$Pz7.3342@newssvr13.news.prodigy.com:
> A. Sinan Unur wrote:
>
>> "Snail" <snail@localhost.com> wrote in
>> news:cvleei$on4$1@news.astound.net:
>>
>>
>>>Subject: Division/math bug in perl?
>>
>>
>> Might arrogant coming from someone who is unable to read and
>> understand the documentation:
>
> I have read earlier posts from others pointing out that your comments
> can be a bit harsh sometimes, and I agree with them. Your reply here
> seems to me too condescending and uncalled for.
I don't know on this one. I think the "I don't need to read what a
function really does, if it does not do what I expect" attitude is quite
irritating. Incidentally, this is not a rare attitude. See Jill
Krugmann's post today.
On the other hand, I do value your opinion of me, so I'll have to figure
something out.
Thanks.
Sinan.
------------------------------
Date: Thu, 24 Feb 2005 14:36:13 -0800
From: "Alfred Z. Newmane" <a.newmane.remove@eastcoastcz.com>
Subject: Re: Division/math bug in perl?
Message-Id: <387379F5j8f0kU1@individual.net>
darkon wrote:
> Snail <snail@localhost.com> wrote:
>
>> Why is this:
>>
>> $ perl -e 'print (int (-2.6), "\n")'
>> -2
>>
>> Shouldn't it be -3? I thought converting from float to int is
>
> int() isn't really converting, it's just returning the integer part
> of the number. See the docs.
>
>> supposed to give the integer part, which is -3, and not round
>
> But the integer part of -2.6 is -2, not -3.
Not mathematically it isn't. I should be -3. Think of it like this. The
int part of 2.6 is 2, which is the /lowest/ number before the next
integer on the number line. Applying this to -2.6, the /lowest/ number
before the next integer is -3.
Maybe I can explain this better with an illustration:
Float: 1 .5 2 .5 3
2.6
| - - - - + - - - - | - - - - + * - - - |
Int: |-----------------| |------------------|
1 2
So in the other direction on the same number line:
Float: -3 .5 -2 .5 -1
-2.6
| - - - * + - - - - | - - - - + - - - - |
Int: |-----------------| |-----------------|
-3 -2
Or think of it like this: -2.6 is the same offset from -3 as +2.4 is
from 2. In other words, -2.6 and 2.4 are in the same realative postion
from the lower integral point. (Is there a better word for that?)
>> towards zero, as it seems to be doing, resulting in -2? For that
>> matter, why does c/c++ do this too?
>
> I don't know about c/c++, but this behaviour is explicitly documented
> for Perl's int():
Actually this behavior is present in C and C++. It's just the way
integer division works internally. It effectively rounds towards 0
instead of down to the lower end of the integer on the number line.
I've never quite understood why it's like it is, in C and C++, one of
side effects is the irregular (from a math perspective) behavior of the
modulus operator (%.)
I agree that it's nice that Perl's % operator does not suffer from this
mathematical short coming. ;-)
------------------------------
Date: Thu, 24 Feb 2005 22:30:21 +0000
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: Division/math bug in perl?
Message-Id: <Pine.LNX.4.61.0502242223130.29357@ppepc56.ph.gla.ac.uk>
On Thu, 24 Feb 2005, Ala Qumsieh wrote:
> A. Sinan Unur wrote:
>
> > "Snail" <snail@localhost.com> wrote in news:cvleei$on4$1@news.astound.net:
> >
> > > Subject: Division/math bug in perl?
> >
> > Might arrogant coming from someone who is unable to read and
> > understand the documentation:
Was that typo supposed to be "mite" or "mighty" ?
> I have read earlier posts from others pointing out that your
> comments can be a bit harsh sometimes, and I agree with them. Your
> reply here seems to me too condescending and uncalled for.
Well, I feel motivated to support A.S.U here. I find the tendency to
report every trivial problem as "bug in ..." - without apparent
reference to any documentation - to be extremely rude and
counterproductive. I really would like to see an emphatic form of
words as a response to dissuade people from doing that, given that it
brings the whole business of bug reporting into disrepute.
And, by the way, makes it that much harder for the occasions when a
/real/ bug has been discovered, since it has habituated developers
into the belief that "bug report" almost certainly means "idiot who
can't be bothered to check the documentation".
IMHO and YMMV
------------------------------
Date: Thu, 24 Feb 2005 14:49:37 -0800
From: "Snail" <snail@localhost.com>
Subject: Re: Division/math bug in perl?
Message-Id: <cvllkr$s7v$1@news.astound.net>
A. Sinan Unur wrote:
> Ala Qumsieh <notvalid@email.com> wrote in
> news:X_rTd.9055$Pz7.3342@newssvr13.news.prodigy.com:
>
>> A. Sinan Unur wrote:
>>
>>> "Snail" <snail@localhost.com> wrote in
>>> news:cvleei$on4$1@news.astound.net:
>>>
>>>
>>>> Subject: Division/math bug in perl?
>>>
>>>
>>> Might arrogant coming from someone who is unable to read and
>>> understand the documentation:
>>
>> I have read earlier posts from others pointing out that your comments
>> can be a bit harsh sometimes, and I agree with them. Your reply here
>> seems to me too condescending and uncalled for.
>
> I don't know on this one. I think the "I don't need to read what a
> function really does, if it does not do what I expect" attitude is
> quite irritating. Incidentally, this is not a rare attitude. See Jill
> Krugmann's post today.
I think I was a little missleading then, and I'm sorry. I knew that int
does what it does. What I was really getting at was why laguages like
Perl, c, c++, etc, do this sort of division in the first place?
I merely posted out of curiosity, to make a healthy discussion and learn
something I didn't know about this subject.
I also remember reading math books in the past (I'll post if I can find
them) that agree with the notion I put forth, that int(-2.6) = -3, (not
I mean 'int' in a general context, not Perl's 'int()') which is what
should happen for a modulus to work correctly, for example, to yield 2
if mod(-13, 5). If you round towards 0, you get -3 from that. A negative
remainder doesn't seme to make any sence in math afaik.
:> Snail
------------------------------
Date: Thu, 24 Feb 2005 22:58:59 GMT
From: Ala Qumsieh <notvalid@email.com>
Subject: Re: Division/math bug in perl?
Message-Id: <T_sTd.552$C47.348@newssvr14.news.prodigy.com>
A. Sinan Unur wrote:
> On the other hand, I do value your opinion of me, so I'll have to figure
> something out.
Thanks. I'm glad you took it this way.
--Ala
PS. I have been accused of similar behavior in the past, so you're in
good company ;)
------------------------------
Date: Thu, 24 Feb 2005 14:53:37 -0800
From: "Snail" <snail@localhost.com>
Subject: Re: Division/math bug in perl?
Message-Id: <cvllsb$sai$1@news.astound.net>
Alan J. Flavell wrote:
> On Thu, 24 Feb 2005, Ala Qumsieh wrote:
>
> > A. Sinan Unur wrote:
> >
> > > "Snail" <snail@localhost.com> wrote in
> > > news:cvleei$on4$1@news.astound.net:
> > >
> > > > Subject: Division/math bug in perl?
> > >
> > > Might arrogant coming from someone who is unable to read and
> > > understand the documentation:
>
> Was that typo supposed to be "mite" or "mighty" ?
>
> > I have read earlier posts from others pointing out that your
> > comments can be a bit harsh sometimes, and I agree with them. Your
> > reply here seems to me too condescending and uncalled for.
>
> Well, I feel motivated to support A.S.U here. I find the tendency to
> report every trivial problem as "bug in ..." - without apparent
> reference to any documentation - to be extremely rude and
> counterproductive.
My aplogies. I realize my subject line was very poorly choosen. I did
not intend on coming out as rude. I only wanted to start a dicussion on
why langs like Perl, c, c++ (and java?) do this sort of division. I am
thinking there has to be some logical reason why languages to this.
:> Snail
------------------------------
Date: Thu, 24 Feb 2005 22:40:44 GMT
From: Mark Healey <die@spammer.die>
Subject: Having Trouble Recursing a Function
Message-Id: <pan.2005.02.24.22.40.43.424469@spammer.die>
Can anyone tell me why the following only goes one level deep in the
directory tree?
I'm stumped
#!/usr/bin/perl
use strict;
use Cwd;
my $cdir;
my @files;
$cdir = getcwd();
doDir($cdir);
foreach(@files)
{
printf("$_\n");
}
exit;
sub doDir
{
my $dir = $_[0];
printf("####$dir####\n");
my $fname;
opendir(DIRHANDLE, $dir);
my @list = readdir(DIRHANDLE);
closedir(DIRHANDLE);
foreach(@list)
{
chomp;
if(-d $_)
{
unless(/\.\.?\z/)
{
$fname=$dir.'/'.$_;
doDir($fname);
}
}
else
{
if(/\.mp3\z/)
{
$fname=$dir.'/'.$_;
push(@files, $fname);
}
}
}# end foreach(@list)
}# end doDir()
TIA
--
Mark Healey
marknews(at)healeyonline(dot)com
------------------------------
Date: Thu, 24 Feb 2005 20:22:44 +0100
From: Mark Clements <mark.clements@kcl.ac.uk>
Subject: Re: How to generate random emails?
Message-Id: <421e2983$1@news.kcl.ac.uk>
kongyew@w-manager.com wrote:
> Hi,
>
> I would like to test my email server. How can i can generate
> random emails with random email address? Does anyone knows any perl
> modules that does it?
>
> Thanks.
> kongyew@w-manager.com
>
check out postal: http://www.coker.com.au/postal/, an SMTP benchmarker.
Not Perl, though.
Mark
------------------------------
Date: Thu, 24 Feb 2005 15:35:11 -0500
From: Eric Amick <eric-amick@comcast.net>
Subject: Re: How to handle " use module qw/abc/ " in the module ?
Message-Id: <5bes11p5pcl36qjimoc81d4b1m1lnmksls@4ax.com>
On Wed, 23 Feb 2005 02:21:09 -0800, "Snail" <snail@localhost.com> wrote:
>But how do you go about making which of these funcs to import
>selectable? As in wanting to just import Func1 or Func2? I've seen code
>that uses something like
>
>use Module qw/somefunc/;
>
>So how can I make it if it is written 'use Test qw/Func1/;' *only* Func1
>is imported? (Same for Func2.) And if nothing is passed, ie 'use Test;'
>then import all?
>
>In other words how do you see/handle what is "passed" in the 'use' line?
For the simple case you describe, you don't have to do anything special;
when the user specifies symbols on the use line, only the specified
symbols are imported. It gets more complicated if you have symbols
available to import that are not intended to be imported by default;
those should be in the array @EXPORT_OK. You'll find all this (and much
more) in perldoc Exporter.
--
Eric Amick
Columbia, MD
------------------------------
Date: 24 Feb 2005 11:47:27 -0800
From: "jonnytheclown" <jonny@windmillwalton.demon.co.uk>
Subject: Re: How to tell if a subroutine arg is a constant
Message-Id: <1109274447.144969.247150@o13g2000cwo.googlegroups.com>
Thanks for the Scalar::Util pointer - just what I needed.
As to why I want it...
I want to build in variant behaviour to an object method so I can
differentiate between...
$o->foo(-abc, ...);
and
$o->foo(...);
Without placing restrictions on the callers first real arg provided it
is not a literal starting with '-'. If that makes sense.
------------------------------
Date: Thu, 24 Feb 2005 21:41:58 GMT
From: Ala Qumsieh <notvalid@email.com>
Subject: Re: How to tell if a subroutine arg is a constant
Message-Id: <GSrTd.6897$OU1.3782@newssvr21.news.prodigy.com>
jonnytheclown wrote:
> Thanks for the Scalar::Util pointer - just what I needed.
>
> As to why I want it...
>
> I want to build in variant behaviour to an object method so I can
> differentiate between...
>
> $o->foo(-abc, ...);
>
> and
>
> $o->foo(...);
>
> Without placing restrictions on the callers first real arg provided it
> is not a literal starting with '-'. If that makes sense.
Not quite.
So, in your application, you will never have this scenario:
my @opts = '-abc';
$o->foo(@opts, @more_args);
?
--Ala
------------------------------
Date: Thu, 24 Feb 2005 19:56:05 +0000 (UTC)
From: Richard Anderson <hackeras@gmail.com>
Subject: Re: Intercepting data flow between 2 apps
Message-Id: <Xns9607DF661C14hackerasgmailcom@194.177.210.210>
tiltonj@erols.com (Jay Tilton) wrote in news:421a7dbb.7617092
@news.erols.com:
> Richard Anderson <hackeras@gmail.com> wrote:
>
> [A long, meandering tale of firewalls.]
>
> You have completely missed the point people were trying to make in the
> other thread: you have not yet asked a perl question.
>
> Once again: You have not yet asked a perl question.
>
> A third time, because you seem terminally obtuse:
> YOU HAVE NOT YET ASKED A PERL QUESTION.
>
> After you have used the packet sniffer to intercept the IP traffic,
> after you have analyzed the traffic to see what information is sent,
> after you have determined how to craft your bogus information to send
in
> its place,
>
> _then_ you might be ready to do some programming.
>
> Until then, this is completely off-topic to clpm.
Sorry that was not intentional, in fact its not a perl question but its a
perl related somehow because after i intercept and nalyzes the ip traffic
then i have to alter the bogus info.
Tha would mean that i would have to opne the snifefrs specific log file
to alter its components as i want them to be and the resubmit the whole
damn thing in a perl manner way?
------------------------------
Date: Thu, 24 Feb 2005 21:19:40 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Intercepting data flow between 2 apps
Message-Id: <Xns9607A618AE680asu1cornelledu@127.0.0.1>
Richard Anderson <hackeras@gmail.com> wrote in
news:Xns9607DF661C14hackerasgmailcom@194.177.210.210:
> tiltonj@erols.com (Jay Tilton) wrote in news:421a7dbb.7617092
> @news.erols.com:
>
>> Richard Anderson <hackeras@gmail.com> wrote:
>>
>> [A long, meandering tale of firewalls.]
>>
...
>> YOU HAVE NOT YET ASKED A PERL QUESTION.
...
> Sorry that was not intentional, in fact its not a perl question but
> its a perl related somehow because after i intercept and nalyzes the
> ip traffic then i have to alter the bogus info.
Your question is off-topic until you have some Perl to post.
> Tha would mean that i would have to opne the snifefrs specific log
Please do not post gibberish.
Sinan.
------------------------------
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 7825
***************************************