In https://stackoverflow.com/a/3220688/180275 the answer suggests that (after an open
) $^E
can be compared with 0x20 to determine if a file is being used by another process:
open ($fh, "<", "the-file");
if ($^E == 0x20) {
...
}
I have tried that and it works. However, if I print the value of $^E
I get a string (The process cannot access the file because it is being used by another process
).
How then is the comparison to a number still possible?
This is on Windows.
In statistics, the symbol e is a mathematical constant approximately equal to 2.71828183. Prism switches to scientific notation when the values are very large or very small. For example: 2.3e-5, means 2.3 times ten to the minus five power, or 0.000023.
You can compare two numbers written in scientific notation by looking at their powers of 10. The number with the greater power of 10 will be the greater number. If two numbers have the same power of 10, then compare the decimal numbers to determine the greater number. Here is an example.
Comparing numbers in math is defined as a process or method in which one can determine whether a number is smaller, greater, or equal to another number according to their values. The symbols used for comparing numbers are “ ”, which means “greater than”; “ ”, which means “less than”; and “=”, which means “equal to”.
Ratios are used to compare two numbers. The value of a ratio a:b is the quotient a ÷ b, or the result of dividing a by b.
>perl -E"open my $fh, '<', 'nonexistent'; say 0+$^E; say ''.$^E;"
2
The system cannot find the file specified
Like $!
, $^E
is a dualvar, a scalar that contains two values. One's a string, and one's a number.
>perl -E"say $^E = 0x20;"
The process cannot access the file because it is being used by another process
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With