asheesh has asked for the wisdom of the Perl Monks concerning the following question:
below is my script
#!/usr/bin/perl -w # This script will process the old and new attributes # and then get a html file , grab aall the old attribute then # replace it with the new attributes $html_file = "/export/home/achhabra/example.html"; $Attribute = "/export/home/achhabra/Attributes.txt"; open (F, "$Attribute") or die ("can't open $Attribute : $!\n"); while(<F>) { chomp $_; @attributes = split(/ /, $_); $attributes_hash{$attributes[0]} = $attributes[1]; } close(F); open (H, "$html_file") or die ("can't open $html_file : $!\n"); foreach $attribute (%attributes_hash) { while(<H>) { system(":%s/\$attribute/\$attributes_hash{attribute}/g"); } } close(H);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hash Arrays
by chromatic (Archbishop) on Apr 16, 2003 at 20:03 UTC | |
|
Re: Hash Arrays
by dragonchild (Archbishop) on Apr 16, 2003 at 19:59 UTC |