#!/usr/bin/perl open(DATA,"<a.txt") or die "Caanot read $!"; @info=<DATA>; close(DATA); open(FH,"+>b.txt") or die "Not able to create"; foreach (@info) { $_ =~ s/NULL//g; $_ =~ s/ //g; } print FH "@info"; close(FH); system("mv b.txt a.txt"); a.txt data ===== This is a test line Contains NULL values NULL Testing Testing in Progress
In reply to Best way to write in Perl by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |