It looks to me like you are trying to use 'join' to concatenate a group of fields together in the given order. While 'join' can be used to do that, in this particular case, it seems rather silly.
join functions like this:
Code:
sub join ($@) {
my ($expr, @list) = @_;
local $" = $expr;
return "@list";
}
or
Code:
sub join ($@) {
my ($expr, @list) = @_;
my $return = '';
for (my $i = 0; $i < @list; $i++) {
$return .= $list[$i];
if ($i + 1 < @list) {
$return .= $expr;
}
}
return $return;
}
However, you probably want
Code:
$URL = join('', 'http://www.mysite.com', $field, '.html?d=1&t=de'); which is the same as (although, probably less efficient than)
Code:
$URL = 'http://www.mysite.com' . $field . '.html?d=1&t=de';
which can also be written as (actually, the perl interpreter converts the follow to the previous during parsing)
Code:
$URL = "http://www.mysite.com$field.html?d=1&t=de";
If this is not what you want, it would help to have an example '$field' and know what the expected output is.