Which identation style do you prefer?
Over the years I've tried typing it up different styles, ONCE, each :D
For this guy its a tossup between "## hand style" and "## perltidy edited" (shift indentation left)
But, once @static is populated, mostly I let dd() handle it
## original as posted by no longer just digit
my @headings = (
{key => 'k', name => 'Kanji', class => 'kanji'},
{key => 'skip', name => 'SKIP', class => 'skip-code'},
{key => 'co', name => 'Suggestion', class => 'skip-code'},
{key => 'disc', name => 'Discussion'},
);
## perltidy defaults
my @headings = (
{ key => 'k', name => 'Kanji', class => 'kanji' },
{ key => 'skip', name => 'SKIP', class => 'skip-code' },
{ key => 'co', name => 'Suggestion', class => 'skip-code' },
{ key => 'disc', name => 'Discussion' },
);
## perltidy edited
my @headings = (
{ key => 'k', name => 'Kanji', class => 'kanji' },
{ key => 'skip', name => 'SKIP', class => 'skip-code' },
{ key => 'co', name => 'Suggestion', class => 'skip-code' },
{ key => 'disc', name => 'Discussion' },
);
## Data::Dump::dd
my @headings =
(
{ class => "kanji", key => "k", name => "Kanji" },
{ class => "skip-code", key => "skip", name => "SKIP" },
{ class => "skip-code", key => "co", name => "Suggestion" },
{ key => "disc", name => "Discussion" },
)
;
## rehohy
my @headings;
$headings[0]{name}
= "Kanji"; #d1
$headings[0]{class}
= "kanji"; #d1
$headings[0]{key}
= "k"; #d1
$headings[1]{name}
= "SKIP"; #d1
$headings[1]{class}
= "skip-code"; #d1
$headings[1]{key}
= "skip"; #d1
$headings[2]{name}
= "Suggestion"; #d1
$headings[2]{class}
= "skip-code"; #d1
$headings[2]{key}
= "co"; #d1
$headings[3]{name}
= "Discussion"; #d1
$headings[3]{key}
= "disc"; #d1
## Data::Dumper->new([@_])->Useqq(1)->Indent(1)->Dump
my @headings = (
{
"name" => "Kanji",
"class" => "kanji",
"key" => "k"
},
{
"name" => "SKIP",
"class" => "skip-code",
"key" => "skip"
},
{
"name" => "Suggestion",
"class" => "skip-code",
"key" => "co"
},
{
"name" => "Discussion",
"key" => "disc"
}
);
## Data::Dumper->new([@_])->Useqq(1)->Indent(2)->Dump
my @headings = (
{
"name" => "Kanji",
"class" => "kanji",
"key" => "k"
},
{
"name" => "SKIP",
"class" => "skip-code",
"key" => "skip"
},
{
"name" => "Suggestion",
"class" => "skip-code",
"key" => "co"
},
{
"name" => "Discussion",
"key" => "disc"
}
);
## hand style
my @headings = (
{
"name" => "Kanji",
"class" => "kanji",
"key" => "k"
},
{
"name" => "SKIP",
"class" => "skip-code",
"key" => "skip"
},
{
"name" => "Suggestion",
"class" => "skip-code",
"key" => "co"
},
{
"name" => "Discussion",
"key" => "disc"
}
);
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.