Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Sorting names using Regular Expressions and placing them in different Files.

by alpha (Scribe)
on Dec 28, 2006 at 19:55 UTC ( [id://592131]=note: print w/replies, xml ) Need Help??


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

Here you go :)
#!/usr/bin/perl -w use strict; my $prefix = '-20041202'; my @types = qw(BSC SBSCSubsystem MCBTSSubsystem); eval 'open ('.$_.',">'.$_.'") or die($!)' for @types; die $@ if $@; while(<*>) { my $t_fname = $_; next if ($t_fname eq '.' or $t_fname eq '..'); $t_fname =~ /^$_$prefix/ and eval('print ('.$_.' $t_fname.chr 10)' +) for @types; }

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://592131]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-03-28 18:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found