首頁  >  文章  >  微信小程式  >  Perl入門小程式分析

Perl入門小程式分析

高洛峰
高洛峰原創
2017-03-24 14:04:111781瀏覽

這篇文章介紹Perl入門小程式分析

#!/usr/bin/perl -w
#output the largest number from a file
$max_number = &max(3,5 ,10,4,6) ;
sub max
        {
        my($max_sofar_number) = shift @_ ;##    {
                       if($_ > ; $max_sofar_number)
                                                $max_sofar }   }
                        }
       

以上程式碼是計算多個數的最大數,感覺和C的寫法簡單了不少,真乃濃縮的是精華..

以上是Perl入門小程式分析的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn