Re: OT: Re: subroutine definitions

2004-03-08 Thread Andrew Gaffney
Charles K. Clarkson wrote: Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : I'm currently going through and cleaning up all my code : and moving all common code to my module. Get used to doing it. In about a year you'll wonder why you did it that way and how you did anything with such terrible

RE: OT: Re: subroutine definitions

2004-03-08 Thread Charles K. Clarkson
Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : I'm currently going through and cleaning up all my code : and moving all common code to my module. Get used to doing it. In about a year you'll wonder why you did it that way and how you did anything with such terrible programming. :) Charles

Re: OT: Re: subroutine definitions

2004-03-08 Thread Andrew Gaffney
Wiggins d'Anconia wrote: Andrew Gaffney wrote: [snip] Really, I'm the only user of my code. I don't expect to get replaced anytime soon as my boss also doubles as my father ;) Besides, I certaintly don't want to make things easier for my replacement (if there ever is one). Sorry for the old po

OT: Re: subroutine definitions

2004-03-08 Thread Wiggins d'Anconia
Andrew Gaffney wrote: [snip] Really, I'm the only user of my code. I don't expect to get replaced anytime soon as my boss also doubles as my father ;) Besides, I certaintly don't want to make things easier for my replacement (if there ever is one). Sorry for the old post, but this last senten

RE: subroutine definitions

2004-03-02 Thread David le Blanc
> -Original Message- > From: zsdc [mailto:[EMAIL PROTECTED] > Sent: Tuesday, 2 March 2004 4:54 PM > To: Andrew Gaffney > Cc: 'beginners' > Subject: Re: subroutine definitions > > Andrew Gaffney wrote: > > > zsdc wrote: > > > >&g

Re: subroutine definitions

2004-03-01 Thread zsdc
Andrew Gaffney wrote: zsdc wrote: Confusion? You should read 6th Apocalypse by Larry Wall and the appropriate Exegesis by Damian Conway: http://dev.perl.org/perl6/apocalypse/A06.html http://dev.perl.org/perl6/exegesis/E06.html Now, _that_ is confusing. :) I think that's an understatement. Blood

Re: subroutine definitions

2004-03-01 Thread Jenda Krynicky
From: WC -Sx- Jones <[EMAIL PROTECTED]> > Andrew Gaffney wrote: > > >> http://dev.perl.org/perl6/apocalypse/A06.html > >> http://dev.perl.org/perl6/exegesis/E06.html > >> > >> Now, _that_ is confusing. :) > > > > > > I think that's an understatement. Blood is coming out of my ears > > after read

Re: subroutine definitions

2004-03-01 Thread WC -Sx- Jones
Andrew Gaffney wrote: http://dev.perl.org/perl6/apocalypse/A06.html http://dev.perl.org/perl6/exegesis/E06.html Now, _that_ is confusing. :) I think that's an understatement. Blood is coming out of my ears after reading a few pages of the first one... Hmmm; in fact all Perl people should be ha

Re: subroutine definitions

2004-03-01 Thread Andrew Gaffney
zsdc wrote: Confusion? You should read 6th Apocalypse by Larry Wall and the appropriate Exegesis by Damian Conway: http://dev.perl.org/perl6/apocalypse/A06.html http://dev.perl.org/perl6/exegesis/E06.html Now, _that_ is confusing. :) I think that's an understatement. Blood is coming out of my ear

Re: subroutine definitions

2004-03-01 Thread zsdc
zsdc wrote: I see [your] point. Perl 5 prototypes were invented mostly to make things like $x = pop @array work but there is nothing you can do with prototypes which you cannot do without them, only with different function call syntax. In fact, prototypes are not even needed to restrict argument

Re: subroutine definitions

2004-03-01 Thread WC -Sx- Jones
R. Joseph Newton wrote: I would see this in a more positive light, perhaps, if prototypes were more required for all functions, particularly if they offered named formal parameters. In those circumstances, prototypes would offer great benefits of clarity, since one could always refer to the signa

Re: subroutine definitions

2004-03-01 Thread zsdc
R. Joseph Newton wrote: Got it. I'll still stick with what I said, though. This "feature" offered by Perl prototypes strikes me as primarily a seed of confusion. Confusion? You should read 6th Apocalypse by Larry Wall and the appropriate Exegesis by Damian Conway: http://dev.perl.org/perl6/apoc

Re: subroutine definitions

2004-02-29 Thread R. Joseph Newton
zsdc wrote: > R. Joseph Newton wrote: > > "Charles K. Clarkson" wrote: > > > >> Here begins my problems with prototypes. Let's try > >>this sample script: > > > >>sub generate_report_html([EMAIL PROTECTED]@); > > > > which could also be written: > > sub generate_report_html($$$); > > > > with mu

Re: subroutine definitions

2004-02-29 Thread zsdc
R. Joseph Newton wrote: "Charles K. Clarkson" wrote: Here begins my problems with prototypes. Let's try this sample script: sub generate_report_html([EMAIL PROTECTED]@); which could also be written: sub generate_report_html($$$); with much greater clarity. This is not the same. A '$' in the sub

Re: subroutine definitions

2004-02-29 Thread R. Joseph Newton
"Charles K. Clarkson" wrote: >Here begins my problems with prototypes. Let's try > this sample script: > > sub generate_report_html([EMAIL PROTECTED]@); which could also be written: sub generate_report_html($$$); with much greater clarity. > > > my $title= 'foo'; > my @column_names

Re: subroutine definitions

2004-02-29 Thread Andrew Gaffney
Charles K. Clarkson wrote: Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : package Skyline; : : : : sub generate_report_html([EMAIL PROTECTED]@) { :my ($title, $columns, $data) = @_; Here begins my problems with prototypes. Let's try this sample script: sub generate_report_html([EMAIL PRO

RE: subroutine definitions

2004-02-29 Thread Charles K. Clarkson
Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : package Skyline; : : : : sub generate_report_html([EMAIL PROTECTED]@) { :my ($title, $columns, $data) = @_; Here begins my problems with prototypes. Let's try this sample script: sub generate_report_html([EMAIL PROTECTED]@); my $title

Re: subroutine definitions

2004-02-29 Thread John W. Krahn
"R. Joseph Newton" wrote: > > Andrew Gaffney wrote: > > > > sub generate_report_html([EMAIL PROTECTED]@) { > >my ($title, $columns, $data) = @_; > > $data is prototyped as an array/list, but you receive it here as a scalar. If > you must use the damned prototype, it should be: > sub generate

Re: subroutine definitions

2004-02-28 Thread Andrew Gaffney
R. Joseph Newton wrote: Andrew Gaffney wrote: R. Joseph Newton wrote: I am writing a module that contains functions that I commonly use in my scripts. I have written a lot of scripts that generate HTML reports from the data in the MySQL DB. My boss wants these reports to spit out their data eith

Re: subroutine definitions

2004-02-28 Thread Andrew Gaffney
James Edward Gray II wrote: On Feb 28, 2004, at 7:05 PM, Andrew Gaffney wrote: I'm getting conflicting advice between your post and another post to this thread. Maybe if I post my code, you can recommend the best way for me to setup my functions and the calls to them (and whether to prototype t

Re: subroutine definitions

2004-02-28 Thread R. Joseph Newton
Andrew Gaffney wrote: > R. Joseph Newton wrote: > > I am writing a module that contains functions that I commonly use in my scripts. I > have > written a lot of scripts that generate HTML reports from the data in the MySQL DB. > My boss > wants these reports to spit out their data either in HTM

Re: subroutine definitions

2004-02-28 Thread James Edward Gray II
On Feb 28, 2004, at 7:05 PM, Andrew Gaffney wrote: I'm getting conflicting advice between your post and another post to this thread. Maybe if I post my code, you can recommend the best way for me to setup my functions and the calls to them (and whether to prototype them). This code will be for

Re: subroutine definitions

2004-02-28 Thread Andrew Gaffney
R. Joseph Newton wrote: Andrew Gaffney wrote: I'm not exactly a beginner. I've been using Perl for about 8 months. It's just that I've never written a subroutine where I need to pass array or hash *references*. Regardless of how long you have been writing in Perl, if you have not yet: Star

Re: subroutine definitions

2004-02-28 Thread John W. Krahn
Andrew Gaffney wrote: > > Charles K. Clarkson wrote: > > Andrew Gaffney <[EMAIL PROTECTED]> wrote: > > : > > : I'm trying to write a subroutine that takes two scalars and two > > : arrays as parameters. I've read that if you try to do this in a > > : function, both arrays will get combined within

Re: subroutine definitions

2004-02-28 Thread R. Joseph Newton
Andrew Gaffney wrote: > > I'm not exactly a beginner. I've been using Perl for about 8 months. It's just that > I've > never written a subroutine where I need to pass array or hash *references*. Regardless of how long you have been writing in Perl, if you have not yet: Started using strict a

Re: subroutine definitions

2004-02-28 Thread WilliamGunther
In a message dated 2/28/2004 3:28:55 AM Eastern Standard Time, [EMAIL PROTECTED] writes: > - Stop using prototypes. You'll find it easier to write perl > programs without them. Prototypes are useful and sometimes necessary, as in the supplied problem. What would be called my_subroutine($sc

Re: subroutine definitions

2004-02-28 Thread Andrew Gaffney
Charles K. Clarkson wrote: Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : I'm trying to write a subroutine that takes two scalars and two : arrays as parameters. I've read that if you try to do this in a : function, both arrays will get combined within '@_'. Andrew, - Stop using prototypes. You'l

RE: subroutine definitions

2004-02-28 Thread Charles K. Clarkson
Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : I'm trying to write a subroutine that takes two scalars and two : arrays as parameters. I've read that if you try to do this in a : function, both arrays will get combined within '@_'. Andrew, - Stop using prototypes. You'll find it easier to write

Re: subroutine definitions

2004-02-27 Thread John W. Krahn
Andrew Gaffney wrote: > > I'm trying to write a subroutine that takes two scalars and two arrays as > parameters. I've > read that if you try to do this in a function, both arrays will get combined within > '@_'. All the values, including the two scalars, will be combined in a single list and b