SlugMass has asked for the wisdom of the Perl Monks concerning the following question:
After I get the individual variables, with their array dimensions, I will use the information for generating new code.#!/usr/bin/perl -w # # Scenario: Given lines of f77 code, parse out the comma delimited var +iables. # use Data::Dumper; use Text::Balanced qw(extract_delimited extract_multiple extract_varia +ble); # A real application will read in f77 source, this is just a sample. my $string = "real*8 Eparams(0:maxParam),Emvm(0:3),MyArray(row,col),Yo +urArray(12,(j,k),m)"; # my @fields = extract_multiple($string, [ sub { extract_delimited($_[0],q{\,}) } ], undef, 1); print "Fields:",Dumper(\@fields); exit(0);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: f77 variable list parsing
by Sandy (Curate) on Jun 28, 2004 at 20:59 UTC | |
by SlugMass (Novice) on Jul 02, 2004 at 20:09 UTC | |
by Sandy (Curate) on Jul 05, 2004 at 13:28 UTC |