looks like '$login = print $hosts{$hostname};'
is not what you want.
'print' function returns '1' -- not the string it prints.
you want:
$login = $hosts{$hostname};
and if you really want to print the value:
print $login;

On Monday, April 1, 2002, at 08:30  AM, [EMAIL PROTECTED] wrote:

> The problem I am having is with $full
> How do I get $login to return its value when I try to assign this scalar
> $full
>
> Thanks in advance
>
> #!/util/perl5.static
>
> $hostname = qx(/usr/ucb/hostname);
> chomp $hostname;
>
> %hosts = (
>       crane => "hourihj",
>       runner => "paulg",
>       ice => "root",
> );
>
> $login = print $hosts{$hostname};
> chop $login;
>
> #print "$login\n";
> $full = qx(ypmatch $login passwd);
> print $full;
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

Reply via email to