in reply to Re^2: Benchmark diamond operator
in thread Benchmark diamond operator

> But share some light, why is it working with @ARGV = @preserved; # restore original @ARGV?

I' dunno well your skills but if you have not understood what the venerable monk tobyink says below, and directly answering to your cited above assertion:

the <> diamond operators consumes @ARGV so if you save a safe copy in @preserved you can refill @ARGV when you need ie first line of the two subs in the tobyink's example above.

As said below the <> diamond can also feed @ARGV opening SDTIN as last resource, so the above works because it restores @ARGV original contents at the top of the two testing subs.

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^4: Benchmark diamond operator
by thanos1983 (Parson) on May 10, 2017 at 08:58 UTC

    Hello Discipulus,

    Thank you for the time and effort reading and replying to my question in detail. It helped me to understand the trick that tobyink came up with.

    Seeking for Perl wisdom...on the process of learning...not there...yet!