The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


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, "". Co-authored by Phil Stracchino. Inspired from Adrian Scott's, 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.