DOCUMENTATION
SYNOPSIS
PERL PERL PROGRAM NAME: control.pm
AUTHOR: Juan Lorenzo
DATE: V 0.0.2 Oct 3 2018
DESCRIPTION
BASED ON:
Version 0.0.1 made in early 2018
V 0.0.3 7.10.21
USE
NOTES
Examples
CHANGES and their DATES
Version 0.0.2
allows 'no' as well as the parameter values in the Project configuration files
Version 0.0.3
handles numeric-based names that should be handled as strings
0.0.3.1 can control value and suffix combination if needed
private hash control
sub clear
Clear all memory
sub _get_no_quotes
remove starting and ending single and double quotes
An entering zero exits as a zero
sub _get_string_or_number
Put quotes on strings Generally, file names are strings but numeric names will be interpreted as numbers, i.e., '1000.txt' will be seen as a number and not a file name
sub _get_string_or_number4aref
Put quotes on strings
sub reset_suffix4loop
blank out suffix4loop
sub _set_parameter_index4array Keep track of item index for a program
sub commas
Replace commas in strings
needed by Seismic Unix
sub commify place commas between list elements
sub empty_string test for interpreted arrays that should be
if defined(empty scalar) is found, nothing is done
$sref_entry_value should be scalar reference
i/p scalar reference
DB
$$sref_entry_value = 'nu';
package control replaces commas in strings
needed by Seismic Unix
sub empty_directory
sub get_back_slashBgone
Remove backslash in string
needed by Seismic Unix
sub get_base_file_name_aref
sub get_commas2space
Replace commas in strings
needed by Seismic Unix
get_first_name
must run set_first_name first
get_max_index
get (maximum number of parameters -1)
instantiate specific spec files on the fly
obtain max index from the corresponding spec file
make sure to use the proper alias in order to locate
the spec file
sub get_no_leading_zeros
remove starting and ending single and double quotes
sub get_no_quotes
remove starting and ending single and double quotes
sub get_no_quotes4array
remove starting and ending single and double quotes
sub get_path_wo_last_slash
first check to see if a final slash exists
sub get_string_or_number
Put quotes on strings
sub get_string_or_number_aref2 Put quotes on strings
sub get_string_or_number4aref
Put quotes on strings
get_suffix
sub get_new_file_name
remove ALL ticks from a name
sub get_value4oop
add quotes to string
sub w_quotes
add single quotes
ors
remove logical ors and use only the label
in front of the 'or' to write out to
the perl script
sub remove_su_suffix4aref
sub remove_su_suffix
For a scalar reference remove the .su extension
For a scalar also remove the .su extension
For an array reference do nothig
returns a non-empty string if EXPR is a reference, the empty string otherwise.
If EXPR is not specified, $_ will be used. The value returned depends on the
type of thing the reference is a reference to.
# || ref($$sref_entry_value) or ref($$sref_entry_value)crashes program TODO: if may not properly catch all variations of the input currently works for file_name_strings like '1.su' Nov 17 2017
set_aref
sub set_back_slashBgome
remove back_slash in a string
needed by Seismic Unix
sub set_commas2space
Replace commas in strings
needed by Seismic Unix
set_empty_str2logic
set_file_name
set_file_name_sref
set_first_name
sub set_flow_program_name_sref
Which program in the flow is active
sub set_flow_prog_name_index Which program in the flow is active
sub set_flow_prog_names_aref
set_str2logic
only used in Project.pm
sub set_path mark the path
set_suffix
sub set_suffix4oop
As needed by oop_prog_params
sub set_value
As needed by oop_prog_params
sub su_data_name
For a scalar reference remove the .su extension
For a scalar also remove the .su extension
For an array reference do nothig
returns a non-empty string if EXPR is a reference, the empty string otherwise.
If EXPR is not specified, $_ will be used. The value returned depends on the
type of thing the reference is a reference to.
DB
# ref($$sref_entry_value) or ref($$sref_entry_value)crashes program TODO: if may not properly catch all variations of the input but currently works for file_name_strings like '1.su' Nov 17 2017
sub freq
i/p scalar reference
o/p nothing
test for empty scalars
$sref_entry_value can be either scalar reference
or array reference
An array reference is flattened and returned with commas
A scalar reference is returned unchanged, essentially;
the string already has commas.
DB
3 POD Errors
The following errors were encountered while parsing the POD:
- Around line 1077:
Unknown directive: =head
- Around line 1434:
Unknown directive: =head
- Around line 1519:
Unknown directive: =head