Re: Multiline comment in Perl

2008-05-16 Thread Octavian Rasnita

From: "Rob Dixon" <[EMAIL PROTECTED]>
(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



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Multiline comment in Perl

2008-05-16 Thread Rob Dixon
Octavian Rasnita wrote:
> 
> From: "John W. Krahn" <[EMAIL PROTECTED]>
> 
>> Octavian Rasnita wrote:
>>
>>> - Original Message - From: "sivasakthi" <[EMAIL PROTECTED]>
>>>
 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 
>> <&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




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Multiline comment in Perl

2008-05-16 Thread 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" <[EMAIL PROTECTED]>

To: "Perl Beginners" 
Sent: Friday, May 16, 2008 7:53 PM
Subject: Re: Multiline comment in Perl



Octavian Rasnita wrote:


- Original Message - From: "sivasakthi" <[EMAIL PROTECTED]>


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 
<&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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/





--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Initialize object permanently

2008-05-16 Thread 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

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Initialize object permanently

2008-05-16 Thread 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

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Initialize object permanently

2008-05-16 Thread 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 <[EMAIL PROTECTED]>
To: beginner perl mailling list 
Cc: anthony brooke <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/

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

Re: Multiline comment in Perl

2008-05-16 Thread John W. Krahn

Octavian Rasnita wrote:


- Original Message - From: "sivasakthi" <[EMAIL PROTECTED]>


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 
<&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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Multiline comment in Perl

2008-05-16 Thread John W. Krahn

Beau E. Cox wrote:

On Thu, May 15, 2008 at 11:24 PM, sivasakthi <[EMAIL PROTECTED]> 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 
<&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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Initialize object permanently

2008-05-16 Thread 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

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Multiline comment in Perl

2008-05-16 Thread 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

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Initialize object permanently

2008-05-16 Thread 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.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: website

2008-05-16 Thread oryann9
On Thu, May 15, 2008 at 3:45 PM, Dr.Ruud <[EMAIL PROTECTED]> 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.


  

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: website

2008-05-16 Thread 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."


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Multiline comment in Perl

2008-05-16 Thread 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" <[EMAIL PROTECTED]>

To: "beginners perl" 
Sent: Friday, May 16, 2008 12:24 PM
Subject: Multiline comment in Perl



Hi all,


How to comment Multiple lines  in Perl?



Thanks,
Siva






--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Multiline comment in Perl

2008-05-16 Thread Beau E. Cox
On Thu, May 15, 2008 at 11:24 PM, sivasakthi <[EMAIL PROTECTED]> wrote:
> Hi all,
>
>
> How to comment Multiple lines  in Perl?
>
>
>
> Thanks,
> Siva
>

=comment
like this
example
=cut

Aloha => Beau;

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Multiline comment in Perl

2008-05-16 Thread sivasakthi
Hi all,


How to comment Multiple lines  in Perl?



Thanks,
Siva




Initialize object permanently

2008-05-16 Thread 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