File: dollarat.pl

package info (click to toggle)
libdevel-backtrace-perl 0.12-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 180 kB
  • sloc: perl: 541; makefile: 7
file content (14 lines) | stat: -r--r--r-- 297 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!perl
use strict;
use warnings;
use Devel::DollarAt;

eval 'print 0/0';

# Output: Error line is 1
print "Error line is ", $@->line, "\n";

# Output: Error text is Illegal division by zero at (eval 3) line 1.
print "Error text is $@";

# Note: In perl 5.8 and below, the line gets reported as 2.