zoukankan      html  css  js  c++  java
  • maston总结

    Substitution Tags(替换标签)

      % $cd_count = 207; # this is embedded Perl
      You have <% $cd_count %> CDs.

    Escaping substitutions(转义替换), 两个字符 h(html),u(URL),n(不转义)

    <textarea name="foo"><% $foo_data | h %></textarea>
    Homepage: <a href="redirect?url=<% $homepage | u %>">   
    
    

    Embedded Perl: % Lines and <%perl> Blocks (嵌入perl)

      % foreach my $person (@people) {
        Name: <% $person->{name} %>
        Age: <% $person->{age} %>
        Height: <% $person->{height} %>
        Weight: <% $person->{weight} %>
      % }

    如果有多行则可以用<%perl> </%perl>

    If you have more than a few lines of Perl code in a row, however, it is probably best to use a Perl block instead
    <%perl> my @words = $sentence =~ /(S+)/g; my @small_words = grep { length $_ <= 3 } @words; my @big_words = grep { length $_ > 3 } @words; </%perl>
    
    
    

    Calling Other Components: <& &> Tags   调用其它组件

    调用组件 

    <& /path/to/menu &>
    <& $component &>
    <& menu, width => 640, admin => 1 &>

    可以用+或者()表示为表达式运行

    <& ( component_path_returner( ) ) &>
    <& +component_path_returner( ) &>

    <%init> blocks , 初始化块

     It is currently <% $temp %> degrees.
      <%init>
       my ($temp) = $dbh->selectrow_array("SELECT temperature FROM current_weather");
      </%init>

    <%args> 

    <%args>
       $color   #是必需要传入数据的
       $size => 20
       @items => ( 1, 2, 'something else' )
       %pairs => ( key1 => 1, key2 => 'value' )
      </%args>

    获取提交表单值 $ARGS{'submit.x'}

    % foreach (sort %ARGS) {
        <% $_ %>
      % }
      
      % foreach (sort @_) {
        <% $_ %>
      % }

    可通过http传递获取参数

    the mason book



  • 相关阅读:
    快速认识ELK中的L
    HBase启动和停止命令
    Kafka 快速起步(作者:杜亦舒)
    Kafka 消息存储及检索(作者:杜亦舒)
    HBase集群搭建
    Kafka消息保证不丢失和重复消费问题
    Kafka文件的存储机制
    Kafka的配置文件详细描述
    kafka常用操作命令
    BZOJ1769 : [Ceoi2009]tri
  • 原文地址:https://www.cnblogs.com/qinzb/p/9002956.html
Copyright © 2011-2022 走看看