diff options
author | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2004-06-06 00:39:59 +0000 |
---|---|---|
committer | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2004-06-06 00:39:59 +0000 |
commit | 98fd8ab9afa6d3e862c05facad52ab7823615307 (patch) | |
tree | 90efd30fb0a4ba8011ef18e60257ad8dca37ba62 /lib/sbin/CSTUtils.pl | |
parent | d27a01a3baca6643893377a7b60a64721ee86b35 (diff) |
Changed from homegrown chomp to perl 5 chomp - needed to add some
extra formatting in the interface_parser to keep things looking nice
afterwards.
This should solve some problems with carriage returns under windows.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@3757 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/CSTUtils.pl')
-rw-r--r-- | lib/sbin/CSTUtils.pl | 40 |
1 files changed, 6 insertions, 34 deletions
diff --git a/lib/sbin/CSTUtils.pl b/lib/sbin/CSTUtils.pl index 7815e4d4..9759af73 100644 --- a/lib/sbin/CSTUtils.pl +++ b/lib/sbin/CSTUtils.pl @@ -107,11 +107,15 @@ sub read_file while(<IN>) { + chomp; + + # Remove comments. $_ =~ s/\#.*//; - next if(m/^\s+$/); + # Ignore empty lines. + next if(m/^\s*$/); - &chompme($_); + #&chompme($_); # Add to the currently processed line. $line .= $_; @@ -138,38 +142,6 @@ sub read_file return @indata; } - -#/*@@ -# @routine chompme -# @date Mon 26th April 1999 -# @author Gabrielle Allen -# @desc -# Implements a version of the perl5 chomp function, -# returning the string passed in with the last character -# removed unless it is a newline -# @enddesc -# @calls -# @calledby -# @history -# -# @endhistory -#@@*/ - -sub chompme -{ - my($in) = @_; - - $lastchar = chop($in); - if ($lastchar eq "\n") - { - return $_; - } - else - { - return $in; - } -} - #/*@@ # @routine WriteFile # @date Tue Oct 19 21:09:12 CEST 1999 |