diff options
| author | Paul Buetow (mars.fritz.box) <paul@buetow.org> | 2013-09-16 00:06:23 +0200 |
|---|---|---|
| committer | Paul Buetow (mars.fritz.box) <paul@buetow.org> | 2013-09-16 00:06:23 +0200 |
| commit | c5cc9bfe662434a10f4086ea93ea4d85261d91d2 (patch) | |
| tree | ea98f311c533d250a1fe746f13294a3ac25500e0 /README | |
| parent | d7f6c13f823bd53d7b5a3d5c004850b6b3d9307d (diff) | |
indent README example code
Diffstat (limited to 'README')
| -rw-r--r-- | README | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -26,8 +26,8 @@ If no real ret val, set undef; explicitly sub foo() { # Do some stuff ... -# Set explicit undef ret value -return undef; + # Set explicit undef ret value + return undef; } Private subs use _ as its prefix and are called only from the current package. @@ -37,34 +37,34 @@ package Xerl::Foo::Bla; . sub _iamprivate($) { -my Xerl::Foo:Bla $self = $_[0]; -. -. + my Xerl::Foo:Bla $self = $_[0]; + . + . } sub iampublic($) { -my Xerl::Foo:Bla $self = $_[0]; -$self->_iamprivate(); -return undef; + my Xerl::Foo:Bla $self = $_[0]; + $self->_iamprivate(); + return undef; } Static subs (not OOP) are in CAPITAL letters. sub IAMSTATIC($) { -print shift; -return 'Hello World'; + print shift; + return 'Hello World'; } sub iamdynamic($) { -my Xerl::Foo:Bla $self = $_[0]; -return Xerl::Foo::Bla::IAMSTATIC( $self->get_somevalue() ); + my Xerl::Foo:Bla $self = $_[0]; + return Xerl::Foo::Bla::IAMSTATIC( $self->get_somevalue() ); } Static private subs start with _ and are written in CAPITAL letters sub _IAMSTATICPRIVATE() { -. -. + . + . } Use Pidy to automaically restyle the code! (make perltidy) |
