Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: Confession of a hard headed Monk

by Lady_Aleena (Curate)
on May 16, 2017 at 17:26 UTC ( #1190396=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # If you don't add 1 to the result of the division below,
    # you will get an additional column.
    my $splicer = (scalar(@list) / $columns) + 1;
    
  2. or download this
    # Add 1 to the result of the division below
    # if list is not evenly divisible by $columns.
    my $splicer  = int(scalar(@list) / $columns);
       $splicer += scalar(@list) % $columns > 0 ? 1 : 0;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2019-10-19 18:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?