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 (Priest)
on May 16, 2017 at 17:26 UTC ( [id://1190396]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Confession of a hard headed Monk
in thread Confession of a hard headed Monk

Bad, bad, bad logic in a part of the usage code I provided above...

# 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;

It should be...

# 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;

Sorry for not thoroughly testing that part. 8(

No matter how hysterical I get, my problems are not time sensitive. So, relax, have a cookie, and a very nice day!
Lady Aleena

Replies are listed 'Best First'.
Re^4: Confession of a hard headed Monk
by choroba (Cardinal) on May 16, 2017 at 19:05 UTC
    Which can be shortened to
    my $splicer = int(@list / $columns) + (@list % $columns > 0);

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

      That gets a little long for things like the following:

      int(scalar split(/, /, $string) / $columns_for_string) + (scalar split +(/, /, $string) % $columns_for_string > 0);

      8)</c>

      No matter how hysterical I get, my problems are not time sensitive. So, relax, have a cookie, and a very nice day!
      Lady Aleena

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-04-26 00:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found