zoukankan      html  css  js  c++  java
  • 钻石操作符

    #! /usr/bin/perl
    use strict;
    use warnings;

    =pod
    print " -----------------------------while(defined($equal_sign = <>))------------------------------- ";
    my $forwar_slash;
    while(defined($forwar_slash = <>)){
        chomp($forwar_slash);
        print "$forwar_slash "
    }
    print " -----------------------------while(defined($equal_sign = <>))------------------------------- ";
    =cut

    =head1
    print " ---------------------------while(<>)--------------------------------- ";
    while(<>){
        chomp;
        print "$_ ";
    }
    print " ---------------------------while(<>)--------------------------------- ";
    =cut

    =head1
    print " ----------------------------@ARGV-------------------------------- ";
    foreach(@ARGV){
        print $_;
    }
    print "foreach_end. ";
    my $metacharacter = shift(@ARGV);
    $metacharacter = shift(@ARGV);
    print $metacharacter;
    print " ----------------------------@ARGV-------------------------------- ";
    =cut

    =head1
    print " ---------------------------------_mannually_mod_@ARGV--------------------------- ";
    @ARGV = qw{pl.pl pl.pl};
    while(<>){
        chomp;
        print "$_ ";
    }
    print " ---------------------------------_mannually_mod_@ARGV--------------------------- ";
    =cut1

    print " ---------------------------------array_element_with_carriage_return_--------------------------- ";
    my @minus_sign = qw{ notation angle_brackets at_sign };
    print @minus_sign;
    print " ";
    print "@minus_sign";
    print " ---------------------------------array_element_with_carriage_return_--------------------------- ";

    print " ---------------------------------print_as_func_call_with_parentheses--------------------------- ";
    print (2+3)*4;
    print " ---------------------------------print_as_func_call_with_parentheses--------------------------- ";

    print " ---------------------------------printf_--------------------------- ";
    printf "username:%s.   password:%s.", $minus_sign[0], $minus_sign[1];
    print " ---------------------------------printf_--------------------------- ";

    print " ---------------------------------printf_%g_aoto_select_num_format_--------------------------- ";
    printf "NO 1: %g, NO 2: %g, NO 3: %g.", 5/2, 51/17, 51 ** 17 ;
    print " ---------------------------------printf_%g_aoto_select_num_format_--------------------------- ";

    print " ---------------------------------_percent_sign--------------------------- ";
    printf "Monthly interest rate: %.2f%% ", 5.25/12;
    print " ---------------------------------_percent_sign--------------------------- ";

    print " ---------------------------------store_format_string_2_scala_--------------------------- ";
    my @dollar_underscore = qw { wilma dino pebbles };
    my $semicolons = "The items are: ".("%10s " x @dollar_underscore);
    printf $semicolons, @dollar_underscore;
    print " ---------------------------------store_format_string_2_scala_--------------------------- ";

    print " ---------------------------------cooleset_--------------------------- ";
    printf"The items are: ".("%10s " x @dollar_underscore), @dollar_underscore;
    print " ---------------------------------cooleset_--------------------------- ";

    print " ---------------------------------backslash_percent_sigh_--------------------------- ";
    print "\%";
    print " ---------------------------------backslash_percent_sigh_--------------------------- ";

    print " ---------------------------------_--------------------------- ";

  • 相关阅读:
    Linux计划任务Crontab实例详解教程
    配置Linux任务计划
    全局变量报错:UnboundLocalError: local variable 'l' referenced before assignment
    Multipath多路径冗余全解
    Ubuntu 查看文件以及磁盘空间大小管理
    转载
    grep的用法
    Python标准库06 子进程 (subprocess包)
    Python与shell的3种交互方式介绍
    python和shell变量互相传递的几种方法
  • 原文地址:https://www.cnblogs.com/books2read/p/11004037.html
Copyright © 2011-2022 走看看