[Chicago-talk] Perl Style

Steven Lembark lembark at wrkhors.com
Thu Aug 19 12:41:05 CDT 2004



-- Jay Strauss <me at heyjay.com>

>>
>> > 3) the "{" after a function
>>
>> Goes on the same line as the function.
>
> perlstyle says it looks like:
>
> sub function{
>
> rather than
>
> sub function {
>
> (notice, no space between "function" and "{")

The guideline is just that: a guide. Perl is agnostic to
whitespace: put spaces between all of your dollar signs
and the variable names if it pleases you:

	  DB<1> $ a = 'foo'

	  DB<2> print $ a
	foo

The only reall issue is to pick a style that's readable
and relatively easy to maintain.

The trick of snuggling everything comes from publishers,
who don't want the extra page space used for curlys, etc.
Since my editor will gracefull in- and outdent using blocks
I put the curlys on separate lines for easier editing.

If you really want to program in a language that requires
rigid formatting use COBOL or Python.

-- 
Steven Lembark                           9 Music Square South, Box 344
Workhorse Computing                                Nashville, TN 37203
lembark at wrkhors.com                                     1 888 359 3508


More information about the Chicago-talk mailing list