[29036] in Perl-Users-Digest
Perl-Users Digest, Issue: 280 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Mar 29 11:14:15 2007
Date: Thu, 29 Mar 2007 08:14: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 Thu, 29 Mar 2007 Volume: 11 Number: 280
Today's topics:
Re: perl + script files from only one directory <rprp@gmx.net>
Re: perl + script files from only one directory magne.nilsen@gmail.com
Re: perl + script files from only one directory <bik.mido@tiscalinet.it>
Re: perl + script files from only one directory <bik.mido@tiscalinet.it>
Re: perl + script files from only one directory <rprp@gmx.net>
Re: perl + script files from only one directory magne.nilsen@gmail.com
perl encryption tutorials <none@all.thanks>
Re: Perl package install dll problems <sisyphus1@nomail.afraid.org>
Re: Replacing characters in file <bik.mido@tiscalinet.it>
What are OOP's Jargons and Complexities <xah@xahlee.org>
Re: What could potentially be wrong in this script? <foureightyeast@yahoo.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 29 Mar 2007 09:20:33 +0200
From: Reinhard Pagitsch <rprp@gmx.net>
Subject: Re: perl + script files from only one directory
Message-Id: <460b68c2$0$90262$14726298@news.sunsite.dk>
magne.nilsen@gmail.com wrote:
> On Mar 28, 1:04 pm, Reinhard Pagitsch <r...@gmx.net> wrote:
>> > Alternatively, is there any alternative
>> > "compilers" that truly compiles absolutely all needed files into a
>> > single EXE ?
>>
>> Yes PAR do it also. Use pp.bat to compile the .pl script and the used
>> modules. The documentation can be found under /perl/html/bin/pp.html
>>
>
> In my win install there are no pp.bat nor pp.html...
> Still, what I've seen from par is a single EXE that when run extracts
> a complete perl environment and all files and sundirs to a temp area,
> which is the opposite of what I am looking for... :(
Hmm, pp.bat is part of the PP module, install the PP module and you have
the pp.bat. On Windows there will be also a single EXE file but there
will be no extraction of the perl environment to a temp file.
Take a look: http://cpan.uwinnipeg.ca/module/pp.
I am satisfied with the Perl Packager. I use the exe files on servers
where no Perl is installed.
An other option would be perl2exe from http://www.indigostar.com/, but
it is not free. You can download a trial version to show how it works.
Reinhard
--
PM Mails an rpirpag <at> gmx dot at
------------------------------
Date: 29 Mar 2007 00:47:40 -0700
From: magne.nilsen@gmail.com
Subject: Re: perl + script files from only one directory
Message-Id: <1175154459.959625.271220@y80g2000hsf.googlegroups.com>
On Mar 29, 9:20 am, Reinhard Pagitsch <r...@gmx.net> wrote:
> magne.nil...@gmail.com wrote:
> > On Mar 28, 1:04 pm, Reinhard Pagitsch <r...@gmx.net> wrote:
> >> > Alternatively, is there any alternative
> >> > "compilers" that truly compiles absolutely all needed files into a
> >> > single EXE ?
>
> >> Yes PAR do it also. Use pp.bat to compile the .pl script and the used
> >> modules. The documentation can be found under /perl/html/bin/pp.html
>
> > In my win install there are no pp.bat nor pp.html...
> > Still, what I've seen from par is a single EXE that when run extracts
> > a complete perl environment and all files and sundirs to a temp area,
> > which is the opposite of what I am looking for... :(
>
> Hmm, pp.bat is part of the PP module, install the PP module and you have
> the pp.bat. On Windows there will be also a single EXE file but there
> will be no extraction of the perl environment to a temp file.
> Take a look:http://cpan.uwinnipeg.ca/module/pp.
> I am satisfied with the Perl Packager. I use the exe files on servers
> where no Perl is installed.
> An other option would be perl2exe fromhttp://www.indigostar.com/, but
> it is not free. You can download a trial version to show how it works.
>
> Reinhard
>
> --
> PM Mails an rpirpag <at> gmx dot at
Great, getting closer....
ref: http://cpan.uwinnipeg.ca/htdocs/PAR-Packer/pp.html#Stand_alone_setup
so - running pp without "--dependent" and with "--gui" is meant to
produce a single win.exe that does not recreate the perl environment
in the temp dir, and also without a win console window ?
Thanks,
Magne
------------------------------
Date: Thu, 29 Mar 2007 10:06:39 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: perl + script files from only one directory
Message-Id: <deom03lh2ev7eoramjg7npsjrk6prl3m9s@4ax.com>
On 28 Mar 2007 16:45:24 -0700, magne.nilsen@gmail.com wrote:
>> Yes PAR do it also. Use pp.bat to compile the .pl script and the used
>> modules. The documentation can be found under /perl/html/bin/pp.html
>>
>
>In my win install there are no pp.bat nor pp.html...
Really? How strange... well he wrote /perl supposing that that would
be your root perl dir, your location may vary. But in any case you
should be able to do
perldoc pp
as usual.
>Still, what I've seen from par is a single EXE that when run extracts
>a complete perl environment and all files and sundirs to a temp area,
>which is the opposite of what I am looking for... :(
I'm not really sure...
blazar@perlmonk ~ $ cat hello.pl
print "Hello, world";
blazar@perlmonk ~ $ pp -o hello hello.pl
blazar@perlmonk ~ $ strace -eopen ./hello 2>&1 | grep -F -v O_RDONLY
Hello, worldProcess 27502 detached
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: Thu, 29 Mar 2007 10:24:17 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: perl + script files from only one directory
Message-Id: <gptm03hehf0oe4rne08ct8m1pg7q9m7s0c@4ax.com>
On 29 Mar 2007 00:47:40 -0700, magne.nilsen@gmail.com wrote:
>ref: http://cpan.uwinnipeg.ca/htdocs/PAR-Packer/pp.html#Stand_alone_setup
>so - running pp without "--dependent" and with "--gui" is meant to
>produce a single win.exe that does not recreate the perl environment
>in the temp dir, and also without a win console window ?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Once you have your .exe, you can operate on it with AS's exetype.
exetype foo.exe WINDOWS
should do.
HTH,
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: Thu, 29 Mar 2007 11:01:41 +0200
From: Reinhard Pagitsch <rprp@gmx.net>
Subject: Re: perl + script files from only one directory
Message-Id: <460b8075$0$90262$14726298@news.sunsite.dk>
Michele Dondi wrote:
> On 29 Mar 2007 00:47:40 -0700, magne.nilsen@gmail.com wrote:
>
>>ref: http://cpan.uwinnipeg.ca/htdocs/PAR-Packer/pp.html#Stand_alone_setup
>>so - running pp without "--dependent" and with "--gui" is meant to
>>produce a single win.exe that does not recreate the perl environment
>>in the temp dir, and also without a win console window ?
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Once you have your .exe, you can operate on it with AS's exetype.
>
> exetype foo.exe WINDOWS
Great, that I did not know. I will keep it in mind.
Thanks to the authors of PAR and pp.
regards,
Reinhard
--
PM Mails an rpirpag <at> gmx dot at
------------------------------
Date: 29 Mar 2007 03:32:17 -0700
From: magne.nilsen@gmail.com
Subject: Re: perl + script files from only one directory
Message-Id: <1175164336.799622.175750@n59g2000hsh.googlegroups.com>
On Mar 29, 10:24 am, Michele Dondi <bik.m...@tiscalinet.it> wrote:
> On 29 Mar 2007 00:47:40 -0700, magne.nil...@gmail.com wrote:
>
> >ref:http://cpan.uwinnipeg.ca/htdocs/PAR-Packer/pp.html#Stand_alone_setup
> >so - running pp without "--dependent" and with "--gui" is meant to
> >produce a single win.exe that does not recreate the perl environment
> >in the temp dir, and also without a win console window ?
>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Once you have your .exe, you can operate on it with AS's exetype.
>
> exetype foo.exe WINDOWS
>
> should do.
>
> HTH,
> Michele
> --
Hi,
sorry - it still recreates a complete perl subdir structure and more
in:
C:\Documents and Settings\UserName\Local Settings\Temp\par-UserName
(\inc\lib ++ subdirs and \sript with .pl files)
perl2exe-8.80-Win32 OTOH seems to do it without these things...
so I guess I'll have to trace that route. ($$, but that's OK)
Thanks to all!
Magne
------------------------------
Date: Wed, 28 Mar 2007 21:47:53 -0500
From: sparkane <none@all.thanks>
Subject: perl encryption tutorials
Message-Id: <jPSdnZ-G1LfWtZbbnZ2dnUVZ_revnZ2d@giganews.com>
Hi,
I'm building a web application and I want to be able to secure it
properly. I've been looking at using Crypt::CBC and Blowfish to encrypt
the various things needed to log into the app. However, the cpan
documentation leaves me dissatisfied with regard to *why* i'd do things
one way or another, on the level of the code. For example, in poking
around the web, I've seen various uses of pack() along with CBC
encryption, but the docs don't seem to mention that or why anyone would
do that. Mainly the docs say what I can do but don't make clear why I
should do things this way or that way.
So I hoping someone here could recommend web tutorials or other sources
of information that would make clear to a newbie what a best practice
might be for this kind of stuff, on the level of the code itself.
I've been looking on the web, but I haven't had any luck yet, so I was
hoping someone here might give my ass a kick in the right direction.
Thanks in advance.
------------------------------
Date: Thu, 29 Mar 2007 13:36:37 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: Perl package install dll problems
Message-Id: <460b344c$0$5748$afc38c87@news.optusnet.com.au>
"ChrisC" <christopher.m.collins@gmail.com> wrote in message
news:1175103720.439454.155970@l77g2000hsb.googlegroups.com...
.
.
> I'm now trying to install inline-java 0.52. I've set the environment
> variables PERL_INLINE_JAVA_J2SDK=c:
> \jdk1.5.0_11 and PERL_INLINE_JAVA_JNI=1
I find the same problem when I set those environment variables. However, if
I unset them, and start *afresh* with 'perl Makefile.PL
J2SDK=C:/jdk1.5.0_11', accepting the defaults where prompted (which means
that the JNI extension is built), then I find that everything builds and
tests fine.
Actually, I'm using jdk1.5.0_07, and dmake/gcc (not nmake/cl), but the fact
that I got the same problem suggests that the same solution may also work
for you.
Cheers,
Rob
------------------------------
Date: Thu, 29 Mar 2007 08:49:56 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Replacing characters in file
Message-Id: <2com03dfv9u5efc8s75tklsojqjlmudqif@4ax.com>
On 28 Mar 2007 17:55:50 -0700, "Klaus" <klaus03@gmail.com> wrote:
>Well, that's your opinion, but I would suggest at least that you read
>this newsgroup from time to time (I suggest twice a week ?). One never
>knows, maybe a satisfactory reply to your problem will be posted
>later.
Several ones *have* been...
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: 29 Mar 2007 08:01:37 -0700
From: "Xah Lee" <xah@xahlee.org>
Subject: What are OOP's Jargons and Complexities
Message-Id: <1175180497.362830.285710@y80g2000hsf.googlegroups.com>
What are OOP's Jargons and Complexities
Xah Lee, 20050128
Classes, Methods, Objects
In computer languages, often a function definition looks like this:
subroutine f (x1, x2, ...) {
variables ...
do this or that
}
In advanced languages such as LISP family, it is not uncommon to
define functions inside a function. For example:
subroutine f (x1, x2, ...) {
variables...
subroutine f1 (x1...) {...}
subroutine f2 (x1...) {...}
}
Often these f1 f2 inner functions are used inside f, and are not
relevant outside of f. Such power of the language gradually developed
into a style of programing. For example:
subroutine a_surface () {
coordinatesList =3D ...;
subroutine translate (distance) {...}
subroutine rotate (angle) {..}
}
Such a style is that the a_surface is no longer viewed as a function.
But instead, a boxed set of functions, centered around a piece of
datum. And, all functions for manipulating this piece of datum are all
embodied in this function. For example:
subroutine a_surface (arg) {
coordinatesList =3D ...
subroutine translate (distance) {set coordinatesList to translated
version}
subroutine rotate (angle) {set coordinatesList to rotated version}
subroutine return () {return coordinatesList}
if (no arg) {do nothing}
else { apply arg to coordinatesList }
}
In this way, one uses a_surface as a piece of datum that are bundled
with its own set of functions:
mySurface =3D a_surface // assign subroutine to a variable
mySurface(rotate(angle)) // now the surface datum has been
rotated
mySurface(translate(distance)) // now its translated
newSurface =3D mySurface(return())
So now, a_surface is no longer viewed as a subroutine, but a boxed set
of things centered around a piece of datum. All functions that work on
the datum are included in the boxed set. This paradigm possible in
functional languages has refined so much so that it spread to other
groups and became known as Object Oriented Programing, and complete
languages with new syntax catered to such scheme emerged.
In such languages, instead of writing them like this:
mySurface =3D a_surface;
mySurface(rotate(angle));
the syntax is changed to like this, for example:
mySurface =3D new a_surface();
mySurface.rotate(angle);
In such languages, the super subroutine a_surface is no longer called
a function or subroutine. It is now called a =E2=80=9CClass=E2=80=9D. And n=
ow the
variable holding the function "mySurface" is now called a =E2=80=9CObject=
=E2=80=9D.
Subroutines inside the function a_surface are no longer called inner-
subroutines. They are called =E2=80=9CMethods=E2=80=9D. The act of assignin=
g a super-
subroutine to a variable is called instantiation.
This style of programing and language has become so fanatical that in
such dedicated languages like Java, everything in the language are
Classes. One can no longer just define a variable or subroutine.
Instead, one defines these super-subroutines (classes) that has inner-
subroutines (methods). Every line of code are now inside such super-
subroutine. And one assigns subroutines to variables inside other
subroutines to create objects. And one calls inner-subroutines
(methods) thru these =E2=80=9Cobject=E2=80=9D variables to manipulate the d=
ata defined
in the super-subroutine. In this fashion, even basic primitives like
numbers, strings, and lists are no longer atomic entities. They are
now subroutines with inner-subroutines.
For example, in Java, a string is a class String. And inside the class
String, there are Methods to manipulate strings, such as finding the
number of chars, or extracting parts of the string. This can get very
complicated. For example, in Java, there are actually two Classes of
strings: One is String, and the other is StringBuffer. Which one to
use depends on whether you intend to change the datum.
So, a simple code like this in normal languages:
a =3D "a string";
b =3D "another one";
c =3D join(a,b);
print c;
or in lisp style
(set a "a string")
(set b "another one")
(set c (join a b))
(print c)
becomes in Java:
public class test {
public static void main(String[] args) {
String a =3D new String("a string");
String b =3D new String("another one");
StringBuffer c =3D new StringBuffer(40);
c.append(a); c.append(b);
System.out.println(c.toString());
}
}
Here, the =E2=80=9Cnew String=E2=80=9D creates a String object. The =E2=80=
=9Cnew
StringBuffer(40)=E2=80=9D creates the changeable string object StringBuffer,
with room for 40 chars. =E2=80=9Cappend=E2=80=9D is a method of StringBuffe=
r=2E It is
used to join two Strings.
Notice the syntax =E2=80=9Cc.append(a)=E2=80=9D, which we can view it as ca=
lling a
inner-subroutine =E2=80=9Cappend=E2=80=9D, on a super-subroutine that has b=
een
assigned to c, where, the inner-subroutine modifies the inner datum by
appending the value of a to it.
And in the above Java example, StringBuffer class has another method
=E2=80=9CtoString()=E2=80=9D used to convert this into a String Class, nece=
ssary
because System.out.println's parameter requires a String type, not
StringBuffer.
For a example of the complexity of classes and methods, see the Java
documentation for the StringBuffer class at
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/StringBuffer.html
(local copy)
In the same way, numbers in Java have become a formalization of many
classes: Double, Float, Integer, Long... and each has a collection of
=E2=80=9Cmethods=E2=80=9D to operate or convert from one to the other.
Instead of
aNumber =3D 3;
print aNumber^2;
In Java the programer needs to master the ins and outs of the several
number classes, and decide which one to use. (and if a program later
needs to change from one type of number to another, it is often
cumbersome.)
This Object Oriented Programing style and dedicated languages (such as
C++, Java) have become a fad like wild fire among the programing mass
of ignoramuses in the industry. Partly because of the data-centric new
perspective, partly because the novelty and mysticism of new syntax
and jargonization.
It is especially hyped by the opportunist Sun Microsystems with the
inception of Java, internet, and web applications booms around 1995.
At those times, OOP (and Java) were thought to revolutionize the
industry and solve all software engineering problems, in particular by
certain =E2=80=9Creuse of components=E2=80=9D concept that was thought to c=
ome with
OOP. (we will cover the =E2=80=9Creuse=E2=80=9D issue in the inheritance se=
ction
later.)
As part of this new syntax and purity, where everything in a program
is of Classes and Objects and Methods, many complex issues and concept
have arisen in OOP from both the OOP language machinery as well as a
engineering practice.
We now know that the jargon Class is originally and effectively just a
boxed set of data and subroutines, all defined inside a subroutine.
And the jargon Object is just a variable that has been set to this
super-subroutine. And the inner-subroutines are what's called Methods.
-----------
The above is a excerpt from the article
=E2=80=9CWhat are OOP's Jargons and Complexities=E2=80=9D.
The full article is available at
http://xahlee.org/Periodic_dosage_dir/t2/oop.html
Xah
xah@xahlee.org
=E2=88=91 http://xahlee.org/
------------------------------
Date: 29 Mar 2007 06:15:38 -0700
From: "Chris" <foureightyeast@yahoo.com>
Subject: Re: What could potentially be wrong in this script?
Message-Id: <1175174138.135843.251390@n59g2000hsh.googlegroups.com>
On Mar 28, 7:33 pm, "Klaus" <klau...@gmail.com> wrote:
> On Mar 29, 1:36 am, "Chris" <foureightye...@yahoo.com> wrote:
>
> [snip]
>
> > if I print "$1\n",
> > the file prints just fine. But, if I do something like print "$1 after
> > \n", the whole output is messed up. If I print "before $1\n", nothing
> > prints at all. If I print "before $1 after\n", only after prints.
>
> not really sure, but could be a rogue "\r" in $1,
> try dumping out the content in hex: print unpack('H*', $1);
>
> --
> Klaus
Hi, Klaus:
Thanks for suggestion and for making me aware of unpack! :) There
is a rogue carriage return (0xd) in the string that isn't appearing in
the other strings, even though the file characteristics are the same
as far as the naked eye can see between all my files, this is the only
one with that strange character at the end. chomp() doesn't seem to
get rid of it either. Is there something I can do to deal with this
situation? I've tried retyping the string by hand in the file, but it
doesn't seem to be going away for some reason. In fact, I can delete
the line and retype it in any other file and it works. For some
reason, this file isn't happy...
------------------------------
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 280
**************************************