How to get Path Separator in Perl?

Posted by ram on Stack Overflow See other posts from Stack Overflow or by ram
Published on 2010-05-24T13:30:46Z Indexed on 2010/05/24 13:41 UTC
Read the original article Hit count: 170

Filed under:
|
|
|

In case of Java, we can get the path separator using

System.getProperty("path.separator");

Is there a similar way in Perl? All I want to do is to find a dir, immediate sub directory. Say I am being given two argumens $a and $b; I am splitting the first one based on the path separator and joining it again except the last fragment and comparing with the second argument. The problem is my code has to be generic and for that I need to know whats the system dependent path separator is? Could you help if there is any way to get it? TIA

© Stack Overflow or respective owner

Related posts about perl

Related posts about path