C:\>perl -MEnv=@PATH -le "print for @PATH"
C:\WINDOWS\
...
| [reply] [d/l] |
C:\>perl -MEnv=@PATH -le print()for@PATH
...
| [reply] [d/l] |
Very interesting. I learned two things from that: about the Env module, and using the -l switch to turn print into say. The docs for Env says that $Config::Config{path_sep} is used, so it will handle Windows properly. Looking at the code in Env.pm, I see that split is given two arguments, so trailing nul fields are stripped, which another poster points out is a problem on Unix. Since that is the normal point of using the Env module, perhaps someone should issue a correction? Actually, it will return the nth item as an empty string if asked for, but it will not count it when checking the size, so the loop won't ask for it. It re-splits every time an element is gotten, yuck. | [reply] [d/l] [select] |