Hi
I have written a small program like this to just print file2 from the second
element of the array by removing the .template from the entry (the name file2
can change and can be longer or shorter)
use strict;
use Data::Dumper;
use warnings;
my @templates = (
"/a/b/c/d/e/f/file1.template",
"/a/b/c/d/e/f/file2.template"
);
my @tokens=split( /\//, $templates[1]);
print("\n".substr($tokens[$#tokens],0,-9));
However I want this to be more efficient and want to do this in a single line
as I have to do this several times.
How can I do that?
TIA,
Regards,
Satya
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/