Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
On running this, I don't get all the expected output -#!/usr/bin/perl -w # sub fred { use strict ; # my $file = 'xxrcdisnaeexist' ; my $TV = 0 ; # open IP, $file or (print "\n\tNo kin d\n" , print "\n\tI bet ye dinna see this\n" , return 0 ) ; # if ($TV) { print "\n\tIt's Twoo It's Twoo\n" ; } # } $fred or die "\n\tThis failed min!!!\n" ;
The multiple actions after the or don't appear to have worked - though clearly a 0 (False) HAS been returned as desired! Why have my print messages failed to appear? If this IS the dumbest question asked I apologise but I can't see why this is happening and It's becoming irritating!$ xxrcor.pl Name "main::IP" used only once: possible typo at xxrcor.pl line 9. This failed min!!! $
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: 'or' Bug Bear
by cog (Parson) on Feb 10, 2005 at 11:49 UTC | |
by holli (Abbot) on Feb 10, 2005 at 11:54 UTC | |
by cog (Parson) on Feb 10, 2005 at 11:59 UTC | |
|
Re: 'or' Bug Bear
by cog (Parson) on Feb 10, 2005 at 11:52 UTC | |
by itub (Priest) on Feb 10, 2005 at 14:11 UTC | |
|
Re: 'or' Bug Bear
by holli (Abbot) on Feb 10, 2005 at 11:52 UTC | |
|
Re: Bug Bear - or
by dave_the_m (Monsignor) on Feb 10, 2005 at 12:12 UTC | |
|
Re: Bug Bear - or
by reneeb (Chaplain) on Feb 10, 2005 at 12:03 UTC | |
|
Re: 'or' Bug Bear
by MidLifeXis (Monsignor) on Feb 10, 2005 at 20:12 UTC |