
<erl>

out(A) -> 
    L = case queryvar(A,"page") of
            {ok, Page} ->
                %% only allow regular chars in Page
                case lists:all(fun(C) ->
                                       if
                                           $a =< C, C =< $z ->
                                               true;
                                           $A =< C, C =< $Z ->
                                               true;
                                           C == $_ ->
                                               true;
                                           C == $. ->
                                               true;
                                           true ->
                                               false
                                       end
                               end, Page) of
                    true ->
                        os:cmd("env LC_ALL=en_US.ISO-8859-1 man  " ++ Page ++ "  | col -b -p -x");
                    false ->
                        "illegal character detected in query arg"
                end;
            undefined ->
                "no man page found in query arg "
        end,
    {ehtml, 
     {html,[], 
      {'div',[{class,"man"}],
       {pre,[], L}}}}.



</erl>
