- for my $target (@{ $self->{targets} }) {
- for my $pattern (@{ $target->{patterns} }) {
- if ($mime_or_uri =~ /$pattern/) {
- my $associations = $target->{associations};
- for my $context (keys %{ $associations }) {
- if ($self->{contexts}->{$context}->()) {
- $associations->{$context}->($file_or_uri);
- return;
+ for my $target (@{ $self->{targets} }) {
+ for my $pattern (@{ $target->{patterns} }) {
+ if ($mime_or_uri =~ /$pattern/) {
+ my $associations = $target->{associations};
+ for my $context (keys %{ $associations }) {
+ if ($self->{contexts}->{$context}->()) {
+ if ($options->{single}) {
+ $associations->{$context}->(@_);
+ return;
+ }
+ $associations->{$context}->($file_or_uri);
+ return if ($options->{fork});
+ next ARG;
+ }