# Script does not output

**URL:** <https://community.unix.com/t/script-does-not-output/293036>\
**Category:** Shell Programming and Scripting\
**Created:** [August 8, 2011, 3:49am UTC](https://community.unix.com/t/script-does-not-output/293036 "2011-08-08T03:49:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ab52](https://community.unix.com/user_avatar/community.unix.com/ab52/32/5263_2.png) [@ab52](https://community.unix.com/u/ab52)\
**Post date:** [August 8, 2011, 3:49am UTC](https://community.unix.com/t/script-does-not-output/293036/1 "2011-08-08T03:49:06Z")

</div>

Hi all

I have the follow script written in perl, it should look in /var/log/X0rg.0.log and if there is an error reproted in the return a message but i cannot get it to return anything, i have tired chaning the word i grep for to something very simple, like Error but still it returns nothing

```nohighlight
#!/usr/bin/perl

use strict;
use Data::Dumper;
use Set::Scalar;
use List::Util qw(first);
use Sys::Hostname;

use lib qw(/tools/SITE/perl);
use dnutil qw(isRenderNode);

exit 0 if (isRenderNode(hostname));

my $PROG = 'xorgchk';
my $xorgconf = '/etc/X11/xorg.conf';
my $xorglog = '/user_data/XorgLog';

# check the X log file for dumb stuff
if (0) {
if (-e "$xorglog") {
    open my $xorg_log, $xorglog or die "$PROG: can't open $xorglog: $!\n";
    my @xorglog = <$xorg_log>;
    close $xorg_log;
   if (grep { "Error" } @xorglog) {
        print "incorrectly configured Wacom - device not found\n";
    }
  
    
   # XXX more... 
}
}

```

any ideas

---

<div class="post-metadata">

**Author:** ![pludi](https://community.unix.com/user_avatar/community.unix.com/pludi/32/1278_2.png) [@pludi](https://community.unix.com/u/pludi)\
**Post date:** [August 8, 2011, 3:57am UTC](https://community.unix.com/t/script-does-not-output/293036/2 "2011-08-08T03:57:32Z")

</div>

Check the output of this snippet, and then look at your code again, and it should be obvious why you're not getting any output:

```nohighlight
perl -e 'if(0){print "true";}else{print "false"}print "\n";'

```

---

<div class="post-metadata">

**Author:** ![ab52](https://community.unix.com/user_avatar/community.unix.com/ab52/32/5263_2.png) [@ab52](https://community.unix.com/u/ab52)\
**Post date:** [August 8, 2011, 3:58am UTC](https://community.unix.com/t/script-does-not-output/293036/3 "2011-08-08T03:58:58Z")

</div>

Yup, i do apoligise to all, it is far to early, it should have been

```nohighlight
if (!0) {

```

thanks
