fork download
  1. $str = '[ToNode=cup-subscriber][Reason=Critical service is down][FromNode=cup-publisher][AppID=Cisco UP Server Recovery Manager]';
  2.  
  3. @pieces = split/(?<=\])(?=\[)/,$str;
  4.  
  5. print "$_\n" foreach(@pieces);
Success #stdin #stdout 0s 4552KB
stdin
Standard input is empty
stdout
[ToNode=cup-subscriber]
[Reason=Critical service is down]
[FromNode=cup-publisher]
[AppID=Cisco UP Server Recovery Manager]