In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail what $# ARGV means in perl. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
What does $# ARGV mean in perl
Perl will encounter some special symbols, people do not know what it is, such as not long ago encountered $# plus the array name ($# ARGV), do not know what it represents for the first time, look it up and know that he represents the number of the array minus one, that is, the index of the last element of the array @ ARGV. The purpose is to determine the number of command-line parameters at the beginning of the program, or to directly manipulate the last command-line argument. The official document states:
The array @ ARGV contains the command-line arguments intended for the script. $# ARGV is generally the number of arguments minus one, because $ARGV [0] is the first argument, not the program's command name itself. See $0 for the command name.
The $# plus array name represents the index of the last element of the array, which is not commonly used in actual code. To determine the number of arrays, the usual method is to use @ ARGV in a scalar context, while directly manipulating the last array element, you can use negative index values. Such as:
$I = @ ARGV
$n = $ARGV [- 1]
This is the end of the article on "what does $# ARGV in perl mean?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.