Perl Search and replace entire line

I have a perl function in my script that needs to replace an entire line in a file

sub changestate {
  my $base = ();
  my @base = ();

    open(BASE, $file) || die("Could not open file!");
    @base=<BASE>;
    close (BASE);

      foreach $base(@base)
        {
          if($base =~ /sslCACert=/){
             $base =~ s/sslCACert=/sslCACert=myserver.domain\/path/gi;
             print ("Hello, world!\n");
          }
  open (BASE, ">$file");
  print BASE @base;
  close (BASE);
    };
}

the problem is the line:

base =~ s/sslCACert=/sslCACert=myserver.domain\/path/gi;

The base sslCACert= I want to replace is followed by random garbage depending on which machine the file is on the only thing constant is sslCACert= . Can i use any wildcards? Also does a \ escape a / like in a shell script with perl. The Hello World is just there for testing.

Sean

You can use wild card matching, a dot is a wild card match in a perl regexp:

/./ matches any single character
/.*/ matches zero or more of anything
/.+/ matches one or more of anything

\ does escape the character to the right of it on the search side (the left side) of a regexp.