E
Emily Beylor
I have a path string (/usr/local/bin/file.10102003) that I want to split
into a $path and $file section as well as a $date section.
I'm able to get the $path and $file information (perhaps not very elegantly,
but still) as follows:
while(/\//g) {
$position = pos();
}
$getFile = substr($_, $position, length($_));
$getPath = substr($_, 0, $position);
I'm not sure how to get the $date information from the $file name. I've
tried with the following code, but it doesn't work:
$_=$getFile;
@a = m/([\d]+)/g;
print "@a\n";
How do I get the date information out of vi.10102003 to a representation of
$date = 10/10/2003 ?
Thanks
EB.
into a $path and $file section as well as a $date section.
I'm able to get the $path and $file information (perhaps not very elegantly,
but still) as follows:
while(/\//g) {
$position = pos();
}
$getFile = substr($_, $position, length($_));
$getPath = substr($_, 0, $position);
I'm not sure how to get the $date information from the $file name. I've
tried with the following code, but it doesn't work:
$_=$getFile;
@a = m/([\d]+)/g;
print "@a\n";
How do I get the date information out of vi.10102003 to a representation of
$date = 10/10/2003 ?
Thanks
EB.