« lib/App/SeismicUnixGui/misc/L_SU_local_user_constants.pm
↑ Summary
lib/App/SeismicUnixGui/misc/oop_instantiation_defaults.pm »
| 1 | package App::SeismicUnixGui::misc::oop_declaration_defaults; | ||
| 2 | |||
| 3 | use Moose; | ||
| 4 | our $VERSION = '0.0.2'; | ||
| 5 | |||
| 6 | =head2 Default perl lines for oop_declaration_defaults | ||
| 7 | of imported packages V 0.0.1 | ||
| 8 | ew | ||
| 9 | V 0.0.2 July 24 2018 include data_in, include data_out | ||
| 10 | V 0.0.3 4-5-19 remove duplicate program names | ||
| 11 | |||
| 12 | =cut | ||
| 13 | |||
| 14 | use aliased 'App::SeismicUnixGui::misc::manage_files_by2'; | ||
| 15 | |||
| 16 | =head2 program parameters | ||
| 17 | |||
| 18 | private hash | ||
| 19 | |||
| 20 | =cut | ||
| 21 | |||
| 22 | my $oop_declaration_defaults = { _prog_names_aref => '', }; | ||
| 23 | |||
| 24 | sub section { | ||
| 25 | my ($self) = @_; | ||
| 26 | |||
| 27 | my $ref_declaration_lines = _get_declaration(); | ||
| 28 | return ($ref_declaration_lines); | ||
| 29 | } | ||
| 30 | |||
| 31 | =head2 sub _get_declaration | ||
| 32 | |||
| 33 | filter duplicates 4-5-2019 | ||
| 34 | |||
| 35 | =cut | ||
| 36 | |||
| 37 | sub _get_declaration { | ||
| 38 | |||
| 39 | my ($self) = @_; | ||
| 40 | |||
| 41 | if ( $oop_declaration_defaults->{_prog_names_aref} ) { | ||
| 42 | |||
| 43 | |||
| 44 | my @unique_progs; | ||
| 45 | my $unique_progs_ref; | ||
| 46 | my $num_unique_progs; | ||
| 47 | my @prog_name = @{ $oop_declaration_defaults->{_prog_names_aref} }; | ||
| 48 | my $length = scalar @prog_name; | ||
| 49 | my @oop_declaration_defaults; | ||
| 50 | my $filter = manage_files_by2->new(); | ||
| 51 | |||
| 52 | # user-defined programs | ||
| 53 | # remove repeated programs from the list | ||
| 54 | $unique_progs_ref = $filter->unique_elements( \@prog_name ); | ||
| 55 | my $results = $unique_progs_ref; | ||
| 56 | return ($results); | ||
| 57 | } | ||
| 58 | else { | ||
| 59 | print("declaration,_get_declaration, missing declaration->{_prog_names_aref} \n"); | ||
| 60 | } | ||
| 61 | |||
| 62 | } | ||
| 63 | |||
| 64 | =head2 sub set_prog_names_aref | ||
| 65 | |||
| 66 | =cut | ||
| 67 | |||
| 68 | sub set_prog_names_aref { | ||
| 69 | my ( $self, $hash_aref ) = @_; | ||
| 70 | |||
| 71 | if ($hash_aref) { | ||
| 72 | $oop_declaration_defaults->{_prog_names_aref} = $hash_aref->{_prog_names_aref}; | ||
| 73 | |||
| 74 | } | ||
| 75 | else { | ||
| 76 | print("declaration, set_prog_names_aref, missing hash_aref\n"); | ||
| 77 | } | ||
| 78 | |||
| 79 | return (); | ||
| 80 | } | ||
| 81 | |||
| 82 | 1; |