in reply to again problem with regexpr
standard program startup $^I=".bak" ; Enables in-place editing. I.e, Changes will be made to the same file for files read through <>#!/usr/bin/perl use strict ; use warnings ;
Makes <> read on abc.txt@ARGV=(qw/abc.txt/) ;
Replace "trojan is like viruse" with "hello". As in-place editing is enabled and print is not supplied an explicit filehandle, changes are made to the same file.while(<>) { s/trojan is like viruse/hello/g; print ; }
|
|---|