tos has asked for the wisdom of the Perl Monks concerning the following question:
for cutting off the tail (filename) of a given string i found two solutions.
Unfortunately i can not use $POSTMATCHs shortform $' on command line.perl -we 'use English;$x="j:/tmp/lz/ncak.030610.141654";$x=~/.+\// && +print $POSTMATCH' ncak.030610.141654
any suggestions for other, perhaps more elegant, timtowdi's ?perl -we '$x="j:/tmp/lz/ncak.030610.141654";($m = $_) for split "/",$x +;print $m' ncak.030610.141654
greetings
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: getting the tail of a string
by Zaxo (Archbishop) on Jun 10, 2003 at 15:32 UTC | |
|
Re: getting the tail of a string
by adrianh (Chancellor) on Jun 10, 2003 at 15:32 UTC | |
by sauoq (Abbot) on Jun 10, 2003 at 19:31 UTC | |
by adrianh (Chancellor) on Jun 10, 2003 at 20:43 UTC | |
|
Re: getting the tail of a string
by TomDLux (Vicar) on Jun 10, 2003 at 15:54 UTC | |
by grinder (Bishop) on Jun 10, 2003 at 17:11 UTC | |
|
Re: getting the tail of a string (fun with command line quotes.)
by sauoq (Abbot) on Jun 10, 2003 at 19:52 UTC | |
|
Re: getting the tail of a string
by DrHyde (Prior) on Jun 10, 2003 at 18:53 UTC |