Those aren't functions, they are one of Perl's syntactic superpowers! (that I wish other languages would start using) I agree that the documentation for them is rather terrible in perldoc perlfunc. You can find a much better explanation at perldoc perlop under Quote-Like-Operators.
The gist is that while you can just use backslashes to have i.e. double-quotes inside of a double-quoted string, it often looks terrible, so perl gives you the 'qq' syntax that lets you choose your own terminating character for the string. Then you can choose one that doesn't interfere with the readability of your string.
It makes even more difference when you have strings inside of strings, like:
instead ofeval qq{ print qq{This string uses "double quotes"\n}; }
eval " print \"this string uses \\\"double quotes\\\"\n\"; "
A warning though, you probably shouldn't use 'qx' in production code. It lets you choose your own quotes for ` ... ` but any time you have something complex enough that you wanted alternate quote characters to pass something to bash to execute, you are probably opening yourself up to shell injection attack vectors. It's much better to run external programs with system("progname", $arg1, $arg2, ...) where you are in full control over the boundaries of the arguments to the program, and not relying on the shell to re-parse them based on quote characters. You can capture the output of system() using Capture::Tiny.
**Edit**
So also I see 'keys', 'values', and 'each' on your list. Those are fairly important perl functions for working with hashes. And... actually the documentation is fairly good for those, so I'm not sure what else to say about them. You should practice working with them until you get the feel for it.
Finally, 'pos' is a more advanced perl feature, but lots of fun if you're writing parsers. Basically, every Perl string has a built-in position marker, and the perl regex engine can make use of that position. The 'pos' function lets you access or change the position marker. And that's really all you need to know until you decide to write a fancy parser. Then you can come back and ask more questions :-)
In reply to Re: How to find Perl demo programs?
by NERDVANA
in thread How to find Perl demo programs?
by harangzsolt33
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |