#!/usr/bin/perl
my $text = "red 1 green 3 blue";
my @result1 = split /red|green|blue/, $text; my @result2 = split /red|green|blue/, $text, -1; my @result3 = grep { /\S/ } split /red|green|blue/, $text;
IyEvdXNyL2Jpbi9wZXJsCgoKbXkgJHRleHQgPSAicmVkIDEgZ3JlZW4gMyBibHVlIjsKbXkgQHJlc3VsdDEgPSBzcGxpdCAvcmVkfGdyZWVufGJsdWUvLCAkdGV4dDsKcHJpbnQgam9pbiAiOyIsIEByZXN1bHQxOwpwcmludCAiXG4iOwpteSBAcmVzdWx0MiA9IHNwbGl0IC9yZWR8Z3JlZW58Ymx1ZS8sICR0ZXh0LCAtMTsKcHJpbnQgam9pbiAiOyIsIEByZXN1bHQyOwpwcmludCAiXG4iOwpteSBAcmVzdWx0MyA9IGdyZXAgeyAvXFMvIH0gc3BsaXQgL3JlZHxncmVlbnxibHVlLywgJHRleHQ7CnByaW50IGpvaW4gIjsiLCBAcmVzdWx0Mzs=