- or download this
use POSIX 'strftime';
my $today = strftime '%d/%m/%Y %H:%M', localtime;
$today =~ s!(\d{2})/(\d{2})/(\d{4})!$3-$2-$1!;
- or download this
my @array = ('One', 'Two', 'Three', 'Four', 'Five');
...
print get_element_index('Four', @array); # Res: 3
print get_element_index('Six', @array); # Res: -1
- or download this
use constant TEST => 'test';
...
if($var =~ qr{${\TEST}}) { print 'OK!' }
else { print 'Not matched!' }
- or download this
my $var = 1;
if($var =~ qr{#{\C->TEST_CONST}}) { print 'OK!' }
else { print 'Not matched!' }
- or download this
<a href=#top onClick='scrollTo(0,0); return false;'>
<font color=#FFFFFF>TOP</font>
</a>
- or download this
my @array = (2) x 10;
__DATA__
[2,2,2,2,2,2,2,2,2,2]