#!/usr/bin/perl -w use strict; open(FH,'<','file.txt') or die "File is not there $!\n"; my $count=1; while() { print $count++; print ":$_"; }