[29226] in Perl-Users-Digest
Perl-Users Digest, Issue: 470 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 30 21:09:42 2007
Date: Wed, 30 May 2007 18:09:08 -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, 30 May 2007 Volume: 11 Number: 470
Today's topics:
Re: A simple way to make a code folder available as a m <joe@inwap.com>
Re: Beyond Inside-Out <bik.mido@tiscalinet.it>
Re: Beyond Inside-Out anno4000@radom.zrz.tu-berlin.de
Re: Beyond Inside-Out <abigail@abigail.be>
Re: bidirectional pipe & inetd xhoster@gmail.com
Re: duplicates <bik.mido@tiscalinet.it>
Re: duplicates <bik.mido@tiscalinet.it>
Re: duplicates usenet@DavidFilmer.com
Re: duplicates <bart.lateur@pandora.be>
Re: duplicates <jgibson@mail.arc.nasa.gov>
Re: duplicates <bik.mido@tiscalinet.it>
Re: duplicates <tadmc@augustmail.com>
Generating Gnuplot graphs from Perl - and keeping them <rpcroke@gmail.com>
Re: Generating Gnuplot graphs from Perl - and keeping t <paduille.4061.mumia.w+nospam@earthlink.net>
Re: Generating Gnuplot graphs from Perl - and keeping t <jgibson@mail.arc.nasa.gov>
Re: how to automate userinteractive prompt <simon.andrews@bbsrc.ac.uk>
Problem when using NMAKE to build Perl on Windows <treble54@gmail.com>
Re: SendMail.pm: smtp and gmail <tadmc@augustmail.com>
Re: sort? <joe@inwap.com>
Re: What is MAXINT, or when to use bigint? <bik.mido@tiscalinet.it>
Re: What is MAXINT, or when to use bigint? <bart.lateur@pandora.be>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 30 May 2007 11:51:21 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: A simple way to make a code folder available as a module
Message-Id: <-9OdnZifX-c2WsDbnZ2dnUVZ_oOknZ2d@comcast.com>
skywriter14 wrote:
> Doesnt work:
> perl -el 'print for @INC'
>
> So I learnt, that the e option should be adjucent to the code.
Same caveat applies to any perl command-line switch that takes an argument.
OK:
perl -pi.bak -e 's/FIRST/SECOND/g' *
perl -pi -e 's/FIRST/SECOND/g' *
Not OK:
perl -pie 's/FIRST/SECOND/g' *
Also look at 'perldoc perlrun' to see how -l and -0 are sensitive to order.
-Joe
------------------------------
Date: Wed, 30 May 2007 16:50:06 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Beyond Inside-Out
Message-Id: <jg3r5350h763a7dehfuaiq9aj4p8fou0hp@4ax.com>
On 30 May 2007 09:37:22 GMT, anno4000@radom.zrz.tu-berlin.de wrote:
>Abigail <abigail@abigail.be> wrote in comp.lang.perl.misc:
[snip]
Anno,
due to time constraints (in synergy with the fact that much of this is
far above the top of my head) I've not been closely following the
discussions either here or in PM, but for what I've read they're both
extremely valuable and interesting. So may I ask you to be so gentle
and for completeness to report there -as time permits- anything you
judge to be worth of what's said here? The other way round is easy,
because you already linked to the root node of the thread...
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 30 May 2007 17:59:35 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: Beyond Inside-Out
Message-Id: <5c5sc7F2vb6ucU1@mid.dfncis.de>
Abigail <abigail@abigail.be> wrote in comp.lang.perl.misc:
> anno4000@radom.zrz.tu-berlin.de (anno4000@radom.zrz.tu-berlin.de) wrote
[snip]
> `' You can access the attributes
> `' of the class an object is blessed into, but you don't know about
> `' other classes it might have been initialized to. That data has to
> `' be dumped as well. One could try to follow the ISA tree, but that's
> `' not reliable.
>
> Not reliable as in 'you might want to modify @ISA before you serialize'?
> If you modify @ISA at run time, Inside-Out objects will have a problem
> anyway, as that prevents the right DESTROYs to be called if the object goes
> out of scope. OTOH, if an object once belonged to class Foo, got data
> associated with it in class Foo, then Foo is removed from @ISA, and then
> it is serialized, why would you want to Foo data to be serialized? After
> all, it's no longer a Foo.
Imagine a situation where objects are initialized for two or more
inheritance situations which can be switched at will. At any time
there is only one @ISA tree to guide serialization (or destruction,
for that matter), but all the data is needed for the whole to work
I have come to consider @ISA a crutch for this purpose. Sometimes
there is nothing else, but if possible I want to be able to look at
an object and see which data is has. With Alter objects that *is*
possible.
>
> `' Essentially, a general-purpose dumper needs to look
> `' at an object (that's all it has) and know about all data that is
> `' associated with the object. That is still hard to achieve with
> `' inside-out objects.
>
>
> That is hard to archieve. Period. A general purpose dumper method cannot
> make any assumptions on how a class is implemented - or it wouldn't be
> a general purpose dumper.
True, an entirely general-purpose dumper would be impossible. Make
that a dumper general enough to dump/restore any object that uses the
Alter technique (plus, of course, the object body proper). That is
possible, while I don't see a dumper general enough to dump all
inside-out objects, not without some additional registry.
[...]
> `' Inside-out objects provide encapsulation in a lexical scope, that's
> `' the strongest kind Perl has to offer. Once the scope is left there's
> `' no going back. (Except padwalking, there's always an exception.)
>
>
> Yes. But unlike what many people think, Inside-Out Objects is not about
> "preventing other classes to access the data at all costs". It's not about
> preventing the data to be accessed - it's about preventing *accidental*
> access. If you put your attributes in 'our' hashes instead of 'my' hashes,
> other classes can access the data, but since they have to be specific about
> it, there's no accidental access.
Yes, that's a relevant distinction. The problem isn't that one class
*can* access the other's data, but that it *will* access the other's
data (or die) if it tries to use the object for its own purpose. That
is the problem inside-out is there to solve, not privacy.
Anno
------------------------------
Date: 30 May 2007 20:56:20 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: Beyond Inside-Out
Message-Id: <slrnf5rp5s.gg.abigail@alexandra.abigail.be>
anno4000@radom.zrz.tu-berlin.de (anno4000@radom.zrz.tu-berlin.de) wrote
on M September MCMXCIII in <URL:news:5c5sc7F2vb6ucU1@mid.dfncis.de>:
`' Abigail <abigail@abigail.be> wrote in comp.lang.perl.misc:
`' > anno4000@radom.zrz.tu-berlin.de (anno4000@radom.zrz.tu-berlin.de) wrote
`'
`' > `' Essentially, a general-purpose dumper needs to look
`' > `' at an object (that's all it has) and know about all data that is
`' > `' associated with the object. That is still hard to achieve with
`' > `' inside-out objects.
`' >
`' >
`' > That is hard to archieve. Period. A general purpose dumper method cannot
`' > make any assumptions on how a class is implemented - or it wouldn't be
`' > a general purpose dumper.
`'
`' True, an entirely general-purpose dumper would be impossible. Make
`' that a dumper general enough to dump/restore any object that uses the
`' Alter technique (plus, of course, the object body proper). That is
`' possible, while I don't see a dumper general enough to dump all
`' inside-out objects, not without some additional registry.
An object using the Alter technique (or any other technique) could have
as one of its attributes another object, which could be an inside-out
object (or something else that uses strong encapsulation, like an object
based on closures). At that point the dumper would break down.
Abigail
--
# Perl 5.6.0 broke this.
%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
------------------------------
Date: 30 May 2007 17:02:11 GMT
From: xhoster@gmail.com
Subject: Re: bidirectional pipe & inetd
Message-Id: <20070530130213.562$YP@newsreader.com>
papahuhn <papahuhn@gmx.net> wrote:
> Hello,
> I want to create a wrapper for an application that is normally run by
> xinetd.
> The information flow should be as following: xinetd <-> wrapper <-> app.
>
> So I have to execute the app within the wrapper and communicate with it
> using a bidirectional pipe. Unfortunately there is a problem with the
> input-buffering of the open2() handles as mentioned by perldoc perlipc:
If the application is already designed to run properly through xinetd, I
would expect that it would already Do The Right Thing with respect to
buffer flushing. Can you give more details about what you expect versus
what you see happen? How much control do you have over the application?
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Wed, 30 May 2007 16:52:43 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: duplicates
Message-Id: <9r3r53hgbupdj427krdqtu5bc0hs1j67p8@4ax.com>
On 29 May 2007 23:55:16 -0700, jeevs <jeevan.ingale@gmail.com> wrote:
>push (@{$hash{$key}}, $value);
>
>How does this work.. I mean i can understand when one uses @{$arr_ref}
>to derefenciate an array ref.
>but what does @{$hash{$key}} stands for... IF you can point me to some
It's the same as
my $arr_ref=$hash{$key};
push @{$arr_ref}, $value;
>data or link that will be fine too...
perldoc perlref
is the starting point.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Wed, 30 May 2007 16:56:16 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: duplicates
Message-Id: <ru3r53tfhpb4urlai4an1cnq6s9h9fj4n1@4ax.com>
On Tue, 29 May 2007 20:58:25 -0500, Tad McClellan
<tadmc@augustmail.com> wrote:
>>> What's of the elitist clpmisc attitude? ;-)
>>
>> s/of/with/;
>
>
>Due to the smiley, I think
>
> s/of/become of/;
>
>was the intent.
Yep, that's what I meant.
>> -- elitist (alleged) English speaker
>
>
>I only speak 'merican though, so I may be way off base...
Ah wid huv thought ye wir scattish. (Fae Alba, ken?)
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 30 May 2007 10:39:22 -0700
From: usenet@DavidFilmer.com
Subject: Re: duplicates
Message-Id: <1180546762.071466.159480@a26g2000pre.googlegroups.com>
On May 29, 11:55 pm, jeevs <jeevan.ing...@gmail.com> wrote:
> Hi David .. Sorry but i dint follow the syntax you used
> like you used
>
> push (@{$hash{$key}}, $value);
>
> How does this work.. I mean i can understand when one uses @{$arr_ref}
> to derefenciate an array ref.
> but what does @{$hash{$key}} stands for...
$hash{$key} has a value, which must (if defined) be a scalar. In this
case, the scalar value is an array reference, so we are creating a
hash of arrays (HoA), or, more specifically (and correctly), a hash of
array references.
perldoc perlreftut
perldoc perlref
--
The best way to get a good answer is to ask a good question.
David Filmer (http://DavidFilmer.com)
------------------------------
Date: Wed, 30 May 2007 21:06:16 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: duplicates
Message-Id: <j7pr53hsl42s36i9nksam2smpubg16tirs@4ax.com>
julia_2683@hotmail.com wrote:
>I would like to find and delete duplicates to reduce the number of
>entries I have for each word. Need your help to achieve that.
>Input
>dog -> doggy
>dog -> dogs
>want -> wants
>want -> wanting
>want -> wanted
>eat -> eaten
>eat -> eating
>eat -> eated
>output
>dog -> doggy dogs
>want -> wants wanting wanted.
What you appear to be after, is finding the stem of words. I believe the
author of the search engine index module KinoSearch, Marvin Humphrey AKA
creamygoodness, also supports a stemmer module on CPAN, which BTW gets
used by the indexer -- but you can use it independently, too.
Home page: http://www.rectangular.com/kinosearch/
CPAN page: http://search.cpan.org/dist/KinoSearch/
The basic stemmer module is Lingua::Stem::Snowball,
http://search.cpan.org/perldoc?Lingua::Stem::Snowball
--
Bart.
------------------------------
Date: Wed, 30 May 2007 15:12:26 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: duplicates
Message-Id: <300520071512269581%jgibson@mail.arc.nasa.gov>
In article <712p53d2kn6l3g3vutfemi4nm7rp2gl1hg@4ax.com>, Michele Dondi
<bik.mido@tiscalinet.it> wrote:
> On Tue, 29 May 2007 11:38:42 -0700, Jim Gibson
> <jgibson@mail.arc.nasa.gov> wrote:
>
> >Here's a fish:
>
> What's of the elitist clpmisc attitude? ;-)
I wasn't trying to be elitist. Some regulars on clpm frown on simply
providing programs on demand to posters, and Paul Lalli had already
responded with a inquiry of what this OP had done in her own behalf.
"Here's a fish" was just shorthand for "you really should follow the
guidelines for this group, attempt to solve the problem on your own,
and post your program if you run into trouble, but I am feeling
generous and bored with what I should be doing and your problem looks
like an interesting challenge that I can whip out in a few minutes, so
here it is."
My apologies if I offended anybody.
--
Jim Gibson
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
------------------------------
Date: Thu, 31 May 2007 00:31:31 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: duplicates
Message-Id: <vnur53h2g6gaonhgi2art6p8rut26ccr6b@4ax.com>
On Wed, 30 May 2007 15:12:26 -0700, Jim Gibson
<jgibson@mail.arc.nasa.gov> wrote:
>> >Here's a fish:
>>
>> What's of the elitist clpmisc attitude? ;-)
>
>I wasn't trying to be elitist. Some regulars on clpm frown on simply
I know. In fact I was "complaining" you weren't. The rationale being
that clpmisc regulars do not give fishes, period! ;-)
>My apologies if I offended anybody.
No, you didn't!
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Wed, 30 May 2007 05:56:17 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: duplicates
Message-Id: <slrnf5qm2h.us2.tadmc@tadmc30.august.net>
jeevs <jeevan.ingale@gmail.com> wrote:
> Sorry but i dint follow the syntax you used
>
> like you used
>
> push (@{$hash{$key}}, $value);
>
> How does this work.. I mean i can understand when one uses @{$arr_ref}
> to derefenciate an array ref.
> but what does @{$hash{$key}} stands for...
It stands for the same thing, only the array ref is stored
in $hash{$key} rather than in $arr_ref.
> IF you can point me to some
> data or link that will be fine too...
perldoc perlreftut
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 30 May 2007 08:13:14 -0700
From: ryan <rpcroke@gmail.com>
Subject: Generating Gnuplot graphs from Perl - and keeping them open
Message-Id: <1180537993.964622.130890@h2g2000hsg.googlegroups.com>
I have a Perl program that successfully executes commands in Gnuplot
(importing a file and plotting) but I have one problem. I cannot
figure out how to keep the graph alive. The program executes, flashes
the graph I need and closes everything. The Gnuplot code is here:
open(GNU,">$name.p");
print GNU "set style data lines\n";
print GNU "set autoscale\n";
print GNU "unset log\n";
print GNU "unset label\n";
print GNU "set xtic auto\n";
print GNU "set ytic auto\n";
print GNU "set title \"Random Walk\"\n";
print GNU "set xlabel \"Iteration\"\n";
print GNU "set ylabel \"Position\"\n";
print GNU "plot";
print GNU " \"$name.dat\" using 1:2 title \'Random Walk\' with
linespoints $count\n";
print GNU "replot $mean title \'mean\'\n";
close DAT;
#---------------------------------------------------------------
#--------------------------------------------------------------
# Attempt to produce graph
# This part calls gnuplot and executes the commands
open(GNUPLOT, "|$GNUPlot");
# The next line means that the following lines should
# be outputted to the gnuplot program until
# the words "gnuplot_Commands" is found
print GNUPLOT << "gnuplot_Commands";
load '$name.p'
gnuplot_Commands
close(GNUPLOT);
How do I change the code so Gnuplot stays open and the graph is
displayed for the user?
Thanks,
------------------------------
Date: Wed, 30 May 2007 17:17:10 GMT
From: "Mumia W." <paduille.4061.mumia.w+nospam@earthlink.net>
Subject: Re: Generating Gnuplot graphs from Perl - and keeping them open
Message-Id: <qki7i.14951$Ut6.3563@newsread1.news.pas.earthlink.net>
On 05/30/2007 10:13 AM, ryan wrote:
> [...]
> close(GNUPLOT);
>
> How do I change the code so Gnuplot stays open and the graph is
> displayed for the user?
>
Use the -persist option to gnuplot.
> Thanks,
>
You're quite welcome.
------------------------------
Date: Wed, 30 May 2007 15:27:58 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: Generating Gnuplot graphs from Perl - and keeping them open
Message-Id: <300520071527585472%jgibson@mail.arc.nasa.gov>
In article <qki7i.14951$Ut6.3563@newsread1.news.pas.earthlink.net>,
Mumia W. <paduille.4061.mumia.w+nospam@earthlink.net> wrote:
> On 05/30/2007 10:13 AM, ryan wrote:
> > [...]
> > close(GNUPLOT);
> >
> > How do I change the code so Gnuplot stays open and the graph is
> > displayed for the user?
> >
>
> Use the -persist option to gnuplot.
Also, you can put a Gnuplot "PAUSE" command in the plot command file,
and/or pause your Perl program by reading input from the keyboard until
you hit RETURN:
my $input = <STDIN>;
--
Jim Gibson
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
------------------------------
Date: Wed, 30 May 2007 15:39:37 +0100
From: Simon Andrews <simon.andrews@bbsrc.ac.uk>
Subject: Re: how to automate userinteractive prompt
Message-Id: <f3k2b4$p0e$1@south.jnrs.ja.net>
king wrote:
> Thanks for the info.
>
> I agree but I don't want to use expect because expect doesn't come by
> default with all the unix machines. To make this work we have to
> install expect.
http://search.cpan.org/~smueller/PAR-0.973/lib/PAR.pm
------------------------------
Date: 30 May 2007 14:36:32 -0700
From: treble54 <treble54@gmail.com>
Subject: Problem when using NMAKE to build Perl on Windows
Message-Id: <1180560992.248641.213220@h2g2000hsg.googlegroups.com>
I am trying to run Perl in a Windows environment.
Here is my setup:
I have installed Visual Studio C++ Express 2005 as well as the latest
SDK (non 64-bit version). I am currently running Windows XP SP2. I
first had problems with the some environment variables but I resolved
that by adding the correct paths in the LIB and INCLUDE environment
variables.
Here is the issue I am trying to resolve:
I load up the Visual Studio 2005 Command prompt and direct my way to
the correct ..\perl-5.8.8\win32\ directory. From that, I type nmake to
start the make process. When the build process of nmake gets outputs
the line:
"Runing Makefile.PL in B
C:\..\perl-5.8.8\win32\..\miniperl.exe -IC:\..\perl5.8.8\win32\..\lib
Makefile.PL INSTALLDIRS=perl PERL_CORE=1"
a window outside the command prompt pops up, stating:
"miniperl.exe has encountered a problem and needs to close. We are
sorry for the inconvenience." with the only optional button being one
that says "Close." When I hit the "Close" button, the same window pops
up again, stating the same information about "miniperl.exe"
encountering a problem. I press the "Close" button again and the
resulting output is as follows:
"Making B
nmake -nologo
NMAKE : fatal error U1064: MAKEFILE not found and no target specified
Stop.
Unsuccessful make(B): code=512 at buildext.pl line 142.
NMAKE : fatal error U1077: '..\miniperl.exe' : return code '0x2'
Stop."
After that, I gain control of the prompt again. I am hoping someone on
here will be able to help me resolve this error. If anyone here has
some help or suggestions that they can contribute, I would very much
appreciate it. Thanks for taking your time to look over this.
-- treble54
------------------------------
Date: Wed, 30 May 2007 06:03:00 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: SendMail.pm: smtp and gmail
Message-Id: <slrnf5qmf4.us2.tadmc@tadmc30.august.net>
Davidcollins001@gmail.com <Davidcollins001@gmail.com> wrote:
> I keep getting an error:
>
> $ Could not connect to smtp.googlemail.com
^^^^^^^^^^
> $smtp = Net::SMTP::SSL->new(Host => $smtpserver,
> Port => $smtpport,
> debug=> 1) ||
> die "Could not connect to $smtpserver; $!";
^^^^
Where is the semicolon and the rest of the message?
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 30 May 2007 11:37:11 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: sort?
Message-Id: <99OdndXBTcDEWcDbnZ2dnUVZ_smonZ2d@comcast.com>
g4173c@motorola.com wrote:
> Hi All:
>
> Thanks for all the responces! I found that the -M doesn't give the
> granularity I need. Some of the files were only seconds apart.
So what, pray tell, do you think -M actually returns?
It is _NOT_ the integer number of days of age.
Proof that -M has all the granularity you need:
linux% foreach n (0 1 2 3)
foreach? touch -d "2-Jan-1970 12:00:0$n" $n
foreach? end
linux% ls -l ?
-rw-r--r-- 1 jms jms 0 Jan 2 1970 0
-rw-r--r-- 1 jms jms 0 Jan 2 1970 1
-rw-r--r-- 1 jms jms 0 Jan 2 1970 2
-rw-r--r-- 1 jms jms 0 Jan 2 1970 3
linux% perl -le 'print "file $_ has -M = ", -M $_ for @ARGV' ?
file 0 has -M = 13661.9331481481
file 1 has -M = 13661.9331365741
file 2 has -M = 13661.933125
file 3 has -M = 13661.9331134259
1/(24*60*60) = 0.00001157407
Where did you come up with the idea that -M is not suitable?
-Joe
------------------------------
Date: Wed, 30 May 2007 17:06:58 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: What is MAXINT, or when to use bigint?
Message-Id: <bk4r53llv7scdmmeal5fe8fkfkce5cio61@4ax.com>
On 29 May 2007 20:52:56 -0700, "bwooster47@gmail.com"
<bwooster47@gmail.com> wrote:
>On my machine, perl -V:ivsize returns
>ivsize='4';
>
>This I thought meant that 4-byte integers are supported, so max
>integer is probably 2billion or 4billion (approximately).
I don't know if the following recent thread @ PM is of interest to
you, but it may:
http://perlmonks.org/?node_id=617840
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Wed, 30 May 2007 21:42:35 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: What is MAXINT, or when to use bigint?
Message-Id: <75rr53h7mktb6m23vlsehdslht01q71l2i@4ax.com>
Sisyphus wrote:
>I think you'll find that integers up to 2 ** 53 are handled correctly by
>perl (as the "double" assigns 53 bits to its integer portion).
Perl uses IEEE double (8 bytes) format for the floating points (at
least, most perl ports do) which uses 52 bits for the fraction (AKA
significand, occasionally also called "mantissa"), while I an extra bit
with value 1 is implied at the front. (Its value is always assumed 1,
bar a few exceptions, hence it needn't be stored).
See http://en.wikipedia.org/wiki/IEEE_754 for the technical details.
Thus, to answer the OP's question: you can safely use native perl
numbers for integers up to 2**53. Beyond that range, itll only be able
to store even numbers, up to 2**54, and losing more bits at the low end
for even higher values.
--
Bart.
------------------------------
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 V11 Issue 470
**************************************