#!/share/bin/perl -w # Illustration of code that creates lists by splitting up # text dumps of database files # The input file contains data like the following: # James:Security guard:Buildings & Grounds:B2:9776 # These data supposedly represent an employee name, role, department, office, and # phone number. # # This tiny Perl fragment is listing the names of those for whom there is not room # recorded - e.g. entries like # Dan:Painter:Buildings & Grounds::33445 # Redirect standard input from file; so on Windows # perl noroom.pl < persons.txt while() { @line = split /:/ ; $room = $line[3]; if(!$room) { print $line[0], "\n"; } }