in reply to exists function used with attributes/operators?

One way to gain experimental insight into the sub-expressions of a Perl statement and their interrelationship is to use the O and B::Deparse modules with full parenthesization (the  -p switch) enabled:

c:\@Work\Perl>perl -wMstrict -MO=Deparse,-p -le "my %opts = (c => 1); my $C = exists $opts{'c'} ? '!' : ''; " BEGIN { $^W = 1; } BEGIN { $/ = "\n"; $\ = "\n"; } use strict 'refs'; (my(%opts) = ('c', 1)); (my $C = (exists($opts{'c'}) ? '!' : '')); -e syntax OK


Give a man a fish:  <%-(-(-(-<

Replies are listed 'Best First'.
Re^2: exists function used with attributes/operators?
by bArriaM (Novice) on Jul 19, 2015 at 15:31 UTC

    Thanks