The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

BW::Common - Some common utility functions

SYNOPSIS

    use BW::Common
    my $o = BW::Common->new;

METHODS

new

Constructs a new BW::Common object.

Returns a blessed BW::Common object reference. Returns undef (VOID) if the object cannot be created.

comma number

Returns a comma-fied string from number.

trim string

Returns the string with leaading and trailing spaces removed

basename string

Returns the string with basename of a filename.

normalize_newlines string

Returns the string with CRs and CRLF pairs normalized to NLs.

readfile filename, [max_length], [layer]

Read a file and return as a string.

max_length is the maximum length to read. It defaults to 1MB (1024 * 1024).

layer is the LAYER string passed to binmode. It defaults to ":raw" (for binary files).

AUTHOR

Written by Bill Weinman <http://bw.org/>.

COPYRIGHT

Copyright (c) 1995-2010 The BearHeart Group, LLC

HISTORY

    2010-03-08 bw   -- updated basename to work with backslash for MS Win
    2010-02-02 bw   -- first CPAN release
    2009-12-22 bw   -- added readfile
    2009-11-25 bw   -- initial version.