The object of this project is to develop a Perl script (orph_find.pl) for looking for orphaned homes (home directories without users, or the inverse).
This script should generate a formatted listing of
any user without a home directory...
...or any home directory (a directory in /home) that is not attached to a user.
Remember that the identifying element is the UID, not the username.

i keep getting this error :

Array found where operator expected at ./orph.pl line 20, near "} " (Missing operator before ?) Not enough arguments for grep at ./orph.pl line 20, near "grep |" syntax error at ./orph.pl line 20, near "$eval{" Execution of ./orph.pl aborted due to compilation errors.

#! /usr/bin/perl uid1; uid2; while(($uid) = getpwent()) { push(@uid1, $uid); } print " passwd users: @uid1\n"; opendir(DIR,'/home') or die "error opening home dir"; #foreach my $none(readdir(DIR)){ if($none = n(/^\./)) { next #; #} push(@uid2, $none); print "home Directory Elements :@uid2\n"; closedir(DIR); } @eval { map {lc} @uid1} = (); @uniqueElements = grep |e $eval{lc $_} @uid2; print "not in either locations:@uniqueElements\n"; exit;

In reply to orphaned users by wap

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.