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

Parse instruction file, with my current program

Thread Previous
From:
William.Ampeh
Date:
December 18, 2002 13:53
Subject:
Parse instruction file, with my current program
Message ID:
OFEF7030D4.09CE2688-ON85256C93.00774FE6@frb.gov

Hello,

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: build_inst.pl)


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

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


QUESTION:
---------------

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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About