Login
|
Signup
langref.org
-
perl
add..
all
clojure
cpp
csharp
erlang
fantom
fsharp
go
groovy
haskell
java
ocaml
php
python
ruby
scala
Home
All
Solved
Unsolved
Strings
Numbers
Regex
Lists
Maps
Structure
Files
Dates
OOP
Networking
XML
Algorithms
Misc
Parallel
View Problem
Lists
Modification
Remove an element from a list by index
Given the list
[Apple, Banana, Carrot]
, remove the first element to produce the list
[Banana, Carrot]
perl
@list = qw(Apple Banana Carrot);
shift @list;
@list = qw(Apple Banana Carrot);
shift @list;
perl
@list = qw(Apple Banana Carrot);
$offset = 0;
splice(@list, $offset, 1);
@list = qw(Apple Banana Carrot);
$offset = 0;
splice(@list, $offset, 1);
Submit a new solution for
perl
There are 28 other solutions in
additional
languages (
clojure
,
cpp
,
csharp
,
erlang
...)