Simple question, probably obvious answer

Assume I have user.pm with a exported function of getCookieValue()
Within getCookieValue I use CGI::Cookie to pull the cookie value. Will 
this work correctly.
Basically will CGI::Cookie in a function call work correctly?
At the moment the below function is not working and I'm not sure why.

sub getCookieValue {
    use CGI::Cookie; # - Will this properly access the apache interface?
    use user qw/getCookieValue/;
    use globals qw/COOKIE_NAME/;

    my %cookie = fetch CGI::Cookie;
    if (! defined($cookie{COOKIE_NAME})) {
        return("");
    } else {
        return($cookie{COOKIE_NAME}->value);
    }
}


usage:

<%init>
my $cVal = getCookieValue(); # Assume I validated cookie exists
...
</%init>

Thanks


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to