http://www.perlmonks.org?node_id=1031210


in reply to 2 basic questions

use v5.12; my $check = "a"; $check++ for 1..3; # three letters say $check; $check++ for 1..24; # another 24 letters, but there's only 26 in the +alphabet, say $check; # so what happens now we've run off the end? # hmmm... that's handy. # it takes us to the next part of your question... my $input = $check; my $output = substr($input, 1, 1); # skip one character, take one char +acter say $output;
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

Replies are listed 'Best First'.
Re^2: 2 basic questions
by Anonymous Monk on Apr 29, 2013 at 14:50 UTC
    Thx Toby