Tag Archives: return

Perl 的 eval

沒有把 eval 的 manual 弄清楚,結果中了不少槍... 以這段 code 來說: #!/usr/bin/env perl use strict; use warnings; use Data::Dumper; sub a { eval { return 'Inside eval'; }; return undef; } print Dumper a(); __END__ 輸出結果會是 undef,而非 Inside eval,因為: the value returned is … Continue reading

Posted in Computer, Murmuring, Programming, Software | Tagged , , | 1 Comment