LeftPad - Why should Node.js have all the fun?
version 0.003
use LeftPad; $string = leftpad( $string, $min_length ); $string = leftpad( $string, $min_length, $pad_char );
This module provides left padding, just like you'd find for Node.js.
So that people may depend on this module for their production code, the author commits to never delete it from CPAN.
$string = leftpad( $string, $min_length ); $string = leftpad( $string, $min_length, $pad_char );
Returns a copy of the input string with left padding if the input string length is less than the minimum length. It pads with spaces unless given a pad character as a third argument.
Zero or negative minimum length returns the input string. Only the first character in the pad-character string is used. Undefined warnings are suppressed so an undefined input string is treated as an empty string.
String::Pad
Text::Padding
Please report any bugs or feature requests through the issue tracker at https://github.com/dagolden/LeftPad/issues. You will be notified automatically of any progress on your issue.
This is open source software. The code repository is available for public review and contribution under the terms of the license.
https://github.com/dagolden/LeftPad
git clone https://github.com/dagolden/LeftPad.git
David Golden <dagolden@cpan.org>
This software is Copyright (c) 2016 by David Golden.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
To install LeftPad, copy and paste the appropriate command in to your terminal.
cpanm
cpanm LeftPad
CPAN shell
perl -MCPAN -e shell install LeftPad
For more information on module installation, please visit the detailed CPAN module installation guide.