Re: Curly braces and the logic of PERL

2008-10-29 Thread Chas. Owens
On Thu, Oct 30, 2008 at 00:40, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote: > On Thu, 2008-10-30 at 04:05 +, Rob Dixon wrote: >> Mr. Shawn H. Corey wrote: >> > >> > I don't have any serious objections to the way this list is run. I do >> > object >> > to some actions individuals have taken.

Re: Curly braces and the logic of PERL

2008-10-29 Thread Mr. Shawn H. Corey
On Thu, 2008-10-30 at 04:05 +, Rob Dixon wrote: > Mr. Shawn H. Corey wrote: > > > > I don't have any serious objections to the way this list is run. I do > > object > > to some actions individuals have taken. Such as lying. If no such poll > > exists, don't claim that is does. > > I am re

Re: Curly braces and the logic of PERL

2008-10-29 Thread Rob Dixon
Mr. Shawn H. Corey wrote: > > I don't have any serious objections to the way this list is run. I do object > to some actions individuals have taken. Such as lying. If no such poll > exists, don't claim that is does. I am responding to this only because you have chosen to call me a liar. I am n

Re: Curly braces and the logic of PERL

2008-10-29 Thread Mr. Shawn H. Corey
On Wed, 2008-10-29 at 23:41 +, Rob Dixon wrote: > Mr. Shawn H. Corey wrote: > > On Wed, 2008-10-29 at 01:20 +, Rob Dixon wrote: > >> > >> bottom-posting being a de-facto standard on this list, and despite > a > >> majority of subscribers expecting it and preferring it > > > > Really? When

Re: Curly braces and the logic of PERL

2008-10-29 Thread Rob Dixon
Jack Gates wrote: > > Rob, My comments were not directed to you. > > My comment was directed at Jenda because Jenda's comments came > across as flat not giving a da?? about people with phyiscal > challenges and that is what I was attacking. Your comments were directed to everyone on the perl.b

Re: Curly braces and the logic of PERL

2008-10-29 Thread Rob Dixon
Mr. Shawn H. Corey wrote: > On Wed, 2008-10-29 at 01:20 +, Rob Dixon wrote: >> >> bottom-posting being a de-facto standard on this list, and despite a >> majority of subscribers expecting it and preferring it > > Really? When was the last poll conducted and where were its results > published?

RE: Curly braces and the logic of PERL

2008-10-29 Thread Richard.Copits
emails and a braile keyboard. That does put a whole new slant on things. -Original Message- From: Jenda Krynicky [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2008 6:36 AM To: beginners@perl.org Subject: Re: Curly braces and the logic of PERL From: Jack Gates <[EMAIL

Re: Curly braces and the logic of PERL

2008-10-29 Thread Jack Gates
On Tuesday 28 October 2008 10:06:44 am Jenda Krynicky wrote: > > We can't care about ALL those who read it. The best we can do is > to care about MOST. I know it's inconvenient if you are not part > of the majority, but there is little we can do. > That is a cold, callous, self serving statement.

Re: Curly braces and the logic of PERL

2008-10-29 Thread Jenda Krynicky
From: Jack Gates <[EMAIL PROTECTED]> > On Tuesday 28 October 2008 09:20:30 pm Rob Dixon wrote: > > Jack Gates wrote: > > > On Tuesday 28 October 2008 10:06:44 am Jenda Krynicky wrote: > > >> We can't care about ALL those who read it. The best we can do > > >> is to care about MOST. I know it's inco

Re: Curly braces and the logic of PERL

2008-10-29 Thread Jenda Krynicky
From: Rob Dixon <[EMAIL PROTECTED]> > I have a particular issue with statements like > > /\Q$string/ && print $REPORT "$File::Find::name\n" and return; > > which are ugly in the extreme and do not begin to read as English. The style > comes from Perl's origins on the Unix platform, and use of s

Re: Curly braces and the logic of PERL

2008-10-28 Thread Jack Gates
On Tuesday 28 October 2008 09:20:30 pm Rob Dixon wrote: > Jack Gates wrote: > > On Tuesday 28 October 2008 10:06:44 am Jenda Krynicky wrote: > >> We can't care about ALL those who read it. The best we can do > >> is to care about MOST. I know it's inconvenient if you are not > >> part of the majori

Re: Curly braces and the logic of PERL

2008-10-28 Thread Mr. Shawn H. Corey
On Wed, 2008-10-29 at 01:20 +, Rob Dixon wrote: > bottom-posting being a de-facto standard on > this list, and despite a majority of subscribers expecting it and > preferring it Really? When was the last poll conducted and where were its results published? -- Just my 0.0002 million dol

Re: Curly braces and the logic of PERL

2008-10-28 Thread Rob Dixon
Chas. Owens wrote: > On Mon, Oct 27, 2008 at 20:28, Rob Dixon <[EMAIL PROTECTED]> wrote: >> John W. Krahn wrote: >>> >>> The fewer lines of code to read and/or write, the easier it is to spot >>> mistakes, the less chance for "action at a distance." >> >> Not at all. >> >> Is this >> >> sub wanted

Re: Curly braces and the logic of PERL

2008-10-28 Thread Rob Dixon
Jack Gates wrote: > On Tuesday 28 October 2008 10:06:44 am Jenda Krynicky wrote: >> >> We can't care about ALL those who read it. The best we can do is >> to care about MOST. I know it's inconvenient if you are not part >> of the majority, but there is little we can do. > > That is a cold, callous

Re: Curly braces and the logic of PERL

2008-10-28 Thread Octavian Rasnita
From: "Jack Gates" <[EMAIL PROTECTED]> On Tuesday 28 October 2008 10:06:44 am Jenda Krynicky wrote: We can't care about ALL those who read it. The best we can do is to care about MOST. I know it's inconvenient if you are not part of the majority, but there is little we can do. That is a cold

Re: Curly braces and the logic of PERL

2008-10-28 Thread Jack Gates
On Tuesday 28 October 2008 10:06:44 am Jenda Krynicky wrote: > > We can't care about ALL those who read it. The best we can do is > to care about MOST. I know it's inconvenient if you are not part > of the majority, but there is little we can do. > That is a cold, callous, self serving statement.

Re: Curly braces and the logic of PERL

2008-10-28 Thread Octavian Rasnita
From: "Jenda Krynicky" <[EMAIL PROTECTED]> That's nice and dandy if you do read the thread in one go. If you read the original message, then half a day later three separate responses, next day a response to the third response and another response to the original post and ... and of course in the

Re: Curly braces and the logic of PERL

2008-10-28 Thread Jenda Krynicky
From: "Octavian Rasnita" <[EMAIL PROTECTED]> > Well, this is a limited approach, generated exactly by the fact that some > programmers don't really care about all those who read, but care the most > about their own preferences. We can't care about ALL those who read it. The best we can do is to

Re: Curly braces and the logic of PERL

2008-10-28 Thread Telemachus
On Mon Oct 27 2008 @ 12:35, John W. Krahn wrote: > The fewer lines of code to read and/or write, the easier it is to spot > mistakes, the less chance for "action at a distance." I find that there's a point, however, where compression and understanding cross paths. After that, the fewer lines and

Re: Curly braces and the logic of PERL

2008-10-27 Thread Chas. Owens
On Mon, Oct 27, 2008 at 20:28, Rob Dixon <[EMAIL PROTECTED]> wrote: > John W. Krahn wrote: >> >> The fewer lines of code to read and/or write, the easier it is to spot >> mistakes, the less chance for "action at a distance." > > Not at all. > > Is this > > sub wanted { return unless -f; open my $FH

Re: Curly braces and the logic of PERL

2008-10-27 Thread Rob Dixon
John W. Krahn wrote: > > The fewer lines of code to read and/or write, the easier it is to spot > mistakes, the less chance for "action at a distance." Not at all. Is this sub wanted { return unless -f; open my $FH, '<', $_ or die "Cannot open '$_' $!"; while ( <$FH> ) { /\Q$string/ && print $

Re: Curly braces and the logic of PERL

2008-10-27 Thread Octavian Rasnita
"the basic intent is to provide visual clues" Well, this is a limited approach, generated exactly by the fact that some programmers don't really care about all those who read, but care the most about their own preferences. I am blind and the visual clues don't mean anything, but make the thin

Re: Curly braces and the logic of PERL

2008-10-27 Thread John W. Krahn
Brian wrote: Mr. Shawn H. Corey wrote: This code is written this way because the coder has been playing too much Perl Golf ;) The objective of Perl Golf is to write a program to do a simple task in the least number of characters possible. This, of course, makes it harder to read. I must adm

Re: Curly braces and the logic of PERL

2008-10-27 Thread Brian
Mr. Shawn H. Corey wrote: On Mon, 2008-10-27 at 17:05 +, Brian wrote: Hello This code is written this way because the coder has been playing too much Perl Golf ;) The objective of Perl Golf is to write a program to do a simple task in the least number of characters possible. This, of

Re: Curly braces and the logic of PERL

2008-10-27 Thread Brian
Bob McConnell wrote: From: Brian Why is it "good practice" to write PERL the way it is done? Discussing coding styles often degenerates into a religious and/or political argument, but I will try an overview. Don't worry, I'll be gentle. If you care to notice, even the prose above has a c

Re: Curly braces and the logic of PERL

2008-10-27 Thread John W. Krahn
Mr. Shawn H. Corey wrote: On Mon, 2008-10-27 at 17:05 +, Brian wrote: Why is it that some code has no curly braces after print; whilst in others I sometimes see one or more curly braces after it? Will there be a time when print; will fail because there isn't a curly brace followi

Re: Curly braces and the logic of PERL

2008-10-27 Thread Mr. Shawn H. Corey
o it's done that way now. The rule for writing "good" code is to design it as though a recently-graduated new-hire will be maintaining it...because they will be. :) > Why is it that some code has no curly braces after print; whilst in > others I sometimes see one or more

RE: Curly braces and the logic of PERL

2008-10-27 Thread Bob McConnell
From: Brian > > Why is it "good practice" to write PERL the way it is done? > Discussing coding styles often degenerates into a religious and/or political argument, but I will try an overview. The purpose for arranging code in various styles is to assist the next programmer on the project. Whil

Re: Curly braces and the logic of PERL

2008-10-27 Thread Brian
Telemachus wrote: On Mon Oct 27 2008 @ 5:05, Brian wrote: An example of something confusing me is in the sample below find sub { return unless -f; open my $FH, '<', $_ or die "Cannot open '$_' $!"; while ( <$FH> ) { /\Q$string/ && print $REPORT "$File::Find::name\n"

Re: Curly braces and the logic of PERL

2008-10-27 Thread Brian
John W. Krahn wrote: Brian wrote: Hello Hello, An example of something confusing me is in the sample below find sub { return unless -f; open my $FH, '<', $_ or die "Cannot open '$_' $!"; while ( <$FH> ) { /\Q$string/ && print $REPORT "$File::Find::name\n" and

Re: Curly braces and the logic of PERL

2008-10-27 Thread Telemachus
On Mon Oct 27 2008 @ 5:05, Brian wrote: > An example of something confusing me is in the sample below > find sub { > return unless -f; > open my $FH, '<', $_ or die "Cannot open '$_' $!"; > while ( <$FH> ) { > /\Q$string/ && print $REPORT "$File::Find::name\n" and > re

Re: Curly braces and the logic of PERL

2008-10-27 Thread John W. Krahn
"while" line would have been written on one line instead of 3) Why is it "good practice" to write PERL the way it is done? Why is it that some code has no curly braces after print; whilst in others I sometimes see one or more curly braces after it? Will there be a time w

Curly braces and the logic of PERL

2008-10-27 Thread Brian
would have been written on one line instead of 3) Why is it "good practice" to write PERL the way it is done? Why is it that some code has no curly braces after print; whilst in others I sometimes see one or more curly braces after it? Will there be a time when print; will fail because

RE: About the error message in Perl : "Missing right curly braces"

2008-08-22 Thread Stewart Anderson
> -Original Message- > From: Peter Scott [mailto:[EMAIL PROTECTED] > Sent: 21 August 2008 20:14 > To: beginners@perl.org; "Amit Saxena" > Subject: Re: About the error message in Perl : "Missing right curly > braces" > > On Thu, 21 Aug 2008 17:4

Re: About the error message in Perl : "Missing right curly braces"

2008-08-21 Thread Dr.Ruud
"Jenda Krynicky" schreef: > Dr.Ruud: >> Amit Saxena: >>> I want to know the best approach that should be used to find the >>> extra curly brace when any Perl program aborts with the error >>> message as "Missing right curly braces". >>

Re: About the error message in Perl : "Missing right curly braces"

2008-08-21 Thread Peter Scott
On Thu, 21 Aug 2008 17:48:00 +0530, Amit Saxena wrote: >> Load the code into Emacs. Ensure cperl-mode is enabled. Mark the whole >> buffer (control-space at the beginning, then move point to the end). >> Execute M-x indent-region, Look to see where the indentation goes "off". >> > How can we ena

Re: About the error message in Perl : "Missing right curly braces"

2008-08-21 Thread Jenda Krynicky
From: "Dr.Ruud" <[EMAIL PROTECTED]> > "Amit Saxena" schreef: > > > I want to know the best approach that should be used to find the > > extra curly brace when any Perl program aborts with the error message > > as "Missing right curly braces&q

Re: About the error message in Perl : "Missing right curly braces"

2008-08-21 Thread Mr. Shawn H. Corey
On Thu, 2008-08-21 at 17:46 +0530, Amit Saxena wrote: > I am using "vi" on Solaris. > > I can also use "%" in command mode for "vi" to match parenthesis and curly > braces. However this approach results in lots of matching open brace against > the cl

Re: About the error message in Perl : "Missing right curly braces"

2008-08-21 Thread Dr.Ruud
"Amit Saxena" schreef: > I am using "vi" on Solaris. > > I can also use "%" in command mode for "vi" to match parenthesis and > curly braces. However this approach results in lots of matching open > brace against the close one etc when ma

Re: About the error message in Perl : "Missing right curly braces"

2008-08-21 Thread Amit Saxena
On Thu, Aug 21, 2008 at 5:23 PM, Peter Scott <[EMAIL PROTECTED]> wrote: > On Thu, 21 Aug 2008 14:31:07 +0530, Amit Saxena wrote: > > Assuming you are getting the buggy code for the first time and you need > to > > track which line contains that curly brace which is causing that problem, > > what y

Re: About the error message in Perl : "Missing right curly braces"

2008-08-21 Thread Amit Saxena
message in Perl : "Missing right curly > braces" > > > > > > On Thu, Aug 21, 2008 at 2:23 PM, Stewart Anderson < > [EMAIL PROTECTED]> wrote: > > > > -Original Message- > > From: Amit Saxena [mailto:[EMAIL PROTECTED] > > Sent: 21

Re: About the error message in Perl : "Missing right curly braces"

2008-08-21 Thread Peter Scott
On Thu, 21 Aug 2008 14:31:07 +0530, Amit Saxena wrote: > Assuming you are getting the buggy code for the first time and you need to > track which line contains that curly brace which is causing that problem, > what your modified approach be ? Load the code into Emacs. Ensure cperl-mode is enabled

Re: About the error message in Perl : "Missing right curly braces"

2008-08-21 Thread Dr.Ruud
"Amit Saxena" schreef: > I want to know the best approach that should be used to find the > extra curly brace when any Perl program aborts with the error message > as "Missing right curly braces". Many editors have a function to bring your cursor from the

RE: About the error message in Perl : "Missing right curly braces"

2008-08-21 Thread Stewart Anderson
_ From: Amit Saxena [mailto:[EMAIL PROTECTED] Sent: 21 August 2008 10:01 To: Stewart Anderson Cc: Perl Subject: Re: About the error message in Perl : "Missing right curly braces" On Thu, Aug 21, 2008 at 2:23 PM, Stewart Anderson <[EMAIL PROTECTED]> wrote: > --

Re: About the error message in Perl : "Missing right curly braces"

2008-08-21 Thread Amit Saxena
error message in Perl : "Missing right curly > braces" > > > > Hi all, > > > > I want to know the best approach that should be used to find the extra > > curly > > brace when any Perl program aborts with the error message as "Missing > > right &

RE: About the error message in Perl : "Missing right curly braces"

2008-08-21 Thread Stewart Anderson
> -Original Message- > From: Amit Saxena [mailto:[EMAIL PROTECTED] > Sent: 21 August 2008 08:56 > To: Perl > Cc: Amit Saxena > Subject: About the error message in Perl : "Missing right curly braces" > > Hi all, > > I want to know the best approa

About the error message in Perl : "Missing right curly braces"

2008-08-21 Thread Amit Saxena
Hi all, I want to know the best approach that should be used to find the extra curly brace when any Perl program aborts with the error message as "Missing right curly braces". Though the error message is simple enough to suggest that there is an extra curly brace in the Perl progr

Re: curly braces

2001-06-26 Thread Paul
--- Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> wrote: > On Jun 26, Silvio Luis Leite Santana said: > >Why does code 1 work, but code 2 doesn't? > >(the diference is the ; after print) > >$bissexto and { print "OK\n" }; > >$bissexto and { print "OK\n"; }; > > In the first code, Perl thinks you're co

Re: curly braces

2001-06-26 Thread Paul
t; > CODE 1 - WORK > > $bissexto = ; > chop($bissexto); > $bissexto and { print "OK\n" }; > print "end\n"; > > > CODE 2 - DOESN'T WORK > (should it work, I'd wish to put more > than one command inside the curly braces) > > $bissext

Re: curly braces

2001-06-26 Thread Michael Fowler
On Tue, Jun 26, 2001 at 04:07:06PM -0300, Silvio Luis Leite Santana wrote: > $bissexto = ; > chop($bissexto); > $bissexto and { print "OK\n" }; > print "end\n"; You obviously aren't running with warnings on. With warnings turned on, your code produces the following (perl 5.6.1): Useless use

Re: curly braces

2001-06-26 Thread Brett W. McCoy
On Tue, 26 Jun 2001, Silvio Luis Leite Santana wrote: > CODE 2 - DOESN'T WORK > (should it work, I'd wish to put more > than one command inside the curly braces) > > $bissexto = ; > chop($bissexto); > $bissexto and { print "OK\n"; }; > print "en

Re: curly braces

2001-06-26 Thread Jeff 'japhy' Pinyan
On Jun 26, Silvio Luis Leite Santana said: >Why does code 1 work, but code 2 doesn't? >(the diference is the ; after print) In the first code, Perl thinks you're constructing a hash reference. In the second code, Perl sees a block where it expects an expression. >After all, is it posible or no

curly braces

2001-06-26 Thread Silvio Luis Leite Santana
quot;; CODE 2 - DOESN'T WORK (should it work, I'd wish to put more than one command inside the curly braces) $bissexto = ; chop($bissexto); $bissexto and { print "OK\n"; }; print "end\n";