About 47,300,000 results
Open links in new tab
  1. operators - What does =~ do in Perl? - Stack Overflow

    Jan 24, 2019 · 14 The '=~' operator is a binary binding operator that indicates the following operation will search or modify the scalar on the left. The default (unspecified) operator is 'm' for match. The matching operator has a pair of characters that designate where the regular expression begins and ends. Most commonly, this is '//'. Give Perl Re tutorial ...

  2. operators - What is the difference between "||" and "or" in Perl ...

    Nov 10, 2019 · 53 From Perl documentation: OR List operators On the right side of a list operator, it has very low precedence, such that it controls all comma-separated expressions found there.

  3. What's the use of <> in Perl? - Stack Overflow

    Sep 5, 2012 · @pst, <> is not a file handle, "null" or otherwise. It's an operator. Specifically, the readline operator. There's a reference to it as the "angle operator" in perlvar, although there isn't actually any such operator. The angle brackets are used by two operators: readline or glob. The operator depends on the contents of the brackets.

  4. 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 pri...

  5. operators - What does =~ mean in Perl? - Stack Overflow

    May 2, 2012 · Possible Duplicate: What does =~ do in Perl? In a Perl program I am examining (namly plutil.pl), I see a lot of =~ on the XML parser portion. For example, here is UnfixXMLString (lines 159 to 167 ...

  6. How do you round a floating point number in Perl?

    Output of perldoc -q round Does Perl have a round () function? What about ceil () and floor ()? Trig functions? Remember that int() merely truncates toward 0. For rounding to a certain number of digits, sprintf() or printf() is usually the easiest route. printf("%.3f", 3.1415926535); # prints 3.142 The POSIX module (part of the standard Perl distribution) implements ceil(), floor(), and …

  7. linux - Perl command line multi-line replace - Stack Overflow

    The -p causes Perl to iterate over every line of the input and execute the given code for each of them (and to print the lines afterwards). Specifically, the command perl -p -e 'SOME_CODE_HERE;' is exactly equivalent to running the following Perl program: LINE: while (<>) { SOME_CODE_HERE; } continue { print or die "-p destination: $!\n"; } Your regexp …

  8. How can I find out where a Perl module is installed?

    That doesn't tell you where Perl is looking for the file, though. My Perl modules are in ~/perl/install, for example.

  9. How do I perform a Perl substitution on a string while keeping the ...

    In Perl, what is a good way to perform a replacement on a string using a regular expression and store the value in a different variable, without changing the original? I usually just copy the stri...

  10. In Perl, how do I change, delete, or insert a line in a file, or append ...

    I want to make changes to the contents of a file by modifying, deleting or inserting lines or appending to the beginning of the file. How can I do that in Perl? This is a question from the official...