Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 browsing the Monastery: (6)
As of 2019-05-22 17:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (140 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!