Perl: split


Use the split function to parse out the individual elements (for example, queue manager and queue). The format A!B!C!D is not very user friendly. The string is delimited by ! for each element. Parse each element into its own variable to separate each element.

Simple split example

 $inst_path = $QPASA_VARS[0]->{path};($host_name, $qmgr_name, $queue_name, $attr_name) = split /!/, $inst_path ;
 

The syntax for split is:
split /PATTERN/, EXPR, LIMIT
split /PATTERN/, EXPR
split /PATTERN/
split

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*