in reply to What was the bait (project, problem or opportunity) that hooked you on Perl?

Way back, university, CAD lab architecture: a SPARCserver 300, around 10 SS10, some IPC/IPX, way too much students and too little storage. We had home directories on the server and on the workstations, automounted as appropriate, to squeeze every bit out of the hard disks, and regular complaints of students not being able to save their files after hours of work, because somebody else didn't clean up their scratch. Quotas were not feasible because the temporary requirements of space rendered hard and soft limits useless. We wrote scripts collecting disk usage for all users, so we knew about the sinners and sent mails but more often than not they were ignored. Writing those scripts I was fiddling with transformations, calculations, sed, awk, cut, expr and what not, and a coworker said "may be perl is for you." I tried it. Geez, how easy it was to generate reports with format.

So some LART was needed. Shutting out the evildoers was no solution, they would walk up to the staff and complain; and we couldn't decide which files to delete. "Let's force them to do that themselves", I said and wrote a perl script which did the du -s collecting and reporting via mail and rewrote their startup scripts. So the next time they logged in they were presented a lonely xterm in which this script was running, faking a tcsh, complete with readline, tab completion and alias support, but allowing only such commands as were useful to clean up their mess. After they had lowered disk usage sufficiently, the script would restore their environment and they could work as usual.

That was big fun (perl4 patchlevel 36) and got me hooked. It was amazing what you could do with perl, even without CPAN and modules.

  • Comment on Re: What was the bait (project, problem or opportunity) that hooked you on Perl?
  • Download Code