Perl: Split - Documentation for Mainview Middleware Monitor 9.0

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

Robert Thorne

Robert Thorne

Automotive & Future Transportation Editor

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.

Share this article
Twitter Facebook Pinterest