update: This returns the last two items in a split, not the item split on the last pattern, as the OP had intended.#!/usr/bin/perl -w use strict; my $string = "foo.bar.foobar"; my ($val1,$val2) = (split /\./,$string)[-2,-1]; print "$val1,$val2\n";
-enlil
In reply to Re: backward split
by Enlil
in thread backward split
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |