Tutoring Perl: the tutor gives an example of Perl’s fantastic map function. Suppose you have the array (1,2,3,4), but you want to musically enhance it to (and a 1, and a 2,….) @arr=map {‘and a ‘.$_} (1,2,3,4); yields @arr = …

Perl: map Read more »

Perl tutoring: the tutor compares a greedy match with its corresponding lazy one. argument greedy lazy e2ee9a /e\w*\d/ /e\w*?\d/ match e2ee9 e2 Source: roberts perl tutorial McGrath, Mike. Perl in easy steps. Southam: Computer Step, 2004.

Perl tutoring: the tutor comments about square brackets in Perl regex. Perl regex match string /[beat24]/ string containing any of b,e,a,t,2,or 4. /beat24/ string containing the exact sequence beat24 Source: McGrath, Mike. Perl in easy steps. Southam: Computer Step, 2004.

Tutoring computer science, new language ideas will always be noticed. The tutor mentions the Perl construct say. use v5.10; #Apparently you need this to use say. $var1=”Hey there:)”; say $var1; #same effect as print “$var1\n”; I’ve never known of say, …

Using say in Perl Read more »