in reply to substition in multiple lines

I agree with thelenm that your code seems to work just fine. I'm trying to figure out what you think it is doing wrong.
Input File -------------------------- this is a test [[ this is a test ]] this is also a test [[ this is also a test ]] Output -------------------------- this is a test this is also a test Code -------------------------- #!/usr/bin/perl -w use strict; open(FILE, "<test.txt") || die "Error: $!"; while(<FILE>) { $_ =~ s/\[\[[^\]]*\]s*\]/ /msg; print; } close(FILE);
Seems to be working to me! -Eric