perl.beginners http://www.nntp.perl.org/group/perl.beginners/ Re: learning perl 3rd vs 4th by merlyn

From: merlyn >>>>> "Jerald" == Jerald Sheets <questy@gmail.com> writes:

Jerald> On May 17, 2008, at 12:07 PM, Randal L. Schwartz wrote:
>>
>> ... and shuffle a bit of content between the
>> llama and alpaca to reflect the corresponding changes we've made in our
>> courseware.

Jerald> Courseware...

Jerald> Do tell. I'm interested.

Eh?

You must be new in town.

Stonehenge Consulting Services has been (and continues to be) one of the
leading providers of on-site and open-enrollment Perl training, dating all the
way back to 1994. We count 17 of the Fortune 100 as our clients.

Man, I need to fire my marketing staff if you don't know that. I guess you
never read the back cover of the llama or alpaca or early camel books, eh?

--
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.vox.com/ for Smalltalk and Seaside discussion

2008-05-17T19:15:58Z
Re: learning perl 3rd vs 4th by Jerald Sheets

From: Jerald Sheets
On May 17, 2008, at 12:07 PM, Randal L. Schwartz wrote:
>
> ... and shuffle a bit of content between the
> llama and alpaca to reflect the corresponding changes we've made in
> our
> courseware.

Courseware...

Do tell. I'm interested.


--jms

2008-05-17T19:12:44Z
Re: perl source code encryption by Chas. Owens

From: Chas. Owens On Sat, May 17, 2008 at 11:12 AM, Gowtham M <gowthamgowtham@gmail.com> wrote:
snip
> This may not be encryption but it might help in hiding your perl code.
>
> You might consider compiling your perl code to a native binary.
>
> http://www.indigostar.com/perl2exe.htm
snip

perl2exe suffers from the same problems all solutions will: you can
recover the source fairly easily*. Of course, that is only an issue
if you are trying to hide your source code (which is futile even with
things like ANSI C). If you don't want your users "stealing" your
code all you need is a proper license and a handy lawyer.

All of that said, there is a case to be made for presenting end-users
with a single file they run to get your program and PAR::Packer**
fills that need completely.

* http://www.net-security.org/vuln.php?id=2464
** http://search.cpan.org/dist/PAR-Packer/lib/PAR/Packer.pm

--
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.

2008-05-17T16:04:04Z
Re: perl source code encryption by Paul Johnson

From: Paul Johnson On Sat, May 17, 2008 at 08:42:54PM +0530, Gowtham M wrote:

> I believe there is one such tool available in standard perl distro (perlcc)
> This perlcc was experimental when I first had a look at it (long time back),
> not sure how stable it is now.

You'll no doubt be very pleased to hear that it is now 100% stable.

AKA dead and buried.

--
Paul Johnson - paul@pjcj.net
http://www.pjcj.net

2008-05-17T12:00:48Z
Re: learning perl 3rd vs 4th by merlyn

From: merlyn >>>>> "Richard" == Richard Lee <rich.japh@gmail.com> writes:

Richard> I was going to order 5th version in june but does anyone in here know
Richard> the different between 3rd and 4th version? Is there a big
Richard> difference?

As I recall, the big changes between 3rd and 4th were to finally acknowledge
the existance of the alpaca book, and shuffle a bit of content between the
llama and alpaca to reflect the corresponding changes we've made in our
courseware. We released an updated alpaca after that as well.

The 5th edition covers the new 5.10 features of interest to beginners,
including some of the new regex options.

print "Just another Perl hacker,";

--
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.vox.com/ for Smalltalk and Seaside discussion

2008-05-17T09:08:16Z
Re: learning perl 3rd vs 4th by Richard Lee

From: Richard Lee Rob Dixon wrote:
> Richard Lee wrote:
>
>> Currently I own a 'learning perl' 3rd edition and I noticed that 5th
>> version is coming out in june.
>> What I didn't realize was that learning perl 4th edition's been out
>> since 2005.
>>
>> I was going to order 5th version in june but does anyone in here know
>> the different between 3rd and 4th version?
>> Is there a big difference?
>>
>
> Randal will tell you exactly what has changed if you can be patient until he
> notices this thread. But unless you're keen to save money by buying an old copy
> I'm sure it will be well worth waiting for the 5th edition in a few weeks.
>
> Rob
>
ok thanks.

I wanted to actually get another learning perl book but if 3rd and 4th
is different enough, I will get 4th and 5th book.

just wanted to know the difference and google does not have readily
comparision as I searched.

2008-05-17T08:53:01Z
Re: perl source code encryption by Gowtham M

From: Gowtham M On Wed, Apr 30, 2008 at 10:41 AM, Anirban Adhikary <
anirban.adhikary@gmail.com> wrote:

> Dear list


Hello

>
> I want to encrypt my perl source code. I am using some modules in my code.
> Among them some are downloaded from CPAn as well as some are written by my
> -self. So how to encrypt all perl codes includes the modules.


This may not be encryption but it might help in hiding your perl code.

You might consider compiling your perl code to a native binary.

http://www.indigostar.com/perl2exe.htm

I believe there is one such tool available in standard perl distro (perlcc)
This perlcc was experimental when I first had a look at it (long time back),
not sure how stable it
is now.


>
> Thanks&Regards in advance
> Anirban Adhikary
>


- Gowtham

2008-05-17T08:13:12Z
Re: learning perl 3rd vs 4th by Rob Dixon

From: Rob Dixon Richard Lee wrote:
> Currently I own a 'learning perl' 3rd edition and I noticed that 5th
> version is coming out in june.
> What I didn't realize was that learning perl 4th edition's been out
> since 2005.
>
> I was going to order 5th version in june but does anyone in here know
> the different between 3rd and 4th version?
> Is there a big difference?

Randal will tell you exactly what has changed if you can be patient until he
notices this thread. But unless you're keen to save money by buying an old copy
I'm sure it will be well worth waiting for the 5th edition in a few weeks.

Rob

2008-05-17T07:59:44Z
learning perl 3rd vs 4th by Richard Lee

From: Richard Lee Currently I own a 'learning perl' 3rd edition and I noticed that 5th
version is coming out in june.
What I didn't realize was that learning perl 4th edition's been out
since 2005.

I was going to order 5th version in june but does anyone in here know
the different between 3rd and 4th version?
Is there a big difference?

2008-05-17T06:23:26Z
Re: Multiline comment in Perl by Octavian Rasnita

From: Octavian Rasnita From: "Rob Dixon" <rob.dixon@gmx.com>
> (Once again, please bottom-post replies to this group. It maintains
> readability
> for extended threads. Salutations and signatures should always be edited
> out.
> You are responsible for the whole of your post, not just your own
> material.)

Maybe it improves the readability for the sighted, but well... I am blind
and I usually don't like to parse and read tens of lines until I reach the
few lines I need.
There is not a single accepted way of posting to a group. On the lists that
most of the users are Unix/Linux users, the most easy way is to bottom-post,
and I usually do that, unless I forget that I need to temporary change my
style, but when I want to send a final message and I don't need any answer
for it, I use to top-post.

> There are many things that "don't break the program" but are far from good
> programming practice. Start by taking out all whitespace, for example.
> When we think there is very little chance of our code being read by
> someone else
> or processed in a way we didn't anticipate, the World will surprise us.
> Being
> nice to the people who expect our program to be Pod-clean is part of the
> Perl
> ethos, and should be honoured.

As I said, for commenting more lines of text, perl doesn't have a mark, so I
am not creating a perl documentation. Why should I use a certain style for
creating a comment?
Other users won't see it, because those comments are usually temporary,
sometimes used when I don't want to include a piece of code in the program.

> The documentation that John referred you to recommends
>
> =begin comment
> :
> =end

And is this a valid perldoc mark?

> As a last resort you could make a case for not being nice to people and we
> will
> consider it here.

Please be so kind and explain what do you want to say, because I don't
understand your phrase. English is not my native language.
Do you want to say that I wasn't kind or that I said something badly to
someone?

Octavian


2008-05-16T22:31:12Z
Re: Multiline comment in Perl by Rob Dixon

From: Rob Dixon Octavian Rasnita wrote:
>
> From: "John W. Krahn" <krahnj@telus.net>
>
>> Octavian Rasnita wrote:
>>
>>> ----- Original Message ----- From: "sivasakthi" <msivasakthi@gmail.com>
>>>
>>>> How to comment Multiple lines in Perl?
>>>
>>> Perl doesn't have a multiline comment mark.
>>>
>>> You can use perldoc marks in order to comment what you want, or include
>>> the content in a string, like:
>>>
>>> Perldoc style:
>>>
>>> =start
>>> Here
>>> are the
>>> lines you
>>> want to comment
>>> =cut
>>
>> $ echo "
>>
>> =start
>> Here
>> are the
>> lines you
>> want to comment
>> =cut
>>
>> " | podchecker
>> *** ERROR: Unknown command 'start' at line 3 in file <standard input>
>> <&STDIN does not contain any pod commands.
>>
>
> I know that =start is not a valid POD command, but it doesn't break the
> program. When I use it, I don't need to use it to add real POD docs, so the
> commands shouldn't be valid.
>
> =head1 NAME
> is too long...

(Once again, please bottom-post replies to this group. It maintains readability
for extended threads. Salutations and signatures should always be edited out.
You are responsible for the whole of your post, not just your own material.)

There are many things that "don't break the program" but are far from good
programming practice. Start by taking out all whitespace, for example.

When we think there is very little chance of our code being read by someone else
or processed in a way we didn't anticipate, the World will surprise us. Being
nice to the people who expect our program to be Pod-clean is part of the Perl
ethos, and should be honoured.

Neither

=start

nor

=comment

are valid POD, and

=head1 NAME

is even worse, because it means something that you don't intend.

The documentation that John referred you to recommends

=begin comment
:
=end

Which may be a trifle awkward, but I'm sure there are worse things that happen
to you in your day. It takes less than a second to type, and if you do it a lot
you could set up a macro in your editor.

As a last resort you could make a case for not being nice to people and we will
consider it here.

HTH,

Rob



2008-05-16T16:03:05Z
Re: Multiline comment in Perl by Octavian Rasnita

From: Octavian Rasnita I know that =start is not a valid POD command, but it doesn't break the
program. When I use it, I don't need to use it to add real POD docs, so the
commands shouldn't be valid.

=head1 NAME
is too long...

Octavian

----- Original Message -----
From: "John W. Krahn" <krahnj@telus.net>
To: "Perl Beginners" <beginners@perl.org>
Sent: Friday, May 16, 2008 7:53 PM
Subject: Re: Multiline comment in Perl


> Octavian Rasnita wrote:
>>
>> ----- Original Message ----- From: "sivasakthi" <msivasakthi@gmail.com>
>>>
>>> How to comment Multiple lines in Perl?
>>
>> Perl doesn't have a multiline comment mark.
>>
>> You can use perldoc marks in order to comment what you want, or include
>> the content in a string, like:
>>
>> Perldoc style:
>>
>> =start
>> Here
>> are the
>> lines you
>> want to comment
>> =cut
>
> $ echo "
>
> =start
> Here
> are the
> lines you
> want to comment
> =cut
>
> " | podchecker
> *** ERROR: Unknown command 'start' at line 3 in file <standard input>
> <&STDIN does not contain any pod commands.
>
>
>
> John
> --
> Perl isn't a toolbox, but a small machine shop where you
> can special-order certain sorts of tools at low cost and
> in short order. -- Larry Wall
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> http://learn.perl.org/
>
>

2008-05-16T14:53:06Z
Re: Initialize object permanently by Rob Dixon

From: Rob Dixon anthony brooke wrote:
>
> Rob Dixon wrote:
>>
>> (I couldn't be bothered to reformat your post this time. Please bottom-post
>> on this group. It's said several times a week.)
>
> (Sorry, I really don't know about that, could you tell why must it in
> bottom ?)

Because extended threads become very hard to read if they're top-posted. Making
tidy posts about a programming language that may include embedded code is hard
to do anyway, and if they have to be read from the end backwards it makes them
even less likely to be understood. You should remove all sigs and salutations
and anything that's irrelevant to your own post. Each of us is responsible for
the formatting of all that we quote as well as our own material, and all posts
should make sense in isolation if read from the beginning to the end.

> Someone has given me a seems good solution,
> http://groups.google.com/group/comp.lang.perl.misc/browse_thread/thread/5e2d923994e833d9#
>
> I am going to dig more about mod_perl

Good. It would be nice if you let us know if you find a solution, or indeed if
you still need help :)

Rob

2008-05-16T11:55:02Z
Re: Initialize object permanently by Rob Dixon

From: Rob Dixon anthony brooke wrote:
>
> Thanks for the reply, it's a dynamic server side script that currently
> using CGI, but I am going for mod_perl. The interface is something like
> Google, so everytime the user make a request to lookup let's say the
> meaning of a word, the WordNet object have to be initialized. Is there a
> work around of this with mod_perl ? Thanks

(I couldn't be bothered to reformat your post this time. Please bottom-post on
this group. It's said several times a week.)

mod_perl is very lovely, but is also a niche application of Perl. From my
limited understanding of how it works I feel certain that it can maintain an
open dictionary for you, but you need more specific help than I can offer.

Does anybody have a simple answer to this, or know about a mod_perl list?

Rob

2008-05-16T11:22:49Z
Re: Initialize object permanently by anthony brooke

From: anthony brooke Thanks for the reply, it's a dynamic server side script that currently using CGI, but I am going for mod_perl. The interface is something like Google, so everytime the user make a request to lookup let's say the meaning of a word, the WordNet object have to be initialized. Is there a work around of this with mod_perl ? Thanks


----- Original Message ----
From: Rob Dixon <rob.dixon@gmx.com>
To: beginner perl mailling list <beginners@perl.org>
Cc: anthony brooke <esia168@yahoo.com>
Sent: Saturday, May 17, 2008 0:47:52
Subject: Re: Initialize object permanently

anthony brooke wrote:
>
> Hello, I am using Wordnet::QueryData which allow access to a very huge dictionary data. The initialization of object
> my $wn = WordNet::QueryData->new;
>
> took
> 2 wallclock secs ( 2.36 usr + 0.07 sys = 2.43 CPU)
>
> Then the subsequent request for the data is exetremely fast
>
> For the lines below took
> 0 wallclock secs ( 0.00 usr + 0.00 sys = 0.00 CPU)
>
> print "Synset: ", join(", ", $wn->querySense("cat#n#7", "syns")), "\n";
> print "Hyponyms: ", join(", ", $wn->querySense("cat#n#1", "hypo")), "\n";
> print "Parts of Speech: ", join(", ", $wn->querySense("run")), "\n";
> print "Senses: ", join(", ", $wn->querySense("run#v")), "\n";
> print "Forms: ", join(", ", $wn->validForms("lay down#v")), "\n";
> print "Noun count: ", scalar($wn->listAllWords("noun")), "\n";
> print "Antonyms: ", join(", ", $wn->queryWord("dark#n#1", "ants")), "\n";
>
> I
> am developing a web application, is there a way to make the
> initialization of object permanently in memory ? I tried to use the
> Storable module. But that only give me a little increase in
> performance. Anybody's idea is very much appreciated, Thank you.

When you say 'web application', do you mean a server-side CGI script or a
client-side program that interrogates the Web and also needs access to the
dictionary?

Rob

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Send instant messages to your online friends http://uk.messenger.yahoo.com

2008-05-16T11:05:24Z
Re: Multiline comment in Perl by John W. Krahn

From: John W. Krahn Octavian Rasnita wrote:
>
> ----- Original Message ----- From: "sivasakthi" <msivasakthi@gmail.com>
>>
>> How to comment Multiple lines in Perl?
>
> Perl doesn't have a multiline comment mark.
>
> You can use perldoc marks in order to comment what you want, or include
> the content in a string, like:
>
> Perldoc style:
>
> =start
> Here
> are the
> lines you
> want to comment
> =cut

$ echo "

=start
Here
are the
lines you
want to comment
=cut

" | podchecker
*** ERROR: Unknown command 'start' at line 3 in file <standard input>
<&STDIN does not contain any pod commands.



John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall

2008-05-16T09:53:09Z
Re: Multiline comment in Perl by John W. Krahn

From: John W. Krahn Beau E. Cox wrote:
> On Thu, May 15, 2008 at 11:24 PM, sivasakthi <msivasakthi@gmail.com> wrote:
>>
>> How to comment Multiple lines in Perl?
>
> =comment
> like this
> example
> =cut

$ echo "

=comment
like this
example
=cut

" | podchecker
*** ERROR: Unknown command 'comment' at line 3 in file <standard input>
<&STDIN does not contain any pod commands.



John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall

2008-05-16T09:49:47Z
Re: Initialize object permanently by Rob Dixon

From: Rob Dixon anthony brooke wrote:
>
> Hello, I am using Wordnet::QueryData which allow access to a very huge dictionary data. The initialization of object
> my $wn = WordNet::QueryData->new;
>
> took
> 2 wallclock secs ( 2.36 usr + 0.07 sys = 2.43 CPU)
>
> Then the subsequent request for the data is exetremely fast
>
> For the lines below took
> 0 wallclock secs ( 0.00 usr + 0.00 sys = 0.00 CPU)
>
> print "Synset: ", join(", ", $wn->querySense("cat#n#7", "syns")), "\n";
> print "Hyponyms: ", join(", ", $wn->querySense("cat#n#1", "hypo")), "\n";
> print "Parts of Speech: ", join(", ", $wn->querySense("run")), "\n";
> print "Senses: ", join(", ", $wn->querySense("run#v")), "\n";
> print "Forms: ", join(", ", $wn->validForms("lay down#v")), "\n";
> print "Noun count: ", scalar($wn->listAllWords("noun")), "\n";
> print "Antonyms: ", join(", ", $wn->queryWord("dark#n#1", "ants")), "\n";
>
> I
> am developing a web application, is there a way to make the
> initialization of object permanently in memory ? I tried to use the
> Storable module. But that only give me a little increase in
> performance. Anybody's idea is very much appreciated, Thank you.

When you say 'web application', do you mean a server-side CGI script or a
client-side program that interrogates the Web and also needs access to the
dictionary?

Rob

2008-05-16T09:48:03Z
Re: Multiline comment in Perl by John W. Krahn

From: John W. Krahn sivasakthi wrote:
> Hi all,

Hello,

> How to comment Multiple lines in Perl?

perldoc -q "How can I comment out a large block of perl code"



John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall

2008-05-16T09:45:58Z
Re: Initialize object permanently by Chas. Owens

From: Chas. Owens On May 16, 2008, at 04:55, anthony brooke wrote:

> Hello, I am using Wordnet::QueryData which allow access to a very
> huge dictionary data. The initialization of object
> my $wn = WordNet::QueryData->new;
>
> took
> 2 wallclock secs ( 2.36 usr + 0.07 sys = 2.43 CPU)
>
> Then the subsequent request for the data is exetremely fast
>
> For the lines below took
> 0 wallclock secs ( 0.00 usr + 0.00 sys = 0.00 CPU)
>
> print "Synset: ", join(", ", $wn->querySense("cat#n#7", "syns")),
> "\n";
> print "Hyponyms: ", join(", ", $wn->querySense("cat#n#1", "hypo")),
> "\n";
> print "Parts of Speech: ", join(", ", $wn->querySense("run")), "\n";
> print "Senses: ", join(", ", $wn->querySense("run#v")), "\n";
> print "Forms: ", join(", ", $wn->validForms("lay down#v")), "\n";
> print "Noun count: ", scalar($wn->listAllWords("noun")), "\n";
> print "Antonyms: ", join(", ", $wn->queryWord("dark#n#1", "ants")),
> "\n";
>
> I
> am developing a web application, is there a way to make the
> initialization of object permanently in memory ? I tried to use the
> Storable module. But that only give me a little increase in
> performance. Anybody's idea is very much appreciated, Thank you.

Your best bet is to take a daemon like approach. Startup a script
that does nothing but respond to requests by other scripts. Take a
look at the IPC::* modules to see how to do inter-process communication.

2008-05-16T07:54:34Z
Re: website by oryann9

From: oryann9 On Thu, May 15, 2008 at 3:45 PM, Dr.Ruud <rvtol+news@isolution.nl> wrote:
> It contains a lot of bad advice too.

You have been helpful in the past so please be so kind to point out
the *bad Advice*... Just saying it's bad really helps no one on a
"beginners" list. The way I see it, people will read that information,
begin to code with it, then when they run into problems they come here
only to be chastised by using such examples. Why not end that loop by
good examples?

-

Horray, Horray! I agree with all stated here. I have been doing Perl for seven years now and still consider myself a beginner at many concepts.



2008-05-16T05:54:22Z
Re: website by Dr.Ruud

From: Dr.Ruud Jerald Sheets schreef:
> Dr.Ruud:
>> Richard Lee:

>>> [www.raycosoft.com/rayco/support/perl_tutor.html]
>>> this is very helpful to me. I always have trouble w/ map and
>>> grep(still do..) but this website is helpful
>>
>> It contains a lot of bad advice too.
>
> Look, someone asked for it by name, and I just obliged. Don't shoot
> the messenger... He packs a gun too...

Jerald, sorry for that.

Could you start quoting sensibly?
Only quote what you react on, certainly not quote signatures.

Each quote should contain just enough context to place your reaction
that follows it.

--
Affijn, Ruud

"Gewoon is een tijger."

2008-05-16T03:15:39Z
Re: Multiline comment in Perl by Octavian Rasnita

From: Octavian Rasnita Hi,

Perl doesn't have a multiline comment mark.

You can use perldoc marks in order to comment what you want, or include the
content in a string, like:

Perldoc style:

=start
Here
are the
lines you
want to comment
=cut

Or using a string:

q/
Here are
the
lines you
want to comment
/;

The program will work fine, but in the second example, if you use

use warnings;

it will tell you that you used this string in a void context.
If you don't like the warning, you could use:

my $zzz = q/
...
/;

The first way is prefered, but the second way allows you to comment one line
or more lines using the same syntax.

Octavian

----- Original Message -----
From: "sivasakthi" <msivasakthi@gmail.com>
To: "beginners perl" <beginners@perl.org>
Sent: Friday, May 16, 2008 12:24 PM
Subject: Multiline comment in Perl


> Hi all,
>
>
> How to comment Multiple lines in Perl?
>
>
>
> Thanks,
> Siva
>
>
>

2008-05-16T03:08:44Z
Re: Multiline comment in Perl by Beau E. Cox

From: Beau E. Cox On Thu, May 15, 2008 at 11:24 PM, sivasakthi <msivasakthi@gmail.com> wrote:
> Hi all,
>
>
> How to comment Multiple lines in Perl?
>
>
>
> Thanks,
> Siva
>

=comment
like this
example
=cut

Aloha => Beau;

2008-05-16T02:28:39Z
Multiline comment in Perl by sivasakthi

From: sivasakthi Hi all,


How to comment Multiple lines in Perl?



Thanks,
Siva



2008-05-16T02:26:03Z
Initialize object permanently by anthony brooke

From: anthony brooke Hello, I am using Wordnet::QueryData which allow access to a very huge dictionary data. The initialization of object
my $wn = WordNet::QueryData->new;

took
2 wallclock secs ( 2.36 usr + 0.07 sys = 2.43 CPU)

Then the subsequent request for the data is exetremely fast

For the lines below took
0 wallclock secs ( 0.00 usr + 0.00 sys = 0.00 CPU)

print "Synset: ", join(", ", $wn->querySense("cat#n#7", "syns")), "\n";
print "Hyponyms: ", join(", ", $wn->querySense("cat#n#1", "hypo")), "\n";
print "Parts of Speech: ", join(", ", $wn->querySense("run")), "\n";
print "Senses: ", join(", ", $wn->querySense("run#v")), "\n";
print "Forms: ", join(", ", $wn->validForms("lay down#v")), "\n";
print "Noun count: ", scalar($wn->listAllWords("noun")), "\n";
print "Antonyms: ", join(", ", $wn->queryWord("dark#n#1", "ants")), "\n";

I
am developing a web application, is there a way to make the
initialization of object permanently in memory ? I tried to use the
Storable module. But that only give me a little increase in
performance. Anybody's idea is very much appreciated, Thank you.


William

Send instant messages to your online friends http://uk.messenger.yahoo.com

2008-05-16T01:55:39Z
Re: website by Omega -1911

From: Omega -1911 On Thu, May 15, 2008 at 3:45 PM, Dr.Ruud <rvtol+news@isolution.nl> wrote:
> It contains a lot of bad advice too.

You have been helpful in the past so please be so kind to point out
the *bad Advice*... Just saying it's bad really helps no one on a
"beginners" list. The way I see it, people will read that information,
begin to code with it, then when they run into problems they come here
only to be chastised by using such examples. Why not end that loop by
good examples?

2008-05-15T21:25:19Z
Re: How to get perl (for Windows) with modules like OLE and Spreadsheet and such included by roger61611 <p>From: roger61611 On May 15, 9:34&nbsp;am, nore...@gunnar.cc (Gunnar Hjalmarsson) wrote:<br/>&gt; roger61...@yahoo.com wrote:<br/>&gt; &gt; Hello, Is there someplace I can get perl (for Windows) with modules<br/>&gt; &gt; like OLE and Spreadsheet and such included already ? &nbsp;The PC here is<br/>&gt; &gt; sort of old and it would be neat to just download oerl (w/ modules)<br/>&gt; &gt; and start working vs downloading perl and then downlading/installing<br/>&gt; &gt; module by module.<br/>&gt;<br/>&gt; http://www.indigostar.com/indigoperl.htm<br/>&gt;<br/>&gt; --<br/>&gt; Gunnar Hjalmarsson<br/>&gt; Email:http://www.gunnar.cc/cgi-bin/contact.pl<br/><br/>thank you !<br/><br/></p> 2008-05-15T16:36:59Z Re: website by Jerald Sheets PHA+RnJvbTogSmVyYWxkIFNoZWV0cwoKTG9vaywgc29tZW9uZSBhc2tlZCBmb3IgaXQgYnkgbmFtZSwgYW5kIEkganVzdCBvYmxpZ2VkLiAgRG9uJiMzOTt0IHNob290ICA8YnIvPnRoZSBtZXNzZW5nZXIuLi4gIEhlIHBhY2tzIGEgZ3VuIHRvby4uLjxici8+PGJyLz46KTxici8+PGJyLz5KZXJhbGQgU2hlZXRzPGJyLz48YnIvPlNlbnQgZnJvbSBteSBpUGhvbmU8YnIvPlBsZWFzZSBkaXNyZWdhcmQgc3BlbGxpbmcvZ3JhbW1hciBlcnJvcnM8YnIvPjxici8+T24gTWF5IDE1LCAyMDA4LCBhdCAzOjQ1IFBNLCAmcXVvdDtEci5SdXVkJnF1b3Q7ICZsdDtydnRvbCtuZXdzQGlzb2x1dGlvbi5ubCZndDsgd3JvdGU6PGJyLz48YnIvPiZndDsgUmljaGFyZCBMZWUgc2NocmVlZjo8YnIvPiZndDsmZ3Q7IEplcmFsZCBTaGVldHM6PGJyLz4mZ3Q7PGJyLz4mZ3Q7Jmd0OyZndDs8YnIvPiZndDsgaHR0cDovL3dlYi5hcmNoaXZlLm9yZy93ZWIvMjAwMjEwMDQwMzAwMjcvd3d3LnJheWNvc29mdC5jb20vcmF5Y28vc3VwcG9ydC9wZXJsX3R1dG9yLmh0bWw8YnIvPiZndDsmZ3Q7PGJyLz4mZ3Q7Jmd0OyB0aGlzIGlzIHZlcnkgaGVscGZ1bCB0byBtZS4gSSBhbHdheXMgaGF2ZSB0cm91YmxlIHcvIG1hcCBhbmQ8YnIvPiZndDsmZ3Q7IGdyZXAoc3RpbGwgZG8uLikgYnV0IHRoaXMgd2Vic2l0ZSBpcyBoZWxwZnVsPGJyLz4mZ3Q7Jmd0Ozxici8+Jmd0OyZndDsgdGhhbmsgeW91IHRvIGJyaW5nIHVwIHRoaXMgd2Vic2l0ZSEhPGJyLz4mZ3Q7PGJyLz4mZ3Q7IEl0IGNvbnRhaW5zIGEgbG90IG9mIGJhZCBhZHZpY2UgdG9vLjxici8+Jmd0Ozxici8+Jmd0OyAtLSA8YnIvPiZndDsgQWZmaWpuLCBSdXVkIChhbmQgUmljaGFyZCwgc2VlIGhvdyBJIHF1b3RlZCwgc3RhcnQgdG8gdHJpbSB5b3VyIHBvc3RzKTxici8+Jmd0Ozxici8+Jmd0OyAmcXVvdDtHZXdvb24gaXMgZWVuIHRpamdlci4mcXVvdDs8YnIvPiZndDs8YnIvPiZndDs8YnIvPiZndDsgLS0gPGJyLz4mZ3Q7IFRvIHVuc3Vic2NyaWJlLCBlLW1haWw6IGJlZ2lubmVycy11bnN1YnNjcmliZUBwZXJsLm9yZzxici8+Jmd0OyBGb3IgYWRkaXRpb25hbCBjb21tYW5kcywgZS1tYWlsOiBiZWdpbm5lcnMtaGVscEBwZXJsLm9yZzxici8+Jmd0OyBodHRwOi8vbGVhcm4ucGVybC5vcmcvPGJyLz4mZ3Q7PGJyLz4mZ3Q7PGJyLz48L3A+ 2008-05-15T14:28:11Z Re: website by Dr.Ruud

From: Dr.Ruud Richard Lee schreef:
> Jerald Sheets:

>>
http://web.archive.org/web/20021004030027/www.raycosoft.com/rayco/support/perl_tutor.html
>
> this is very helpful to me. I always have trouble w/ map and
> grep(still do..) but this website is helpful
>
> thank you to bring up this website!!

It contains a lot of bad advice too.

--
Affijn, Ruud (and Richard, see how I quoted, start to trim your posts)

"Gewoon is een tijger."

2008-05-15T12:46:25Z
Re: website by Richard Lee

From: Richard Lee Jerald Sheets wrote:
>
> Here's one that's still in there:
>
> http://web.archive.org/web/20021004030027/www.raycosoft.com/rayco/support/perl_tutor.html
>
>
> Get it while it's good.
>
> Also, check out PerlMonks & The OReilley Perl site. Also, PlanetPerl
> is very helpful from time to time.
>
> --jms
>
>
> On May 15, 2008, at 11:42 AM, oryann9 wrote:
>
>> Does anyone know what happened to this website:
>> http://web.archive.org/web/20041123005900/http://www.raycosoft.com/rayco/support/perl_tutor.html
>>
>> It says its not available. I thought it was a great reference and
>> explained the diffs between map and grep and even sort.
>> Does anyone have a softcopy of its data that you can send me?
>>
>> thank you!
>>
>>
>>
>>
>>
>> --
>> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
>> For additional commands, e-mail: beginners-help@perl.org
>> http://learn.perl.org/
>>
>>
>
>
this is very helpful to me. I always have trouble w/ map and grep(still
do..) but this website is helpful

thank you to bring up this website!!

2008-05-15T12:28:49Z
Re: Sorting and grouping question by Li, Jialin

From: Li, Jialin On Thu, May 15, 2008 at 12:13 PM, ANJAN PURKAYASTHA <
anjan.purkayastha@gmail.com> wrote:

> Hi,
> here is a problem I'm working on. It's not PERL-specific, rather it is a
> problem in sorting followed by grouping.
> Suppose I have a set of lines that have tab-delimited text, thus:
> 1 w 3 wer
> 2 a 4 rte
> 4 w 2 weg
> 6 d 4 fhg
> 5 d 7 dfl
> 6 w 4 ald
> 8 a 3 dsl
>
> I would like to first sort the lines based on the 2nd token (w,a, w, d,
> etc)
> and then group the lines based on the 2nd token.
>
> At the end of this sorting/grouping I should have the lines grouped thus:
> 2 a 4 rte
> 8 a 3 dsl
>
> 6 d 4 fhg
> 5 d 7 dfl
>
> 1 w 3 wer
> 4 w 2 weg
> 6 w 4 ald
>
>
> I can figure out the sorting. Are they any command/modules to do the
> grouping based on identical tokens?
>
> appreciate your input.
>
>
> tia,
> anjan
>
>
>
> --
> ANJAN PURKAYASTHA, PhD.
> Senior Computational Biologist
> ==========================
>
> 1101 King Street, Suite 310,
> Alexandria, VA 22314.
> 703.518.8040 (office)
> 703.740.6939 (mobile)
>
> email:
> anjan@vbi.vt.edu;
> anjan.purkayastha@gmail.com
>
> http://www.vbi.vt.edu
>
> ==========================
>


hash of array will solve your problem

use strict;
use warnings;

my %HofA;

map { push @{ $HofA{ (split)[1] } }, $_ } <DATA> ;

for my $key (sort keys %HofA) {
print $_ for @{ $HofA{$key} };
print "\n";
}


__DATA__
1 w 3 wer
2 a 4 rte
4 w 2 weg
6 d 4 fhg
5 d 7 dfl
6 w 4 ald
8 a 3 dsl

2008-05-15T11:00:04Z
Sorting and grouping question by ANJAN PURKAYASTHA

From: ANJAN PURKAYASTHA Hi,
here is a problem I'm working on. It's not PERL-specific, rather it is a
problem in sorting followed by grouping.
Suppose I have a set of lines that have tab-delimited text, thus:
1 w 3 wer
2 a 4 rte
4 w 2 weg
6 d 4 fhg
5 d 7 dfl
6 w 4 ald
8 a 3 dsl

I would like to first sort the lines based on the 2nd token (w,a, w, d, etc)
and then group the lines based on the 2nd token.

At the end of this sorting/grouping I should have the lines grouped thus:
2 a 4 rte
8 a 3 dsl

6 d 4 fhg
5 d 7 dfl

1 w 3 wer
4 w 2 weg
6 w 4 ald


I can figure out the sorting. Are they any command/modules to do the
grouping based on identical tokens?

appreciate your input.


tia,
anjan



--
ANJAN PURKAYASTHA, PhD.
Senior Computational Biologist
==========================

1101 King Street, Suite 310,
Alexandria, VA 22314.
703.518.8040 (office)
703.740.6939 (mobile)

email:
anjan@vbi.vt.edu;
anjan.purkayastha@gmail.com

http://www.vbi.vt.edu

==========================

2008-05-15T10:13:22Z
Re: pushing errors to another sub by Chas. Owens

From: Chas. Owens
On May 14, 2008, at 20:25, Robert Hicks wrote:

> just "bad" pseudo code:
>
> sub one {
> $process->name(\$html) || $errors_from_one( $process->error() );
>
> $process->name(\$text) || $errors_from_one( $process->error() );
> }
>
> sub errors_from_one {
> my $error = @_;
>
> push (my @errors, $error);
>
> # do stuff to make sure the errors are uniq
>
> return my @uniq_error_list;
> }
>
>
> I want to be able to get at those errors later. Will something like
> that work?
>
> Robert

You may be better off creating a set of objects to handle this, but
here is a lightweight solution:

{ #limit visibility of @queue to these two functions
my @queue;
sub save_errors { push @queue, @_; }
sub handle_errors {
for my $error (@queue) {
#do something
}
}
}

sub one {
$process->name(\$html) or save_errors($process->error);
$process->name(\$text) or save_errors($process->error);
}

2008-05-15T09:41:50Z
Re: website by Jerald Sheets

From: Jerald Sheets
Here's one that's still in there:

http://web.archive.org/web/20021004030027/www.raycosoft.com/rayco/support/perl_tutor.html

Get it while it's good.

Also, check out PerlMonks & The OReilley Perl site. Also, PlanetPerl
is very helpful from time to time.

--jms


On May 15, 2008, at 11:42 AM, oryann9 wrote:

> Does anyone know what happened to this website: http://web.archive.org/web/20041123005900/http://www.raycosoft.com/rayco/support/perl_tutor.html
> It says its not available. I thought it was a great reference and
> explained the diffs between map and grep and even sort.
> Does anyone have a softcopy of its data that you can send me?
>
> thank you!
>
>
>
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> http://learn.perl.org/
>
>


2008-05-15T08:51:12Z
website by oryann9

From: oryann9 Does anyone know what happened to this website: http://web.archive.org/web/20041123005900/http://www.raycosoft.com/rayco/support/perl_tutor.html
It says its not available. I thought it was a great reference and explained the diffs between map and grep and even sort.
Does anyone have a softcopy of its data that you can send me?

thank you!




2008-05-15T08:43:24Z
Re: How to get perl (for Windows) with modules like OLE and Spreadsheetand such included by Gunnar Hjalmarsson

From: Gunnar Hjalmarsson roger61611@yahoo.com wrote:
> Hello, Is there someplace I can get perl (for Windows) with modules
> like OLE and Spreadsheet and such included already ? The PC here is
> sort of old and it would be neat to just download oerl (w/ modules)
> and start working vs downloading perl and then downlading/installing
> module by module.

http://www.indigostar.com/indigoperl.htm

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

2008-05-15T06:34:42Z
How to get perl (for Windows) with modules like OLE and Spreadsheet and such included by roger61611

From: roger61611 Hello, Is there someplace I can get perl (for Windows) with modules
like OLE and Spreadsheet and such included already ? The PC here is
sort of old and it would be neat to just download oerl (w/ modules)
and start working vs downloading perl and then downlading/installing
module by module.

Thank you.

2008-05-15T04:20:34Z
pushing errors to another sub by Robert Hicks

From: Robert Hicks just "bad" pseudo code:

sub one {
$process->name(\$html) || $errors_from_one( $process->error() );

$process->name(\$text) || $errors_from_one( $process->error() );
}

sub errors_from_one {
my $error = @_;

push (my @errors, $error);

# do stuff to make sure the errors are uniq

return my @uniq_error_list;
}


I want to be able to get at those errors later. Will something like that
work?

Robert


2008-05-14T17:25:41Z
Re: items in array by Gunnar Hjalmarsson

From: Gunnar Hjalmarsson [ Please do not top-post! ]

Tech list wrote:
> Dr.Ruud wrote:
>> "Li, Jialin" schreef:
>>> On Wed, May 14, 2008 at 4:01 PM, Tech list
>>> <tech_list@womenshealth.com> wrote:
>>>> what is the correct way to get the number of items in an array?
>>>>
>>>> I used to use $#array
>>>
>>> $#array is the index of the last item, so the number should be
>>> $#array + 1, or
>>> scalar @array
>>
>> Please read perlvar about $[. Normally it is 0, but you can set it to a
>> different value, like -3 or 27.
>>
>> The $#array is the last index of @array, so $array[$#array] is
>> equivalent to $array[-1].
>>
>> The number of items in an array is returned by @array in scalar context,
>> examples:
>>
>> scalar(@array)
>>
>> (0+ @array)
>>
>> if (0 < @array) { ... }
>>
>> if (@array) { ... }
>
> Is $#array deprecated or not?

It's not deprecated. But, as others already have explained, it does not
represent the number of items in an array, which is what you asked
about, after all.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

2008-05-14T15:55:52Z