H
Hiro San Feng
key="hi" to the perl community!
what is wrong with this code?
for html reasons is need 3 version of a field-value,
1. the pure value as in the db
2. a " " to "+" version for the URL
3. a complete built link
all data-field scalars are name field-n
now I iterate thtough them... and get syntax errors!
for(my $i = 1; $i <= 55; $i++)
# add a leading zero to first 9 fields
# so field-9 becomes field-09
if($i < 10){ $i = "0" . $i; }
# do the conversion
{"field-" . $i . "_A"} = {"field" . $i};
{"field-" . $i}=~ tr/ /+/;
{"field-" . $i . "_B"} = "<A HREF='foo.com?key=" .
"field-" . $i .
"'>" . {"field-" . $i} . "</A>";
}
thanks for any hints!
as it seems the perl syntax is not so logic as it seems... at least to
me.
what is wrong with this code?
for html reasons is need 3 version of a field-value,
1. the pure value as in the db
2. a " " to "+" version for the URL
3. a complete built link
all data-field scalars are name field-n
now I iterate thtough them... and get syntax errors!
for(my $i = 1; $i <= 55; $i++)
# add a leading zero to first 9 fields
# so field-9 becomes field-09
if($i < 10){ $i = "0" . $i; }
# do the conversion
{"field-" . $i . "_A"} = {"field" . $i};
{"field-" . $i}=~ tr/ /+/;
{"field-" . $i . "_B"} = "<A HREF='foo.com?key=" .
"field-" . $i .
"'>" . {"field-" . $i} . "</A>";
}
thanks for any hints!
as it seems the perl syntax is not so logic as it seems... at least to
me.