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


in reply to Re^2: Regular Expression
in thread Regular Expression

Fun :)
How about:
substr($month,0,1,"0$month") if ($month<10 && $month!~/^0/);
Update: Fixed typo, as per tinita

--
Olivier

Replies are listed 'Best First'.
Re^4: Regular Expression
by tinita (Parson) on Aug 05, 2004 at 23:34 UTC
    substr($month,0,1,"0$month") if ($month<10 && $month!=/^0/);
    Use of uninitialized value in pattern match (m//) at -e line 3. 0077

    s/ != / !~ /x
    ;-)