Note: the backend to this site seems to interpret left and right square brackets... so anywhere you see a number after @temp_data, put brackets around it.
I'm a bit unclear about the structure of the original text file.
Are the entries separated by a carriage return or just a space?
The above script looks fine. I think the line that clears @temp_data is unnecessary.
I'm also confused about what the print line does b/c it contains html that my web browser is interpretting
... perhaps the poster should have previewed it first.
(btw, single quotes are necesary around it or perl will get confused.)
It also might be nicer to save each link as, for example, 97FordMustang.html instead of 0.html
do:
$filename = (join '', (split @temp_dataŤ0])) . '.html';
This script also just makes the links, not the html files themselves.
to fix this, at the top of the script, add:
open (INDEX, ">list.html");
change the print ... to print INDEX ...
then on the inside, after the print line (after the $filename mentioned above) do:
open (CAR, ">$filename");
print CAR "Make and Model: @temp_data[0]\n";
print CAR "Color: @temp_data[1]\n";
etc.
you don't need to close either of these filehandles. perl is smart enough.
I don't have an account here (yet) but feel free to mail me at psack@tivoli.ihatespam.com.
Edit by tye, formatting |