Date: Sat, 22 Sep 2001 17:23:40 GMT From: laura_fairhead@my-deja.com (laura fairhead) Subject: extra newline in s command Message-Id: <3bacc901.87892259@news.cis.dfn.de> Hi, Can anyone explain to me why I'm getting extra newlines inserted with the s/// command in this script; open(FILE,qq[patternfile]) @k=(qq[0000],) while(<>){ /(\d{4})/&& $1<=$#k && s/$1/$k[$1]/ print } Every line that has an s/// done on it has an extra newline and I don't see why it's doing that. It is suppossed to replace occurances of 4 digit numerics with what is on that line in 'patternfile' This is my 1st attempt at 'perl' so pleaze be easy on me.... is this a reasonable way of doing this or is there a better one? Also, can I read a file into an array in just one command? thanx -- : ${L:-aura} # http://lf.8k.com:80