hello all, I have just a quick question in regards to filehandles and I think style... here is my code as of yet, I just started figuring out what I want the script to do and will intergrate it into a the web page soon. I have three files, a text file with web page names and their urls. My question is what is the best way to update the html page and test file?
my code as of yet... My final product will have warnings and strict in place and CGI.pm This works in the command prompt (WinXP) #!/usr/bin/perl -w # Links updating procedures... open (OLD, "links.txt") || die "can't open the links database"; %Link = <OLD>; close (OLD) || die "can't close the links database"; print "Add one.\nName "; chomp($newN = <STDIN>); print "Address "; chomp($newA = <STDIN>); open (NEW, "+>Links.txt") || die "CAn't open links.txt for writing of new info"; if ($newN) { if ($newA) { print NEW "$newN\n$newA\n"; } } foreach $elm ( keys %Link ) { print NEW "$elm$Link{$elm}"; } close (NEW) || die "can't close links.txt after writing of new info"; open (DB, "links.txt") || die "can't open the database used in creation of the html file"; %DB = <DB>; close (DB) || die "can't close the database file used for the htmk file"; open (FINAL, "+>links.html") || die "can't open the html file for you to write too"; foreach $elm ( sort keys %DB ) { chomp($name = $elm); chomp($addy = $DB{$elm}); if ($addy !~ /^http/) { $addy = "http://$addy"; } print FINAL "<a href=\"$addy\">$name</a><br>\n"; } close (FINAL) || die "can't close the html file"; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]