On 04/28/2012 09:16 AM, sono...@fannullone.us wrote:
I'm having a problem with the following code:
#!/usr/bin/perl
use strict;
use warnings;
my $xtra = 'mail.example.com';
my $host = 'localhost' unless (defined ($xtra));
print $host;
I get the message "Use of uninitialized value $host in print". Does
anyone know why this doesn't work?
Thanks,
Marc
Greetings.
It doesn't work, because $host is uninitialized. What did you expect it
to be?
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/