Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: Splitting a string to chunks

by johngg (Canon)
on Nov 29, 2006 at 23:25 UTC ( #586840=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $padding = 8 - ($str % 8);
    
  2. or download this
    substr $arr[-1], -$padding, $padding, q{} if $padding;
    
  3. or download this
    my $padding = 8 - (length($str) % 8);
    
  4. or download this
    $ perl -le '$str = q{abc}; $pad = $str % 8; print $pad;'
    0
    $ perl -le '$str = q{abcdefghijkl}; $pad = $str % 8; print $pad;'
    0
    $
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (1)
As of 2021-09-26 02:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?