[ILUG] Bloody Perl :-)
kevin lyda
kevin at ie.suberic.net
Wed Apr 3 00:24:30 IST 2002
On Tue, Apr 02, 2002 at 11:40:51PM +0100, Niall O Broin wrote:
> The problem was that attaching files from the web mail interface wouldn't
> work. Looking the web server's error log I established that this line
>
> my($strType) = $rQuery->uploadInfo($strFilename)->{'Content-Type'};
>
> results in a "Can't use an undefined value as a HASH reference" error.
>
> my $info_hash = $rQuery->uploadInfo($strFilename);
> my $strType = $info_hash->{'Content-Type'};
what about this:
my($strType) = ${$rQuery->uploadInfo($strFilename)}->{'Content-Type'};
> but it's bugging the hell out of me - I've been sprinkling braces and
> parentheses around like a good thing but to no avail - I can't make the
> single line work. WTF is wrong here ? I find it odd that such a basic thing
> wouldn't work in the app. AND the app's code is the exact same as the CGI.pm
> example but yet it doesn't work unless I split it up.
your fix is probably better actually since it would allow you to make
sure $info_hash is defined.
kevin
--
kevin at suberic.net "don't try to out-weird me, three eyes. i get
fork()'ed on 37058400 weirder things than you in my breakfast cereal."
meatspace place: inle --zaphod beeblebrox
http://suberic.net/~kevin
More information about the ILUG
mailing list