in reply to Re^4: Chomp, Concatenation and paths
in thread Chomp, Concatenation and paths

"One step" is quite an understatement. You're spawning a new process (which involves fetching %ENV), executing a shell, executing a shell command, checking for errors (or not) and parsing the response in order to get a value Perl already had to begin with.

Using $ENV{localappdata} saves an incredible number of steps.

Also, it doesn't return "Echo is on" if the variable isn't set, and it's portable.

Update: Added last paragraph.