Pop 3rd Element from Array in PERL Programming

  • Thread starter Thread starter karthik3k
  • Start date Start date
  • Tags Tags
    Programming
Click For Summary

Discussion Overview

The discussion revolves around how to pop the third element from an array in Perl programming. Participants explore different interpretations of the term "pop" and the methods to achieve this operation.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant asks how to pop the third element from an array, providing an example array.
  • Another participant suggests that printing the element at index 2 would suffice, indicating a misunderstanding of the original question.
  • A different participant corrects the misunderstanding by introducing the use of the splice function to remove an element from the array.
  • One participant expresses regret for the misunderstanding, indicating emotional engagement in the discussion.
  • Another participant defines "pop" in the context of stack operations, suggesting a conceptual difference in understanding the term.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the interpretation of "pop" and its application in this context, as there are competing views on whether it refers to removing an element or simply accessing it.

Contextual Notes

There is ambiguity regarding the definition of "pop" and its application in array manipulation, as well as the specific use of the splice function, which may depend on the context of the discussion.

karthik3k
Messages
149
Reaction score
0
How do i pop nth element from array ?

Say
@array=(a,b,c,s,d,f,g);
How do u i pop 3rd element(c) from array ?
 
Computer science news on Phys.org
I think this should work[/size] (>.<)

print "$array[2]"​
 
That wasn't my question,
Anyhow i found it ,

use


splice @array, OFFSET, LENGTH;
 
You made me cry and shameful...
I thought you wanted to output it...I am really sorry about that...
[/size]:-p
 
Pop means removing an element from stack.

Anyhow thanx.
 
<<<smiling>>>
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 32 ·
2
Replies
32
Views
3K
Replies
6
Views
2K
Replies
43
Views
5K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 25 ·
Replies
25
Views
3K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 31 ·
2
Replies
31
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K