Text::ConvertPlatform - an object class for formatting text between different platforms.
# Initialization statement my $philip = new Text::ConvertPlatform; # or whatever you prefer $philip->filename("i_love_unix.html"); # file that is to be worked on $philip->filename; # returns current FILENAME $philip->convert_to("unix"); # set conversion mode - default is "unix" # there is no need to set this if you are # using the default # other modes are: "dos", "mac" $philip->process_file; # convert FILENAME $philip->replace_file; # overwrite FILENAME with NEWCONTENTS $philip->backup_file; # create a copy of FILENAME with a .bak extension $philip->oldcontents; # returns original contents of processed file $philip->newcontents; # returns results of a processed file
I've been quite bored at work lately and decided to write an easy way to format text between different platforms. Specifically, it converts return characters and optionally backs up the file it works on.
Philip Mikal, "djphil@aztec.asu.edu". Co-authored by Phil Stracchino. Inspired from Adrian Scott's em.pl, which was given to me from Ken Berger. I'd also like to thank Randy Ray for answering questions I had when setting up this distribution.
perl(1).
To install Text::ConvertPlatform, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::ConvertPlatform
CPAN shell
perl -MCPAN -e shell install Text::ConvertPlatform
For more information on module installation, please visit the detailed CPAN module installation guide.