perl search and replace with Tie : my search and replace is not working neither it is throwing any error,
i tried to modify the code and provide the i/p where it is working, not sure where the error occurs
while compling the code does't provide an error


    

    > #!/usr/bin/perl -w
    >     use strict;
    >     use warnings;
    >     use diagnostics;
    >     use Tie::File;
    >     use v5.10;
    >     use File::Compare;
    >     my $VAR; $VAR=$ARGV[0];chomp $VAR;
    >     my $nam=qq~file_name~;/*FILENAME
    >     my @lines;
    >     our $s1="var1";/*STINGS 
    >     our $s2="var2";/*STRINGS
    >     if ('$s1' ne '$s2')/*comparing the 2 stings
    >     {
    >     replace();
    >     }
    >     sub replace {/* for replacing the stings in file
    >     chomp $s1;chomp $s2;
    >     tie @lines, 'Tie::File', "$nam" or die " can't open the file\n";
    >     foreach (@lines)
    >     {
    >     s/$s2/$s1/g;/*replacing the strings
    >     }
    >     untie @lines;
    >     };
    

