#!/usr/bin/perl my $urlname = shift; my $url = shift; open(MENUFILE, "/usr/local/biotools/GDE/CORE/.GDEmenus") or die "cannot open menu file, sorry\n"; $newFileName = "/usr/local/biotools/GDE/CORE/.GDEmenusNew"; open(NEWFILE, ">$newFileName"); READLOOP: while (){ print NEWFILE; if (/^menu:On-Line/){ print "FOUND\n"; print NEWFILE "item:$urlname\n"; print NEWFILE "itemmethod:netscape $url &\n"; last READLOOP; } } while (){ print NEWFILE; } close(NEWFILE); close(MENUFILE); system("cp $newFileName /usr/local/biotools/GDE/CORE/.GDEmenus") or die "cannot replace old menu file\n";