#!/usr/bin/perl -w use strict; my $line; my $package; my $jars; my $dependencies; while ($line = <>) { chomp $line; next if ($line =~ /^\s*\#/); next if ($line =~ /^\s*$/); ($package, $jars) = $line =~ /^([^\s]+)\s+(.*)/; $dependencies .= ",$package"; } $dependencies =~ s/^,//; print "$dependencies\n";