MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1x58u7b/howprogramminghaschanged/pgoztjm/
r/ProgrammerHumor • u/shizzy0 • Oct 13 '26
108 comments sorted by
View all comments
Show parent comment
1
The pop at the end hands back the last element of an array, without an argument it defaults to @_, an array given as the caller argument, which in this case is the command line. Perl is full of these shortcuts.
1 u/no_brains101 Oct 14 '26 edited Oct 14 '26 Oh I see. (and then say is just print?)I don't see an array though, for just repeats until the end condition is met, storing in a and b, theres no array I don't think?Edit: OH the array is the ARGUMENTS and pop is grabbing the last one. 2 u/BastetFurry Oct 14 '26 No array for the calculation, no.Just abusing the fact that @_ contains all caller arguments. And calling the main "function" puts all command line arguments into that built-in array.
Oh I see. (and then say is just print?)
I don't see an array though, for just repeats until the end condition is met, storing in a and b, theres no array I don't think?
Edit: OH the array is the ARGUMENTS and pop is grabbing the last one.
2 u/BastetFurry Oct 14 '26 No array for the calculation, no.Just abusing the fact that @_ contains all caller arguments. And calling the main "function" puts all command line arguments into that built-in array.
2
No array for the calculation, no.
Just abusing the fact that @_ contains all caller arguments. And calling the main "function" puts all command line arguments into that built-in array.
View all comments
Show parent comment
1
u/BastetFurry Oct 14 '26
The pop at the end hands back the last element of an array, without an argument it defaults to @_, an array given as the caller argument, which in this case is the command line. Perl is full of these shortcuts.