On Thu, Dec 21, 2006 at 09:24:51AM +0100, Dr.Ruud wrote: > Tom Smith schreef: > > Mumia W.: > > >> use strict; > >> use warnings; > >> $_ = `id $ARGV[0]`; > >> s/.*?groups=// && print "@{[ /\((\w+)\)/g ]}\n"; > > > > I'm not trying to be argumentative or say that this is "wrong"... But > > does anyone else agree with this? If so, why is this way better than > > the pure Perl way? > > TIMTOWTDI. On the shell machines of my provider (FreeBSD) the "id" > approach will work, and the "/etc/group" one won't.
I don't think that has anything to do with it being FreeBSD. I'm typing this from a FreeBSD machine, and it works just fine. Of course, if you're going to call out of the Perl script to the id utility, you may as well skip the Perl script entirely and just enter this at the shell prompt: id -Gn username -- CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ] "The ability to quote is a serviceable substitute for wit." - W. Somerset Maugham -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>