In the terminal, I can access variable $LINES:
$ echo $LINES
39
Running Perl script like so:
#!/usr/bin/env perl
use strict; use warnings;
my $cmd = q|echo $LINES|;
my $lines = `$cmd`;
print "lines: $lines\n";
gives output: lines:. I tried also accessing %ENV, but it does not contain this particular key.
How could I access shell variable $LINES from a Perl script?