use POSIX 'strftime'; my $today = strftime '%d/%m/%Y %H:%M', localtime; $today =~ s!(\d{2})/(\d{2})/(\d{4})!$3-$2-$1!; [download]
my @array = ('One', 'Two', 'Three', 'Four', 'Five'); sub get_element_index($@) { my $el = shift; $_ eq $el && return @_ while $_ = pop; -1; } print get_element_index('Four', @array); # Res: 3 print get_element_index('Six', @array); # Res: -1 [download]
use constant TEST => 'test'; my $var = 'test'; if($var =~ qr{${\TEST}}) { print 'OK!' } else { print 'Not matched!' } [download]
my $var = 1; if($var =~ qr{#{\C->TEST_CONST}}) { print 'OK!' } else { print 'Not matched!' } [download]
<a href=#top onClick='scrollTo(0,0); return false;'> <font color=#FFFFFF>TOP</font> </a> [download]
my @array = (2) x 10; __DATA__ [2,2,2,2,2,2,2,2,2,2] [download]
www.com | www.net | www.org
Yes No
Results (78 votes). Check out past polls.