develooper Front page | perl.perl5.porters | Postings from August 2001

Re: [ID 20010821.002] bug in getpwnam

Thread Previous | Thread Next
Wolfgang Laun
August 22, 2001 23:34
Re: [ID 20010821.002] bug in getpwnam
Message ID:
Carsten Grohmann <> wrote at Tue, 21 Aug
2001 15:49:04 +0200:

> I want to change the owner of a file by using the following command:
>   chown (getpwnam ($username))[2], (getgrnam ($groupname))[2], $destfile;
> and I get an syntax error near )[.

Because "chown (..." parses as a function name followed by the opening
parenthesis for this function call.

This is correct:
  chown( (getpwnam($username))[2], (getgrnam($groupname))[2], $destfile

Both [ID 20010821.003] and [ID 20010821.002] can be closed.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About