in reply to Line Number Confusion

You should inspect $! and $?, too (copied form system).
if ($? == -1) { print "failed to execute: $!\n"; } elsif ($? & 127) { printf "child died with signal %d, %s coredump\n", ($? & 127), ($? & 128) ? 'with' : 'without'; } else { printf "child exited with value %d\n", $? >> 8; }
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: Line Number Confusion
by hmeharward (Novice) on Oct 01, 2015 at 16:24 UTC

    I've been trying to use those too, but I keep getting messages and integers in other parts of my code with them such as "0 Illegal Seek," "256 ," "-1 Broken Pipe," and sometimes just "0 ." I was hoping to use $. because the other perl vars werent working for me

      I think it's not that those variables "aren't working" for you - rather, it's that you don't understand what their resulting values actually mean, or how they can help you figure out the problem.

      We don't know what sort of command line you're trying to run (or what type of system you're using), so we can't help you with that, unless you tell/show us more: what's the command line? what OS are you using?

      If you want to tell/show us more, it would be nice if you could provide enough code and data so that we can run it ourselves and see whether we get the same results you do. (If you're trying to run some custom compiled command that no one else has, that makes it a different kind of problem - probably not suitable for a perl forum.)