in reply to Re^2: Syntax Perl Version support $c = () = $a =~ /\./g
in thread Syntax Perl Version support $c = () = $a =~ /\./g
tr/// (sometimes spelled y///, especially in code golf) works on characters specifically. m// (sometimes spelled //) works on regular expression matches, which may concern one or more characters (or in special cases zero, such as split //, $foo;).
Perl takes text very seriously. There is a load to know about processing text in Perl, but the basics are pretty quick to grasp. The full story is not complete without at least these manual pages, although for this specific topic the first few should suffice.:
- m//
- s///
- tr///
- split
- index
- substr
- length
- lc
- uc
- lcfirst
- ucfirst
- reverse
- chr
- ord
- pack
- unpack
- perlop (especially eq ne gt lt ge le cmp . x =~ .. )
- perlrequick
- perlretut
- perlreref
- perlre
- perlfaq6
- perlrebackslash
- perlrecharclass
- perluniintro
- perlunitut
- perlunifaq
- perlunicode
- perluniprops
- perlvar (especially $_ $1 $a $b $| $" $` $& $' $, $. $/ and $\ but especially especially $_ and $1
- perllocale
You might hope you never need to read perlebcdic, but there's that too.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Syntax Perl Version support $c = () = $a =~ /\./g
by morgon (Priest) on Jul 18, 2018 at 00:09 UTC | |
by choroba (Cardinal) on Jul 18, 2018 at 00:13 UTC |
In Section
Seekers of Perl Wisdom