in reply to Sorting names using Regular Expressions and placing them in different Files.

Does this:
#!/usr/bin/perl use strict; use warnings; my %files = ( 'BSC' => 1, 'SBSCSubsystem' => 1, 'MCBTSSubsystem' => 1 +); no strict 'refs'; ( open ( $$_, '>', $_ ) or die "$_: $!\n") for ( keys %files ); my ( $dest, $date ); while ( <> ) { ( $dest, $date ) = split /-/, ((split /\s+/)[8]); print "dest: $dest\n"; ( print ${$dest} ( $_ ) ) if exists $files{$dest}; }
do what you need? If not, please try to clearly state what part of your spec it does not meet and what needs to be changed.

Note: the preceeding code takes the input on STDIN or as a file named as the first argument.


Christopher E. Stith
  • Comment on Re: Sorting names using Regular Expressions and placing them in different Files.
  • Download Code