[pm-h] Perl Code

Mike Flannigan mikeflan at att.net
Wed Jun 17 16:04:10 PDT 2020


Recently I found this bit of code that I wrote
long ago.  I am a little surprised this works
($1 and $2 get transferred to the scalars).
I don't write that way anymore, but I am
leaving it that way in this program.


use strict;
use warnings;

my $test = 'abcdefgh';
my ($latm, $longm) = $test =~ /(ab).*(fg)/i;
print "$latm, $longm\n";


Prints this:
ab, fg



Mike


More information about the Houston mailing list