[32001] in Perl-Users-Digest
Perl-Users Digest, Issue: 3265 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 24 03:09:27 2011
Date: Mon, 24 Jan 2011 00:09:08 -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 Mon, 24 Jan 2011 Volume: 11 Number: 3265
Today's topics:
Editing PDF files with perl <ignoramus3188@NOSPAM.3188.invalid>
Re: Editing PDF files with perl <tadmc@seesig.invalid>
Re: Editing PDF files with perl <ignoramus3188@NOSPAM.3188.invalid>
Re: Editing PDF files with perl <proximum@invalid.com>
Re: Editing PDF files with perl <monkey_vegas@cox.net>
Re: Learning Object Oriented Programming (newbie) <skye.shaw@gmail.com>
Re: Learning Object Oriented Programming (newbie) <uri@StemSystems.com>
Re: Learning Object Oriented Programming (newbie) <skye.shaw@gmail.com>
Re: Memory limit question <edgrsprj@ix.netcom.com>
Re: Memory limit question <skye.shaw@gmail.com>
Re: Perl and Linux (Randal L. Schwartz)
Re: Perl and Linux <ignoramus4862@NOSPAM.4862.invalid>
Re: Perl and Linux sln@netherlands.com
Re: what is the cheapest way to just initialize a hash jidanni@jidanni.org
Re: what is the cheapest way to just initialize a hash <willem@turtle.stack.nl>
Re: what is the cheapest way to just initialize a hash <jwkrahn@example.com>
Re: what is the cheapest way to just initialize a hash <kst-u@mib.org>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 22 Jan 2011 20:59:29 -0600
From: Ignoramus3188 <ignoramus3188@NOSPAM.3188.invalid>
Subject: Editing PDF files with perl
Message-Id: <6KmdnSwmUqwMBKbQnZ2dnUVZ_rydnZ2d@giganews.com>
I have a number of PDF files.
I would like, for all of them, to remove the "page before last".
In addition, they contain a watermark that I want to remove.
These files are not copyrighted since they contain the works of the US
government. So please, no self righteous copyright comments.
There seems to be a multitude of PDF perl modules. Is there any one
specifically suited for editing pdf files.
i
------------------------------
Date: Sat, 22 Jan 2011 22:16:01 -0600
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: Editing PDF files with perl
Message-Id: <slrnijname.qtp.tadmc@tadbox.sbcglobal.net>
Ignoramus3188 <ignoramus3188@NOSPAM.3188.invalid> wrote:
> I have a number of PDF files.
>
> I would like, for all of them, to remove the "page before last".
>
> In addition, they contain a watermark that I want to remove.
>
> These files are not copyrighted since they contain the works of the US
> government. So please, no self righteous copyright comments.
>
> There seems to be a multitude of PDF perl modules. Is there any one
> specifically suited for editing pdf files.
Yes.
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
The above message is a Usenet post.
I don't recall having given anyone permission to use it on a Web site.
------------------------------
Date: Sun, 23 Jan 2011 00:34:56 -0600
From: Ignoramus3188 <ignoramus3188@NOSPAM.3188.invalid>
Subject: Re: Editing PDF files with perl
Message-Id: <NumdnVNLOvSNUabQnZ2dnUVZ_hqdnZ2d@giganews.com>
On 2011-01-23, Tad McClellan <tadmc@seesig.invalid> wrote:
> Ignoramus3188 <ignoramus3188@NOSPAM.3188.invalid> wrote:
>> I have a number of PDF files.
>>
>> I would like, for all of them, to remove the "page before last".
>>
>> In addition, they contain a watermark that I want to remove.
>>
>> These files are not copyrighted since they contain the works of the US
>> government. So please, no self righteous copyright comments.
>>
>> There seems to be a multitude of PDF perl modules. Is there any one
>> specifically suited for editing pdf files.
>
>
> Yes.
>
>
Great!
Which one would you recommend for the above listed purposes?
i
------------------------------
Date: Sun, 23 Jan 2011 18:33:01 +0600
From: Michael <proximum@invalid.com>
Subject: Re: Editing PDF files with perl
Message-Id: <ihh75t$l4i$1@news.eternal-september.org>
23.01.2011 08:59, Ignoramus3188 пишет:
> I have a number of PDF files.
>
> I would like, for all of them, to remove the "page before last".
>
> In addition, they contain a watermark that I want to remove.
>
> These files are not copyrighted since they contain the works of the US
> government. So please, no self righteous copyright comments.
>
> There seems to be a multitude of PDF perl modules. Is there any one
> specifically suited for editing pdf files.
>
> i
Use pdftk: http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/
------------------------------
Date: Sun, 23 Jan 2011 22:45:24 -0800
From: James Wright <monkey_vegas@cox.net>
Subject: Re: Editing PDF files with perl
Message-Id: <ihj767$u5m$1@news.eternal-september.org>
On 01/23/11 04:33, Michael wrote:
> 23.01.2011 08:59, Ignoramus3188 пишет:
>> I have a number of PDF files.
>>
>> I would like, for all of them, to remove the "page before last".
>>
>> In addition, they contain a watermark that I want to remove.
>>
>> These files are not copyrighted since they contain the works of the US
>> government. So please, no self righteous copyright comments.
>>
>> There seems to be a multitude of PDF perl modules. Is there any one
>> specifically suited for editing pdf files.
>>
>> i
>
> Use pdftk: http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/
I couldn't find the Perl bindings to that toolkit, where do I download them?
------------------------------
Date: Sun, 23 Jan 2011 21:25:52 -0800 (PST)
From: "Skye Shaw!@#$" <skye.shaw@gmail.com>
Subject: Re: Learning Object Oriented Programming (newbie)
Message-Id: <6db82408-041c-4ba3-a79b-76e316b88360@r40g2000prh.googlegroups.com>
On Jan 20, 6:14=A0pm, Nene <rodbas...@gmail.com> wrote:
> This is my first attempt to OOP, here is my package:
>
> #####
>
> package Learn;
>
<snip code>
> sub set_farm {
> =A0 my $learn_oop =3D shift;
> =A0 my $farm =3D shift;
> =A0 $learn_oop->{farm} =3D $farm;
>
> }
>
> sub get_farm {
> =A0 my $learn_oop =3D shift;
> =A0 return $learn_oop->{farm};
>
> }
No need to define getters and setters for simple assignment. Save
those for the Java sweat shop :)
To be more in-line with Perl OOP try:
sub farm {
my $self =3D shift;
@_ ? $self->{farm} =3D shift : $self->farm;
}
See perldoc perltoot, Class::Accessor or, better yet, Object::Tiny.
------------------------------
Date: Mon, 24 Jan 2011 01:45:30 -0500
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: Learning Object Oriented Programming (newbie)
Message-Id: <87mxmqu7ed.fsf@quad.sysarch.com>
>>>>> "SS" == Skye Shaw!@#$ <skye.shaw@gmail.com> writes:
SS> No need to define getters and setters for simple assignment. Save
SS> those for the Java sweat shop :)
SS> To be more in-line with Perl OOP try:
SS> sub farm {
SS> my $self = shift;
SS> @_ ? $self->{farm} = shift : $self->farm;
SS> }
have you tested that? really tested it? it will not do what you think it
does. classic abuse of ?:.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
------------------------------
Date: Mon, 24 Jan 2011 00:02:55 -0800 (PST)
From: "Skye Shaw!@#$" <skye.shaw@gmail.com>
Subject: Re: Learning Object Oriented Programming (newbie)
Message-Id: <ae742b53-cfad-42fa-aaae-25c36115a105@f21g2000prn.googlegroups.com>
On Jan 23, 10:45=A0pm, "Uri Guttman" <u...@StemSystems.com> wrote:
> >>>>> "SS" =3D=3D Skye Shaw!@#$ <skye.s...@gmail.com> writes:
>
> =A0 SS> No need to define getters and setters for simple assignment. Save
> =A0 SS> those for the Java sweat shop :)
> =A0 SS> To be more in-line with Perl OOP try:
>
> =A0 SS> sub farm {
> =A0 SS> =A0 my $self =3D shift;
> =A0 SS> =A0 @_ ? $self->{farm} =3D shift : $self->farm;
> =A0 SS> }
>
> have you tested that? really tested it? it will not do what you think it
> does. classic abuse of ?:.
What do I think it does?
------------------------------
Date: Sat, 22 Jan 2011 23:37:07 -0600
From: "E.D.G." <edgrsprj@ix.netcom.com>
Subject: Re: Memory limit question
Message-Id: <DoidnYVuK9cdI6bQnZ2dnUVZ_jWdnZ2d@earthlink.com>
"Martijn Lievaart" <m@rtij.nl.invlalid> wrote in message
news:3j6s08-tg4.ln1@news.rtij.nl...
> No, any process is *also* limited by the global limitations. So if you
> have 256MB of RAM, your process may access 1MB of memory, but is you have
> 4G, your process is still limited to 2GB of memory.
I agree. What I was trying to say is that if you add together all of the
processes that are being run, the most virtual memory that 32 bit Vista can
apparently access for all of them put together is four times the amount of
Ram memory. But, each individual process is allowed access to only 2
gigabytes of that total amount regardless of how large it is.
------------------------------
Date: Sun, 23 Jan 2011 21:10:12 -0800 (PST)
From: "Skye Shaw!@#$" <skye.shaw@gmail.com>
Subject: Re: Memory limit question
Message-Id: <9e787eaa-72ff-4b10-bb3a-ea0a40f510ac@t8g2000prh.googlegroups.com>
On Jan 18, 2:21=A0pm, "Peter J. Holzer" <hjp-usen...@hjp.at> wrote:
> On 2011-01-18 00:27, E.D.G. <edgrs...@ix.netcom.com> wrote:
> > =A0 =A0 =A0 =A0Is that Out of Memory error a memory usage limitation th=
at is built
> > into Perl?
>
> 32 Bit Windows has a 2 GB limit per process.
FWIW, in theory, Windows should allow a user space process to access
more than 2GB of RAM if you tell it to. Though it might require you to
(re)build your perl executable.
Google "Windows /3GB", "Windows PAE" and "Windows LARGEADDRESSAWARE".
------------------------------
Date: Sun, 23 Jan 2011 06:19:24 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Perl and Linux
Message-Id: <8639ojk8ib.fsf@red.stonehenge.com>
>>>>> "E" == E D G <edgrsprj@ix.netcom.com> writes:
E> The ActiveState version of Perl runs quite well with Windows. Can anyone
E> comment on how well it runs with Linux?
The Windows version of Activestate Perl runs quite poorly on Linux.
Perhaps you want a native version of Perl on Linux. That'd make a lot
more sense. Plus, Perl is actually a lot more "home" on Linux than on
Windows.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.posterous.com/ for Smalltalk discussion
------------------------------
Date: Sun, 23 Jan 2011 10:50:58 -0600
From: Ignoramus4862 <ignoramus4862@NOSPAM.4862.invalid>
Subject: Re: Perl and Linux
Message-Id: <BfKdnfDct6nvwaHQnZ2dnUVZ_vqdnZ2d@giganews.com>
On 2011-01-22, E.D.G. <edgrsprj@ix.netcom.com> wrote:
> The ActiveState version of Perl runs quite well with Windows. Can anyone
> comment on how well it runs with Linux?
>
> Is Linux actually the preferred operating system for Perl? Or might that be
> Unix?
>
perl is usually a standard part of Linux distributions. I would say
that it runs better on Linux than on Windows.
i
------------------------------
Date: Sun, 23 Jan 2011 13:11:26 -0800
From: sln@netherlands.com
Subject: Re: Perl and Linux
Message-Id: <296pj6t7en4nq3snp32m2auvbd5rumun2q@4ax.com>
On Sun, 23 Jan 2011 10:50:58 -0600, Ignoramus4862 <ignoramus4862@NOSPAM.4862.invalid> wrote:
>On 2011-01-22, E.D.G. <edgrsprj@ix.netcom.com> wrote:
>> The ActiveState version of Perl runs quite well with Windows. Can anyone
>> comment on how well it runs with Linux?
>>
>> Is Linux actually the preferred operating system for Perl? Or might that be
>> Unix?
>>
>
>perl is usually a standard part of Linux distributions. I would say
>that it runs better on Linux than on Windows.
>
Even if it was compiled for Windows?
-sln
------------------------------
Date: Sun, 23 Jan 2011 22:19:04 +0800
From: jidanni@jidanni.org
Subject: Re: what is the cheapest way to just initialize a hash key?
Message-Id: <ihhdfb$921$1@news.datemas.de>
> @myhash{ ... } = ();
Scalar value @myhash{ ... } better written as $myhash{ ... }
------------------------------
Date: Sun, 23 Jan 2011 15:33:11 +0000 (UTC)
From: Willem <willem@turtle.stack.nl>
Subject: Re: what is the cheapest way to just initialize a hash key?
Message-Id: <slrnijoihn.9mv.willem@turtle.stack.nl>
jidanni@jidanni.org wrote:
)> @myhash{ ... } = ();
) Scalar value @myhash{ ... } better written as $myhash{ ... }
You did it wrong.
@myhash{1,2,3} = ();
Doesn't give that warning.
@myhash{1} = ();
Does.
The idea is to do it all in one single statement.
SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
------------------------------
Date: Sun, 23 Jan 2011 15:45:31 -0800
From: "John W. Krahn" <jwkrahn@example.com>
Subject: Re: what is the cheapest way to just initialize a hash key?
Message-Id: <v43%o.2250$be.816@newsfe05.iad>
jidanni@jidanni.org wrote:
>> @myhash{ ... } = ();
> Scalar value @myhash{ ... } better written as $myhash{ ... }
According to the OP's code the ellipse represents a list so it is not a
scalar value.
John
--
Any intelligent fool can make things bigger and
more complex... It takes a touch of genius -
and a lot of courage to move in the opposite
direction. -- Albert Einstein
------------------------------
Date: Sun, 23 Jan 2011 20:19:53 -0800
From: Keith Thompson <kst-u@mib.org>
Subject: Re: what is the cheapest way to just initialize a hash key?
Message-Id: <ln39ojc4ra.fsf@nuthaus.mib.org>
Jürgen Exner <jurgenex@hotmail.com> writes:
> Keith Thompson <kst-u@mib.org> wrote:
>>On the other hand, if it turned out that
>> $hash{$key} = undef;
>>were significantly faster than
>> $hask{$key} = 1;
>>(or vice versa) then (a) it could be worth using the faster form
>>*if* this turned out to be a bottleneck in the performance of the
>>program,
>
> And this is a very, very big *if*. Normally the real bottleneck is a
> poor choice of algorithm and typically you can gain way more performance
> by redesigning your algorithm instead of micro-optimizing a single
> operation.
Yes, it's a big *if*, but I thought it would have been rude to use a
larger font.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
------------------------------
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:
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests.
#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 3265
***************************************