in reply to Re: How to split "/"
in thread How to split "/"
A quick and dirty solution might be really to use something like my @path = split m:/:, "/home/temp/login"; Disadvantage of such a solution is that your code will break if a dirname contains a slash or you start working on Windows.
Actually, / is not allowed in directory or file names. Windows disallows both \ and /
FYI, Windows accepts both \ and / as separators:
perl -e "print $ARGV[0] . ':';open(FH,$ARGV[0]) or die $ARGV[0] . ':' . $!;" dir/file.txt
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to split "/"
by bigj (Monk) on Apr 29, 2014 at 15:15 UTC | |
by RonW (Parson) on Apr 29, 2014 at 16:04 UTC |