Why is $ENV{COLUMNS} undefined inside the Perl program?

From: Adam (a24061_at_yahoo.munged)
Date: 06/28/04


Date: Mon, 28 Jun 2004 11:24:04 GMT

The environment variable $COLUMNS works as expected in bash

/home/adam $ echo $COLUMNS
165
[resizes xterm window]
/home/adam $ echo $COLUMNS
132

but $ENV{COLUMNS} is undefined inside a Perl program run from this
shell. Why? And how do I get its value inside the program?

I also tried
use Env qw (COLUMNS) ;
but $COLUMNS did not get defined.

-- 
Thanks,
Adam


Relevant Pages

  • Re: Cronjob does not run properly
    ... porgress is shown in stdout and the output file is generated. ... 1 bash script - script.sh ... echo START `date` ... line, echo statements display, the perl program runs ok with the ...
    (linux.redhat.misc)
  • Re: Perl translation needed for simple bat file
    ... It is usually best to have a go at writing a Perl program yourself before asking here for help. ... echo set feedback off>>%tempfile% ... echo spool off>>%tempfile% ...
    (comp.lang.perl.misc)
  • Cronjob does not run properly
    ... home directory - /home/userid ... Takes couple parameters from ARGV and generates 1 output file in the ... echo START `date` ... line, echo statements display, the perl program runs ok with the ...
    (linux.redhat.misc)
  • Re: execute command on variable
    ... Bareword found where operator expected at TEST1.pl line 5, ... String found where operator expected at TEST1.pl line 5, near "echo ... (Do you need to predeclare echo?) ... Using shell script syntax inside of a Perl program, ...
    (perl.beginners)
  • Re: Checking for a number. Was: "dumb question"
    ... uses only bash functionality. ... then echo "Whole number or decimal number" ... tried to see if awk or perl would fail to understand the test string as ... A perl program to test for a number in a host of ways follows below. ...
    (comp.unix.shell)