in reply to system call and newline interpretattion.

I think the consensus is clearly that $_ has a newline on it, but just wanted to add one other note -- system() can take the program and argument list as well:
chomp; my @args = ("$user\@$ip:$source/$_", "staging/$_"); my $command = "scp"; system $command, @args;
This still requires the chomp, but might make the code more legible or easier to debug and I believe (but not sure) that in some cases it helps with escaping issues.

Replies are listed 'Best First'.
Re^2: system call and newline interpretattion.
by ikegami (Patriarch) on May 24, 2005 at 15:04 UTC
    As a "bonus", using the system $command, @args form of system is safer since the arguments are not subject to interpretation by the shell.