I have tried all the ways to remove the new line character at the end of the line and store it in a single. Please tell me what is wrong in the above code. But no luck#!/usr/bin/perl use strict; use warnings; while (<DATA>) { chomp $_; if($_ !~ /^{/){ $_ =~ s/\s+//gi; $_ =~ s/\n//gi; $_ =~s/\r//gi; print "$_\n"; } } __DATA__ {AUTHOR} author1 staff1 {HEADLINE} DISPOSABLE DECOR: THE CUTTING EDGE DULLS FAST\ STYLE AT A SPEED USUALLY ASSOCIATED WITH WARDROBE ITEMS.
In reply to remove line feed at the end by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |