welcome Rapazzini.. but ???

First have a look at Markup in the Monastery to put code tags around your code.
After this, your code does not make much sense to me. what org::item::essential is? a subroutine of the org::item class? what that (unknown to me) sub does? Normally a file path form depend on the underlaying operating system:
my $linux_path = '/usr/bin/perl'; my $win_path = 'c:\scripts\my.log'; my $old_macos = 'Hard Drive:My Folder:My Document'; #dunno
You have to pay attention when you pass file names to subs to the current directory where the program works. if you run your program in the /some/path and you do not change current directory while running, then a bare_filename.ext will be relative to /some/path ending to be /some/path/bare_filename.ext

To deal with file path in a OS portable manner you can use the core module File::Spec as simply as:
$path = File::Spec->catfile( @directories, $filename );

HtH
L*
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

In reply to Re: Passing file location in a subroutine by Discipulus
in thread Passing file location in a subroutine by Rapazzini

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.