develooper Front page | perl.beginners | Postings from December 2002

Parse instruction file, with my current program

Thread Previous
December 18, 2002 13:53
Parse instruction file, with my current program
Message ID:


This is kind of sloppy, but it is what I have been able to come up with.
How can I make this more "cleaner"?

The data lines and output are at the end of this mail.

Thank you all.

Program file:
(See attached file:

Data file:
(See attached file: mainadddeck.prn)

Output from my program:
(See attached file: out.prn)


In my program, I have lines  such as:

   next if ( (!($line =~ /f.\d{9}\../i )) || $line =~ /^\s*--/ ); # weedout
comment & non data lines
   chomp $line;                              #remove end of line marker
   if ( $line =~ /--/ ){
      split /--/, $line, 2;
      $line = join '', $_[0];

   if ( $line =~ /\&\&/ ){
      split /\&\&/, $line, 2;
      $line = join '', $_[0];

Can I make these lines more compact and efficient?  If so, I will very much
appreciate any help.

Thank you all who responded to my earlier mail.

William Ampeh (x3939)
Federal Reserve Board
Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About