Stack traces: Difference between revisions
Content deleted Content added
→{{header|OCaml}}: the output is missing |
m put languages in alphabetic order |
||
Line 243:
StackTraceDemo.middle
StackTraceDemo.inner</pre>
=={{header|Perl}}==▼
<lang perl>use Carp 'cluck';▼
sub g {cluck 'Hello from &g';}▼
sub f {g;}▼
f;</lang>▼
This prints:▼
<pre>Hello from &g at Print a Stack Trace line 3▼
main::g() called at Print a Stack Trace line 4▼
main::f() called at Print a Stack Trace line 6</pre>▼
=={{header|Mathematica}}==
Line 283 ⟶ 269:
{{works with|OCaml|3.11+}}
<lang ocaml>Printexc.print_backtrace stdout;;</lang>
▲=={{header|Perl}}==
▲<lang perl>use Carp 'cluck';
▲sub g {cluck 'Hello from &g';}
▲sub f {g;}
▲f;</lang>
▲This prints:
▲<pre>Hello from &g at Print a Stack Trace line 3
▲ main::g() called at Print a Stack Trace line 4
▲ main::f() called at Print a Stack Trace line 6</pre>
=={{header|PHP}}==
|