function is defined as
sub Modify_Debug {$Debug=shift;}
. Is there any syntax sugar?
function is defined as
sub Modify_Debug {$Debug=shift;}
. Is there any syntax sugar?
shift
function removes the first element from the array and returns it. The array is shortened by one element missing.
the default array in a function (if not given as an argument) is @ _
, or @ ARGV
in the file scope.
therefore, $Debug=shift;
is set to the first function argument.
shift () is a built-in Perl subroutine that takes an array as an argument, then returns and deletes the first item in the array. The common practice is to get all the parameters passed to the subroutine through the shift call. For example, suppose you have a foo subroutine with three parameters. One way to assign these parameters to local variables is in shift:
sub foo {
my $x = shift;
my $y = shift;
my $z = shift;
-sharp do something
print($x,$y, $z);
}
foo(1,2, 3 );
-sharp123
Previous: Using AutoSIzer in react-virtualized
I installed mingw on my computer and then downloaded the openssl source code installation prompt as follows: Perl v5.10.0 required--this is only v5.8.8, stopped at. configure line 12 BEGIN failed--compilation aborted at. configure line 12 then I ...
has a paragraph of characters <span style="color:rgb(85, 255, 255)">< span> want to extract and replace it with jian85255255 wrote a simple match like this [ u4e00- u9fa5] <span.style = "color :rgb ( but only m...
now you need to match the Chinese punctuation in the English Word document. $reg = [.?! ,: " () " < > [] "(). -~ examples] upright; matching results always match English double quotation marks and single quotation marks into Chinese. for...
Hello. I want the program to complete and form the following file , but the perl program cannot be written. Can you be busy ? id times 1 2 21 3 3 results in id start 11 10 1 11 20 21 10 3 1 10 3 11 20 3 21 30 ...
are there any good plug-ins to recommend? ...
bugzillaperlTemplate-Toolkit-2.28: collect2: ld returned 1 exit status dmake.exe: Error code 129, while making .. blib arch auto Template Stash XS XS .dll dmake.exe: Error code 255, while making subdirs ATOOMIC Template-Toolkit-2.28.tar.gz...
the server uses the CGI,B page button POST method to point to the generate.pl script. script processing takes a long time and generates a new page B. but after A clicks the button, the page content does not change, the window title shows the loading ci...