$_ =~ s[][qq() x $1]egsx;