Hello ImJustAFriend,
Because you haven’t explicitly stringified the expession $provinfile.$server, the dot functions as a concatenation operator. So the result is a string, but there is no dot character inserted between the two strings. This is obscured by the error message, which does contain an inserted dot character.
Update: It’s good practice to ensure that an error message reflects exactly what’s happening. Here, you can accomplish this with an extra assignment:
for my $server (@servers) { my $full_path = $provinfile . '.' . $server; # or = "$provinfil +e.$server"; open IN2, '<', $full_path or die "Could not open Server IN2 ($full_path): $!\n"; ... }
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re: Phantom "No such file" issue
by Athanasius
in thread Phantom "No such file" issue
by ImJustAFriend
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |