operators - What does =~ do in Perl? - Stack Overflow man perlop "perlop - Perl operators and precedence" (at least in UNIX-like) answers this question: "Binary "=~" binds a scalar expression to a pattern match " – U Windl Commented Apr 1, 2020 at 21:11
variables - What is the meaning of @_ in Perl? - Stack Overflow perldoc perlvar is the first place to check for any special-named Perl variable info Quoting: @_: Within a subroutine the array @_ contains the parameters passed to that subroutine More details can be found in perldoc perlsub (Perl subroutines) linked from the perlvar: Any arguments passed in show up in the array @_
What does the - gt; arrow do in Perl? - Stack Overflow Perl arrow operator has one other use: Class−>method invokes subroutine method in package Class though it's completely different than your code sample Only including it for completeness for the question in the title
Whats the use of lt; gt; in Perl? - Stack Overflow So, if the shell is handing you a bunch of file names, and you'd like to go through each one's data in turn, perl's <> operator gives you a nice way of doing that it puts the next line of the next file (or stdin if no files are named) into $_ (the default scalar) Here is a poor man's grep: while(<>) { print if m pattern ; } Running this script:
Perl: Use s (replace) and return new string - Stack Overflow In Perl, the operator s is used to replace parts of a string Now s will alter its parameter (the string) in place I would however like to replace parts of a string befor printing it, as in
What is the difference of using special variable $_ and @_ in Perl? The reason $_ is used so often is that some Perl operators assign to it by default, and others use its value as a default for their argument It can lead to shorter code if you embrace it, but you never have to use it
perl logical and operator - Stack Overflow Is there a statement that performs a simple T F or 0 1 logical conjunction operation, returning either boolean T F or binary or integer representations of 0 or 1 as the exclusive output? The amp;