[CentOS] remove newlines / perl /concise example
Stephen Harris
lists at spuddy.orgThu Dec 30 22:03:11 UTC 2010
- Previous message: [CentOS] remove newlines / perl /concise example
- Next message: [CentOS] OT how to prevent oversubscription of a disk
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Thu, Dec 30, 2010 at 04:57:46PM -0500, ken wrote: > open(my $in, "<", "$infilename") or die "Can't open file > while (<$in>) > { > # Neither of the two commands below works as expected. > chomp; # remove trailing newline. > # s/\n/ /; # replace newline with space > print $out $in; What exactly do you think you're printing here???? $in is the filehandle, not the content. $_ is the content. print $out $_; -- rgds Stephen
- Previous message: [CentOS] remove newlines / perl /concise example
- Next message: [CentOS] OT how to prevent oversubscription of a disk
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list