I’m new in perl and have a little problem:
part of perl code:
print "${data_dir}\n";
#converting directory path to unix format (replacing all backslashes with slashes)
$data_dir = ~s/\\/\//g;
print "${data_dir}\n";
output:
C:/dev/../data
4294967295
Why results are different? I guess that the problem in $data_dir variable, because this works for other string, but what can be the problem?
P.S. $data_dir I’m getting from other module, and don’t know how it is constructed.
You have a space between the = and the ~. They should be together =~.
What you were doing is setting $data_dir equal to the complement (i.e. the ~ operator) of
s/\\/\//gwhich equals 4294967295.