in reply to Help with an IF?
why is it not validating as a truth?Because you are using a numerical comparision operator (==) to compare two strings. What you want is "eq"
See perldoc perlop
Now, if you don't mind me saying so.. that big series of if/elsif's really smells!
If it were me, I would refactor that into something like so:
Cheers,my $title = 'Political Animal'; # Or in your case, $q->param('title') my %links_to = ( "Political Animal" => "pa", "Newslink" => "nl", "New Slang" => "ns", "Rant With Ryan" => "rwr", "Planet Venus" => "pv", "All Day Breakfast" => "adb", ); my $link = $links_to{$title}; print $link;
|
|---|