use warnings; use strict; my ($str, $logoutLink); my $Session = { usrSystem => 'MFR', usrLevel => 'some_val', }; sub foo { if ($Session->{'usrSystem'} eq "MFR" && $Session->{'usrLevel'}=="!M") { $str .= ""; $str .= xmlFileData("Content/SSResources", $Session->{'usrSystem'}.".xml", "mLeftIndex()"); $str .= xmlFileData("Content/SSResources", $Session->{'usrSystem'}.$Session->{'usrAccount'}.".xml", "mLeftIndex()"); $str .= $logoutLink; $str .= ""; return $str; } ###Shows regular for everyone except this access level... ? if ($Session->{'usrSystem'} eq "MFR" && !$Session->{'usrLevel'}=="!A") { $str .= ""; $str .= xmlFileData("Content/SSResources", $Session->{'usrSystem'}.".xml", "mLeftIndex()"); $str .= xmlFileData("Content/SSResources", $Session->{'usrSystem'}.$Session->{'usrAccount'}.".xml", "mLeftIndex()"); $str .= $logoutLink; $str .= ""; } return $str; } foo(); #### $ perl $_ Argument "!M" isn't numeric in numeric eq (==) at tst.pl line 11. Argument "some_val" isn't numeric in numeric eq (==) at tst.pl line 11. Undefined subroutine &main::xmlFileData called at tst.pl line 14.