On Thu, Jun 28, 2001 at 11:50:24AM +0200, Stefan Zwijsen wrote:
>
> Hi,
>
> I try to execute the following line on Solaris:
> system ("rsh","btzp17","`/usr/local/bin/perl -e "foreach $line
> (@allfiles) { print $line;}"`") ;
The intent behind the code you have here is very difficult to figure out.
Your syntax error is a result of quoting problems.
system ("rsh","btzp17","/usr/local/bin/perl -e "foreach $line
^ ^
^ ^- and this is where it ends
^- this is where this string starts
(@allfiles) { print $line;}"`") ;
^ ^
^ ^- and end
^- string start
Are you trying to somehow print the values of @allfiles into your system
argument, or did you miss the extra quotes?
>
> @allfiles is a list of pathnames and files
> The lines should be printed via a rsh on a station called btzp17.
>
> If I execute
> rsh btzp17 /usr/local/bin/perl -e 'foreach $line (@allfiles) { print
> $line ;}'
> at the command line it works.
How does this even work? Where is the remote perl program getting
@allfiles? There is no initialization of the variable in the snippet.
Michael
--
Administrator www.shoebox.net
Programmer, System Administrator www.gallanttech.com
--