in reply to Re: single line if conditional
in thread single line if conditional

it fails not storing anything in the database. I am using strict and warnings but no-go.

I have a form with a field 'maxsize' and a button 'Submit'.

my $maxsize = param('maxsize'); if (param('Submit')) { if ($maxsize ne "") { $files{"$name"} = "this or that" if $name ne ""; print "somethign should have worked"; # this prints! } }

Replies are listed 'Best First'.
Re: Re: Re: single line if conditional
by dreadpiratepeter (Priest) on Mar 31, 2004 at 17:02 UTC
    assuming that the lastest code is a copying error and $name should read $maxsize, then the problem is not in the if statement, it is later in the code when you use %files to do something.
    modifying your print to include $files{$maxsize} would verify this.
    If the $name is in your existing code, then that explains your problem. Because $maxsize is the variable with the data.


    -pete
    "Worry is like a rocking chair. It gives you something to do, but it doesn't get you anywhere."