#!/usr/bin/env perl # # length - prefixes each line in the input with its length # # $Id: length 706 2010-03-03 13:12:40Z rp $ # counts the length in bytes, without line end character(s) use warnings; use strict; while (<>) { print length($_)-length($/), ' ', $_; }