Both, your and Abigail-IIs solution will fail for duplicate elements (although I don't know whether that's a problem or not) :
#!/usr/bin/perl use strict; use warnings; my @list = qw( 1 1 2 ); my %hash; @hash{@list}=1; delete $hash{$_} for (1..@list); print "is sequence\n" unless %hash;
perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web
In reply to Re: Re: Validate array of numbers in sequence
by Corion
in thread Validate array of numbers in sequence
by AcidHawk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |