diff options
-rw-r--r-- | pidl/lib/Parse/Pidl.pm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/pidl/lib/Parse/Pidl.pm b/pidl/lib/Parse/Pidl.pm index c2c9463d03..40e3673908 100644 --- a/pidl/lib/Parse/Pidl.pm +++ b/pidl/lib/Parse/Pidl.pm @@ -20,13 +20,19 @@ $VERSION = '0.02'; sub warning { my ($l,$m) = @_; - print STDERR "$l->{FILE}:$l->{LINE}: warning: $m\n"; + if ($l) { + print STDERR "$l->{FILE}:$l->{LINE}: "; + } + print STDERR "warning: $m\n"; } sub error { my ($l,$m) = @_; - print STDERR "$l->{FILE}:$l->{LINE}: error: $m\n"; + if ($l) { + print STDERR "$l->{FILE}:$l->{LINE}: "; + } + print STDERR "error: $m\n"; } sub fatal($$) |