- or download this
echo "$XXX" | perl -pe '$_=(split "/", (split ";")[0])[-1]' - or download this
my $url = "/bla/bla/123;yarg";
my @tmp = split ";", $url; # break string at semicolons
@tmp = split "/", $tmp[0]; # break first chunk apart at "/"
print $tmp[-1]; # Print the value we want
- or download this
my $url = "/bla/bla/123;yarg";
...
# The last item holds the value we want
print $tmp[-1];
- or download this
my $url = "/bla/bla/123;yarg";
$url = (split "/", (split ";", $url)[0])[-1];
print $url;
- or download this
perl -e '$a="/bla/bla/123;yarg"; print (split "/", (split ";", $a)[0])
+[-1]'
print (...)_ interpreted as function at -e line 1.
syntax error at -e line 1, near ")["
execution of -e aborted due to compilation errors.
- or download this
perl -e '$a="/bla/bla/123;yarg"; print +(split "/", (split ";", $a)[0]
+)[-1]'
123