]> git.donarmstrong.com Git - perltidy.git/commitdiff
update -bom example in docs
authorSteve Hancock <perltidy@users.sourceforge.net>
Mon, 16 Dec 2024 16:45:05 +0000 (08:45 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Mon, 16 Dec 2024 16:45:05 +0000 (08:45 -0800)
bin/perltidy

index 6b2d874013e118f102c8245c99ae276658bd3552..b8ef528e52d715866c6eefac45e3f92eccdf450d 100644 (file)
@@ -4713,34 +4713,31 @@ a breakpoint, but method chains will fill to the line width before a break is
 considered.  With B<-bom>, breaks before the arrow are preserved, so if you
 have pre-formatted a method chain:
 
-  my $q = $rs
-    ->related_resultset('CDs')
-    ->related_resultset('Tracks')
-    ->search({
-      'track.id' => {-ident => 'none_search.id'},
-    })->as_query;
+    # perltidy -bom
+    $Document
+      ->schild(0)
+      ->schildren();
 
-It will B<keep> these breaks, rather than become this:
+the flag B<-bom> will B<keep> these line breaks, rather than become this:
 
-  my $q = $rs->related_resultset('CDs')->related_resultset('Tracks')->search({
-      'track.id' => {-ident => 'none_search.id'},
-    })->as_query;
+    # perltidy [DEFAULT]
+    $Document->schild(0)->schildren();
 
 This flag will also look for and keep a 'cuddled' style of calls,
 in which lines begin with a closing paren followed by a call arrow,
 as in this example:
 
-  # perltidy -bom -wn
-  my $q = $rs->related_resultset(
-      'CDs'
-  )->related_resultset(
-      'Tracks'
-  )->search( {
-      'track.id' => { -ident => 'none_search.id' },
-  } )->as_query;
-
-You may want to include the B<--weld-nested-containers> flag in this case to keep
-nested braces and parens together, as in the last line.
+    # perltidy -bom
+    my $q = $rs->related_resultset(
+        'CDs'
+    )->related_resultset(
+        'Tracks'
+    )->search(
+        {
+            'track.id' => { -ident => 'none_search.id' },
+        }
+    )->as_query;
+
 
 =item B<-bos>,  B<--break-at-old-semicolon-breakpoints>