in reply to How to extract the first elemnet from an integer type value ???
my $num = 100; my $extracted = do { open 0 and $_ = ( grep /my \$num = \d/, <0> )[0] +and /(\d)/; $1; }; [download]