spacewhack.pl revision 5fa46bc91672ef5737aee6f99763161511566c24
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# Copyright (C) 2004, 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# Copyright (C) 2000, 2001 Internet Software Consortium.
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# Permission to use, copy, modify, and/or distribute this software for any
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# purpose with or without fee is hereby granted, provided that the above
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# copyright notice and this permission notice appear in all copies.
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# PERFORMANCE OF THIS SOFTWARE.
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff$0 =~ s%.*/%%;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff warn "Usage: $0 < list-of-files\n";
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff warn "The util/copyrights file is normally used for list-of-files.\n";
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graffprintf "Lines Trimmed:\n";
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff # These are binary and must be ignored.
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graff print "$file\n";
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff warn "$0: open < $file: $!, skipping\n";
86944a4c8002e80ae9b6eb5a5e29b797879be45fMichael Graff undef $/; # Slurp whole file.
21e7034ec046105c00a0dab86c83732e2e77ad99Michael Graff $/ = "\n"; # Back to line-at-a-time for <FILES>.
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff warn "$0: open > $file: $!, skipping\n";
31fab17bcdbe302592a6c0dc5374ef56333ee879Michael Graff print FILEOUT or die "$0: printing to $file: $!, exiting\n";
31fab17bcdbe302592a6c0dc5374ef56333ee879Michael Graff close FILEOUT or die "$0: closing $file: $!, exiting\n";
31fab17bcdbe302592a6c0dc5374ef56333ee879Michael Graff printf("%6d lines trimmed in $file\n", $count) if $count > 0;