perl naming convention

P

Peng Yu

Hi,

I'm wondering what is the widely accepted naming convention. In C++,
boost library recommend

1. All variables, functions and classes shall not have upper cases.
2. Macro shall be upper cased.

I'm wondering what is the convention for perl.

Thanks,
Peng
 
J

Joost Diepenmaat

Peng Yu said:
Hi,

I'm wondering what is the widely accepted naming convention. In C++,
boost library recommend

1. All variables, functions and classes shall not have upper cases.
2. Macro shall be upper cased.

I'm wondering what is the convention for perl.

In short:

functions and variables should be lower_case_like_this

class names/package names should be CamelCase::LikeThis

constants, (old-style) file handles, formats and package/global
variables should be UPPER_CASE_LIKE_THIS or $LIKE_THIS

When you have combinations they Look::Like::THIS or $Like::this etc.

See for in intro: http://perldoc.perl.org/perlstyle.html
 
T

Tad J McClellan

Peng Yu said:
Hi,

I'm wondering what is the widely accepted naming convention. In C++,
boost library recommend

1. All variables, functions and classes shall not have upper cases.
2. Macro shall be upper cased.

I'm wondering what is the convention for perl.


perldoc perlstyle
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top