> -Original Message-
> From: lorid
> Im want to set the $photo_year and $photo_month to another
> value if it
> is not already set.
>
> my $ARGV[0] will sometimes be passed a string like
> this:nvIGRA with no
> date at end and sometimes with date nvIGRA200511
> if it does not have
On Fri, 22 Jul 2005 12:05:16 -0700, you wrote:
>You want to check if it's null, not if it's defined. Defined means that the
>variable exists.
Almost. Defined means the variable exists AND its value is not undef, as
this snippet demonstrates:
my $foo;
print !defined $foo;
As for the OP's ques
I see, that's a really bad example and I can see why it would confuse.
Variables in perl don't have a true "undefined state" like say C might.
Because of autovivification, *all* variables are in a state of potential
existence. Once u reference a variable, it comes into existence with the
undefined
Title: Re: help with defined and !not defined
lorid wrote, on Fri 7/22/2005 10:27: my $a;: my $b;:: $b = 10;:: if
(defined $a){
All well and good; but in your
original post (which I no longer have available to quote, but I believe I recall
correctly), your $a (or equivalent) was the
Chris Wagner wrote:
You want to check if it's null, not if it's defined. Defined means that the
variable exists. You want something like if ($photo_year) {...}.
At 01:48 PM 7/21/05 -0700, lorid wrote:
my $ARGV[0] will sometimes be passed a string like this:nvIGRA with no
date at end and
sday, July 21, 2005 3:03 PM
To: perl-win32-users
Subject: Re: help with defined and !not defined
You want to check if it's null, not if it's defined. Defined means that the
variable exists. You want something like if ($photo_year) {...}.
At 01:48 PM 7/21/05 -0700, lorid wrote:
>my
You want to check if it's null, not if it's defined. Defined means that the
variable exists. You want something like if ($photo_year) {...}.
At 01:48 PM 7/21/05 -0700, lorid wrote:
>my $ARGV[0] will sometimes be passed a string like this:nvIGRA with no
>date at end and sometimes with date nvIG