ormy $element = "sample/fresh/fresh/0/pineapple"; $word = (split (/\//, $element))[-1]; print $word; #pineapple
my $element = "sample/fresh/fresh/0/pineapple"; $word = ( $element =~ /([^\/]+)(?:\/)?/g )[-1]; print $word; #pineapple
In reply to Re: Parse a line
by holli
in thread Parse a line
by hypergrid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |