82 lines
812 B
Plaintext
82 lines
812 B
Plaintext
Code:
|
|
(lambda ()
|
|
(cperl-mode)
|
|
(indent-region (point-min) (point-max)))
|
|
|
|
Name: cperl-indent1
|
|
|
|
=-=
|
|
{
|
|
print "",
|
|
"",
|
|
foo::bar(),
|
|
"";
|
|
}
|
|
=-=-=
|
|
|
|
Name: cperl-indents1
|
|
|
|
=-=
|
|
{
|
|
print "",
|
|
"",
|
|
foobar(),
|
|
"";
|
|
}
|
|
=-=-=
|
|
|
|
Name: cperl-try-catch-finally
|
|
|
|
=-=
|
|
{
|
|
try {
|
|
call_a_function();
|
|
}
|
|
catch ($e) {
|
|
warn "Unable to call; $e";
|
|
}
|
|
finally {
|
|
print "Finished\n";
|
|
}
|
|
}
|
|
=-=-=
|
|
|
|
Name: cperl-defer
|
|
|
|
=-=
|
|
use feature 'defer';
|
|
|
|
{
|
|
say "This happens first";
|
|
defer {
|
|
say "This happens last";
|
|
}
|
|
|
|
say "And this happens inbetween";
|
|
}
|
|
=-=-=
|
|
|
|
Name: cperl-feature-class
|
|
|
|
=-=
|
|
use 5.038;
|
|
use feature "class";
|
|
no warnings "experimental";
|
|
|
|
class A {
|
|
}
|
|
|
|
class C
|
|
: isa(A)
|
|
{
|
|
method with_sig_and_attr
|
|
: lvalue
|
|
($top,$down)
|
|
{
|
|
return $top-$down;
|
|
}
|
|
}
|
|
|
|
say "done!";
|
|
=-=-=
|