in reply to How to Open Files from Subdirectory

Just print out $name and you'll see what's wrong with it.

I'm spilling the beans: it will contain "/files/data"".

But your mechanism is very unsafe. What if the file path contains more than one dot?

Replies are listed 'Best First'.
Re^2: How to Open Files from Subdirectory
by neversaint (Deacon) on Aug 03, 2005 at 08:18 UTC
    Dear bart,
    Thanks for your correction. I've made update based on your suggestion. Now $name is printed as "data". I've also added function to clarify my intention. But it still gives me:
    Can't open file /files/data.pri:
    Is there anything wrong with this syntax?
    my $file = "/files/test1.fasta";
    If not, please kindly advice what's the correct one.

    ---
    neversaint and everlastingly indebted.......