in reply to Re: Re: Need help protecting the user - detecting and redirecting browsers the ADVANCED way...
in thread Need help protecting the user - detecting and redirecting browsers the ADVANCED way...

since you're building this data structure manually, you have the ability to keep it in a config file, and do or eval it when neccessary. if you have unique values, for instance HTTP_USER_AGENT, you can use this as the key to the hash. i have an example below.

if you don't have unique values, or require some combination of values for a unique key, you'll have to modify the data structure a little bit, to make sure your keys are unique.

in any case, a read through perldsc will give you insight on working with complex data structures like hashes of hashes.

my %passed = { "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)"=> { NAME => "MS Internet Explorer", VERSION => "5.0", PLATFORM => "NT", # more specialized info here }, # more HTTP_USER_AGENT strings here... URI_REDIRECT => 'http://passaddress/', }; # if $test_key is the unique browser identifier you're looking for # you may print like... my $message = join( ' ', $passed{$test_key}->{NAME}, $passed{$test_key}->{VERSION}, '/', $passed{$test_key}->{PLATFORM), # etc. );

~Particle ;Þ

  • Comment on Re: Re: Re: Need help protecting the user - detecting and redirecting browsers the ADVANCED way...
  • Select or Download Code

Replies are listed 'Best First'.
Re: Re: Re: Re: Need help protecting the user - detecting and redirecting browsers the ADVANCED way...
by S_Shrum (Pilgrim) on Mar 03, 2002 at 09:39 UTC

    Ahhhh! I didn't know you could have key names with spaces in them. I learned something new. In that case, you're right.

    Moo-Chess-Grass-e-ous!

    ======================
    Sean Shrum
    http://www.shrum.net