in reply to Passing logical operators on as content of scalar
#!/usr/bin/perl use warnings; use strict; my $number1 = '2011'; my $number2 = '2011'; my $selectioncriterium = '=='; sub smaller { "$_[0] is smaller than $_[1]" } my %dispatch = ( 0 => sub { "$_[0] equals $_[1]" }, 1 => sub { smaller($_[1], $_[0]) }, -1 => sub { smaller($_[0], $_[1]) }, ); print $dispatch{ $number1 <=> $number2 }->($number1, $number2), "\n";
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Passing logical operators on as content of scalar
by soonix (Chancellor) on Feb 08, 2018 at 19:59 UTC | |
by tybalt89 (Monsignor) on Feb 08, 2018 at 20:19 UTC | |
by soonix (Chancellor) on Feb 08, 2018 at 21:14 UTC | |
by afoken (Chancellor) on Feb 10, 2018 at 18:52 UTC |