Pasted below is the snippet of the code that works fine on UNIX machines. But in case of windows, it fails at 'while (<>)' with error 'Can't do inplace edit on <filename>'
Any help on why this fails on windows? I have searched and could not find any info. When I tried the traditional way of creating file handles for input and output files and then writing to outfile it works fine. But I was hoping to make use of the below in-place edit.
local @ARGV = ($filename);
local $^I = '.bk';
while (<>)
{
if ($. == 1)
{
print "<vom>\n";
}
else
{
print;
}
}