http://www.perlmonks.org?node_id=465789

juo has asked for the wisdom of the Perl Monks concerning the following question:

I have been looking to split a line using multiple conditions but have failed to do so. Anybody has an idea.

FDR [62.10060.051-F] [62.10051.381] 0 1 0

For example I want to split the above on space but if I have brackets it should take the whole string and ignore spaces within the bracket area. So in total I want to have six fields. I would like to do this in one split line.

# This can only work untill the first bracket my @feeder_line = split/\s+\[/;