On Fri, Sep 28, 2007 at 03:30:23PM +0300, Octavian Rasnita wrote:
Hi,
I have a I18N module in my Catalyst application and I want to get the path
to the home directory of the application. Is it possible to get it without
hard codding it in that module?
The module is:
package
On 09/28/2007 07:30 AM, Octavian Rasnita wrote:
Hi,
I have a I18N module in my Catalyst application and I want to get the
path to the home directory of the application. Is it possible to get it
without hard codding it in that module?
$c-path_to()
--
Peter Karman . [EMAIL PROTECTED]
The __FILE__ compile-time constant may be of some use.. You should be able to
get the directory of the current module by doing something like:
package MyApp::I18N::foo;
use strict;
sub get_my_dir {
my ($dir) = __FILE__ =~ m!^ (.*) / [^/]+ !x;
return $dir;
}
Of course, if you wanted to do
MyApp-path_to()
2007/9/28, Octavian Rasnita [EMAIL PROTECTED]:
Hi,
I have a I18N module in my Catalyst application and I want to get the path
to the home directory of the application. Is it possible to get it without
hard codding it in that module?
The module is:
package
Have you looked at FindBin?
use FindBin;
from the docs:
EXPORTABLE VARIABLES
$Bin - path to bin directory from where script was invoked
$Script - basename of script from which perl was invoked
$RealBin - $Bin with all links resolved
$RealScript