From: Mike McClain
> On Sat, Jan 10, 2009 at 09:56:24PM -0800, Randal L. Schwartz wrote:
> >
> > I prefer the "do" form, myself.
>
> Is there a functional reason for your preference
> or is it just a matter of taste?
I can't talk for Randal, but for me there is a simple reason. In the
do
On Sat, Jan 10, 2009 at 09:56:24PM -0800, Randal L. Schwartz wrote:
>
> I prefer the "do" form, myself.
Is there a functional reason for your preference
or is it just a matter of taste?
Mike
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginn
Randal L. Schwartz wrote:
Ruud:
is better written as
... for varying and arguable values of "better".
I prefer the "do" form, myself.
The simple problem with the do-form is that it easily uses double the
memory because it allocates two buffers (as I hinted in the part that
you didn't quo
Randal L. Schwartz wrote:
>> "Rob" == Rob Dixon writes:
>
> Rob> I tested the similar
>
> Rob> my @data = do {
> Rob> open my $fh, '<', $file or die $!;
> Rob> <$fh>;
> Rob> };
>
> Rob> a while ago, but not on v5.10. I will see if I can find time to try it
> again.
>
> Ahh, bu
Randal L. Schwartz wrote:
>> "Rob" == Rob Dixon writes:
>
> Rob> But the first causes Perl to keep two copies of the file data, which may
> be
> Rob> unacceptable depending on the the size of the file and the specification
> of the
> Rob> platform.
>
> Does it really? Have you tested this
> "Rob" == Rob Dixon writes:
Rob> I tested the similar
Rob> my @data = do {
Rob> open my $fh, '<', $file or die $!;
Rob> <$fh>;
Rob> };
Rob> a while ago, but not on v5.10. I will see if I can find time to try it
again.
Ahh, but that's very different. My suspicion is that both
Randal L. Schwartz wrote:
>> "Rob" == Rob Dixon writes:
>
> Rob> But the first causes Perl to keep two copies of the file data, which may
> be
> Rob> unacceptable depending on the the size of the file and the specification
> of the
> Rob> platform.
>
> Does it really? Have you tested this
> "Rob" == Rob Dixon writes:
Rob> But the first causes Perl to keep two copies of the file data, which may be
Rob> unacceptable depending on the the size of the file and the specification
of the
Rob> platform.
Does it really? Have you tested this?
I suspect it actually doesn't.
--
Randa
Randal L. Schwartz wrote:
>> ""Dr" == "Dr Ruud" writes:
>
> "Dr> is better written as
>
> ... for varying and arguable values of "better".
>
> I prefer the "do" form, myself.
I too much prefer the style of
my $data = do {
local $/;
;
};
over
my $data;
{
local $/;
On Sat, Jan 10, 2009 at 03:26:33PM +0100, Jenda Krynicky wrote:
> The Class::Name->method(...) is a class method call. Perl will find
> the method in the clas hierarchy and call the method and pass the
> 'Class::Name' as the first parameter.
>
Thank you Jenda that's very clear.
Mike
--
To
Dr.Ruud wrote:
Jenda Krynicky wrote:
my $data = do {local $/; };
is better written as
my $data; { local $/; $data = };
For smallish files it doesn't matter much.
Or perhaps:
read DATA, my $data, -s DATA;
John
--
Those people who think they know everything are a great
annoyance to t
> ""Dr" == "Dr Ruud" writes:
"Dr> is better written as
... for varying and arguable values of "better".
I prefer the "do" form, myself.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Techni
Jenda Krynicky wrote:
my $data = do {local $/; };
is better written as
my $data; { local $/; $data = };
For smallish files it doesn't matter much.
--
Ruud
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl
On Sat, Jan 10, 2009 at 09:26, Jenda Krynicky wrote:
> From: Mike McClain
>> On Fri, Jan 09, 2009 at 05:52:45PM -0500, Chas. Owens wrote:
>>
>> > You seem to be under the impression that the argument to
>> > Digest::MD5::md5_hex is a file name. The argument is a scalar holding
>> > the data to
From: Mike McClain
> On Fri, Jan 09, 2009 at 05:52:45PM -0500, Chas. Owens wrote:
>
> > You seem to be under the impression that the argument to
> > Digest::MD5::md5_hex is a file name. The argument is a scalar holding
> > the data to perform md5 on. So Digest::MD5::md5_hex("foo") will give
> >
On Fri, Jan 09, 2009 at 05:52:45PM -0500, Chas. Owens wrote:
> You seem to be under the impression that the argument to
> Digest::MD5::md5_hex is a file name. The argument is a scalar holding
> the data to perform md5 on. So Digest::MD5::md5_hex("foo") will give
> you the MD5 of the data "foo".
On Fri, Jan 9, 2009 at 16:40, Mike McClain wrote:
snip
>I appreciate your taking the time to respond and having been
> reading your responses for several months now have no doubt that
> you know what you're talking about.
>I'm still not clear however about what's going on.
>As you can
On Thu, Jan 08, 2009 at 07:12:03PM -0500, Chas. Owens wrote:
> On Thu, Jan 8, 2009 at 17:47, root wrote:
> >The following script gives me confusing results.
> > I've not delved into OOP before and am surprised when something
> > appears to work but gives wrong answers.
> >Explicitly Digest
On Thu, Jan 08, 2009 at 06:47:05PM -0800, John W. Krahn wrote:
> root wrote:
> >The following script gives me confusing results.
> >I've not delved into OOP before and am surprised when something
> >appears to work but gives wrong answers.
> >
> >foreach( @ARGV)
> >{ $target = $_;
>
> M
root wrote:
The following script gives me confusing results.
I've not delved into OOP before and am surprised when something
appears to work but gives wrong answers.
Explicitly Digest::MD5's md5_hex gives wrong answers if called as
Digest::MD5->md5_hex. OK, I've figured out that it shou
On Thu, Jan 8, 2009 at 17:47, root wrote:
>The following script gives me confusing results.
> I've not delved into OOP before and am surprised when something
> appears to work but gives wrong answers.
>Explicitly Digest::MD5's md5_hex gives wrong answers if called as
> Digest::MD5->md5_hex
21 matches
Mail list logo