in reply to Bug in Devel::DProf?
So, what about doing this with &parse you may ask. Well, if you call from sub1, &sub2, then sub1 and sub2 will actually share @_! Look for instance at:
#!/usr/bin/perl use strict; use warnings; sub foo { print "Foo: [@_]\n"; shift; } sub bar { print "Bar: [@_]\n"; &foo; print "Bar: [@_]\n"; } bar 1, 2 __END__ Bar: [1 2] Foo: [1 2] Bar: [2]
Shifting off an element of @_ in foo() is noticeable in bar().
Leaves us the question, why three lines in perl -d:DProf test.pl when the function is called as &parse? For that, I do not know the answer. I can just guess that DProf puts each function in some kind of wrapper, causing the arguments to get duplicated.
Abigail
|
|---|