HI, I have a file which ends by:

host clin09 {hardware ethernet 00:80:9F:2E:3F:5E;
filename "/bootp/linux/pre3.1/alize/startup.txt";}
}


I have a perl tk application where a user types a MAc Adress in an entry the 
variable is $_Globals{MAC_ADDRESS} .

I wanted to replace what's come after hardware ethernet ie in this case 
00:80:9F:2E:3F:5E by what the user entered.

I have this code:
my $newline2=qq{host clin09 {hardware ethernet $_Globals{MAC_ADDRESS};\n
        filename "/bootp/linux/pre3.1/alize/startup.txt";}\n};

open (VIEUX,"< $_Globals{DHCPDCONF}")
        or die "je ne peux ouvrir $_Globals{DHCPDCONF} :$!";
        
 open(NOUVEAU, "> $nouveau")
        or die "je ne peux ouvrir $nouveau : $!";
        
  while ($line = <VIEUX>) {
  
  if ($line =~ /^host clin09/) {
  
  print NOUVEAU $newline2 or die "je ne peux écrire dans $nouveau : $!";
        }
        
        
    } 
    close (VIEUX);
    close (NOUVEAU);
    
   
   But it didn't work could help me please Thanks              


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to