Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: How would you indent this? Which identation style do you prefer?

by Anonymous Monk
on Mar 18, 2021 at 02:35 UTC ( [id://11129883]=note: print w/replies, xml ) Need Help??


in reply to How would you indent this?

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" } );
  • Comment on Re: How would you indent this? Which identation style do you prefer?
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11129883]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-24 05:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found