[Chicago-talk] Perl Style

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


> 1) variable names

as a longtime C hacker I use underscores;
iDontFindThisFormatAnyEasierToRead.

> 2) function names

	sub foo
	{
		indented text w/in function
	}

	foo "arguments", "to", "foo";


> 3) the "{" after a function

I don't snuggle braces, tend to leave things vertical
on separate lines: easier to see and edit.

    if( whatever )
    {
	}
	elsif( whatever else )
	{
	}
	else
	{
	}

or

	if
	(
		some &&
		some more &&
		even more yet &&
		yet ever more
	)
	{
		block
	}
		
or

	map { oneliner }

	map
	{
		longer
		map
		with
		multiple
		lines
		become
		easier
		to
		edit
		if
		not
		snuggled
	}

> anything else in particular

Take a look at FindBin::libs or Schedule::Depend for lots
of examples, NEXT::init was on the mailing list last week.

Most of the people who've had to hack my code found it readable.


-- 
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