[localhost:~/Documents/perl/monks] metaperl% perl log-posts.pl url? http://www.perlmonks.org/index.pl?node_id=124633&lastnode_id=126016 title? Re: Big Ball of Mud category (EOF to end)? design patterns category (EOF to end)? software engineering category (EOF to end)? monolithic programs category (EOF to end)? Inserting: node 124633 Title Re: Big Ball of Mud Categories design patterns, software engineering, monolithic programs [localhost:~/Documents/perl/monks] metaperl% #### use strict; sub trim { $_[0] =~ s/^\s+//g; $_[0] =~ s/\s+$//g; } sub question { print "$_[0]? "; <>; } my $url = question 'url'; my ($node) = $url =~ /node_id=(\d+)/ ; my $title = question 'title'; trim $title; my @cat; while (my $cat = question 'category (EOF to end)') { trim $cat; chomp($cat); push @cat, $cat; } print "Inserting:\n"; print "node\t\t$node\n"; print "Title\t\t$title\n"; { local $"= ', '; print "Categories\t@cat\n"; }