I’m trying to concatenate this string in Perl: “/.hush_profile”;
I keep getting a problem when I add in “/” into the string. I’ve tried escaping it, but that won’t work either.
Here’s my line of problem code:
#!/usr/bin/perl -w
use strict;
my($fileloc, $home_dir);
$home_dir = $ENV{"HOME"};
$fileloc = $home_dir;
$fileloc .= "/.hush_profile";
This adaptation of your code gives me the expected output:
Output:
Even if I unset
$HOMEin the environment, I get something:This happens to be Perl 5.12.1 on RHEL 5 (x86/64), but I get the same with Perl 5.8.8 on the same platform.