How to read a PID number from a file in a better way?

A file named `pid` contains the current process's PID or a 0;

I want to read it from the file in a variable and I came with the longest possible solution:

```
open my $fh, '<', 'pid';
my $line = <$fh>;
close $fh;

chomp $line;
my $pid = 0+ $line;

say $pid;

```

Is there a more elegant solution?