Question : perl remove element from array
Answered by : charlesalexandre-roy
# Basic syntax:
| Function | Meaning |
|:-------------------------------:|:-----------------------------------------:|
| push(@array, "some value") | add a value to the end of the list |
| $popped_value = pop(@array) | remove a value from the end of the list |
| $shifted_value = shift (@array) | remove a value from the front of the list |
| unshift(@array, "some value") | add a value to the front of the list |
Source : http://korflab.ucdavis.edu/Unix_and_Perl/current.html#:~:text=Making%20arrays%20bigger%20and%20smaller | Last Update : Sat, 19 Mar 22
Question : remove array element in perl
Answered by : manoj-kumar
{"tags":[{"tag":"textarea","content":"#!/usr/bin/perl\n@days = qw/Mon Tue Wed Thu Fri Sat Sun/;\nprint \"@days\\n\";\n$delValue = pop(@days);\nprint \"@days\\n\";\nprint \"Deleted Value \\n\";\nprint $delValue;","code_language":"perl"}]}
Source : https://onecompiler.com/perl/3z2scy6en | Last Update : Thu, 23 Mar 23