Andrew Gaffney wrote:
>
> Rob Dixon wrote:
> >
> > Andrew Gaffney wrote:
> >
> > > I am writing a Perl script to automatically generate a netlogon.bat file for 
> > > Samba
> > > whenever a user logs onto a domain. The only parameter that is passes to it is 
> > > the
> > > username. My problem is that different groups get some of the same mappings. 
> > > What I really
> > > need to do is filter out duplicate lines in the finished output. I tried piping 
> > > the output
> > > through 'uniq' but it only filters successive duplicate lines. Anyone have any 
> > > suggestions?
> >
> >
> > [snip code]
> >
> > Hi Andrew.
> >
> > The quick answer is:
> >
> >   perldoc -q dupl
> >
> > If you need any more then ask again :)
>
> I was able to indirectly get the answer from that. Reading that,
> I realized that if I run my output through 'sort' and then 'uniq'
> or even just 'sort -u', it does what I want it to do.

I'm reluctant to let this go, but a 'proper' answer would have to be
of the, "I wouldn't start from here, " type. You've used Perl as
a scripting language, which it isn't. Perl's very good at doing anything
you need on a platform-independent basis, and shelling out with 'system'
calls or backticks is almost never necessary and makes the whole program
platform and shell-specific.

If this is even a semi-permanent piece of software then, if I were
you, I would let the group blitz it just to show you what can be done.
You might even want to see that anyway as a learning exercise.

HTH,

Rob



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to