Perl scalar Function - Tutorialspoint
文章推薦指數: 80 %
Perl scalar Function · Description. This function forces the evaluation of EXPR to be in scalar context, even if it would normally work in list context. · Syntax. Home CodingGround Jobs Whiteboard Tools Business Teachwithus PerlBasics Perl-Home Perl-Introduction Perl-Environment Perl-SyntaxOverview Perl-DataTypes Perl-Variables Perl-Scalars Perl-Arrays Perl-Hashes Perl-IF...ELSE Perl-Loops Perl-Operators Perl-Date&Time Perl-Subroutines Perl-References Perl-Formats Perl-FileI/O Perl-Directories Perl-ErrorHandling Perl-SpecialVariables Perl-CodingStandard Perl-RegularExpressions Perl-SendingEmail PerlAdvanced Perl-SocketProgramming Perl-ObjectOriented Perl-DatabaseAccess Perl-CGIProgramming Perl-Packages&Modules Perl-ProcessManagement Perl-EmbeddedDocumentation Perl-FunctionsReferences PerlUsefulResources Perl-QuestionsandAnswers Perl-QuickGuide Perl-UsefulResources Perl-Discussion SelectedReading UPSCIASExamsNotes Developer'sBestPractices QuestionsandAnswers EffectiveResumeWriting HRInterviewQuestions ComputerGlossary WhoisWho PerlscalarFunction Advertisements PreviousPage NextPage PerlOnlineTraining 46Lectures 4.5hours DeviKillada MoreDetail COMPLETEPERLProgramming 11Lectures 1.5hours HarshitSrivastava MoreDetail PerlforBeginners:LearnAtoZofPerlScriptingHands-on 30Lectures 6hours TELCOMAGlobal MoreDetail Description ThisfunctionforcestheevaluationofEXPRtobeinscalarcontext,evenifitwouldnormallyworkinlistcontext. Syntax Followingisthesimplesyntaxforthisfunction− scalarEXPR ReturnValue ThisfunctionreturnsScalar. Example Followingistheexamplecodeshowingitsbasicusage− LiveDemo #!/usr/bin/perl-w @a=(1,2,3,4); @b=(10,20,30,40); @c=(@a,@b); print"1-FinalArrayis@c\n"; @c=(scalar(@a),scalar(@b)); print"2-FinalArrayis@c\n"; Whenabovecodeisexecuted,itproducesthefollowingresult− 1-FinalArrayis123410203040 2-FinalArrayis44 perl_function_references.htm PreviousPage PrintPage NextPage Advertisements
延伸文章資訊
- 12. 純量變數(Scalar) - Perl 學習手札 - Easun.org
純量變數(Scalar) 在Perl的世界裡,變數其實是以非常簡單的形式存在。至少比起你必須記憶一大堆int,char等等的資料形態算是方便許多了。對於所有只需要儲存單一變數值 ...
- 2perl的内置函数scalar - 立体风- 博客园
scalar可以求数组的长度,但是,在scalar的说明里面并没有这一项。 Forces EXPR to be interpreted in scalar context and returns...
- 3精簡扼要的Perl 課程講義(一):純量(Scalar)與陣列 ...
Perl:1980年代誕生,直譯式語言。 print "Hello World!\n"; # 雙引號可內嵌特殊字元如: # \n Newline # \r Carriage Return # \...
- 4Perl的基本語法
Perl的資料型態大致分為四種:Scalar、Scalar Array、Hash Array、References, 看起來雖少但用起來卻綽綽有餘。尤其在寫Perl程式時可以不必事先宣告變數,這...
- 5Perl scalar Function - Tutorialspoint
Perl scalar Function · Description. This function forces the evaluation of EXPR to be in scalar c...