Illegal Seek - Any Hints

C

codefixer

Hi,

I have a script in which I have " do $test" where $test refers to a
different perl script, say foo.pl

In foo.pl when the control is trying to execute my$result =
qx/\.\/test"/ I am getting an error saying Illegal seek. (All other
statements execute just fine).

I browsed through some past messages here but still couldn't find
anything that works.

Any hints on what I coud do ? Is their a way to diagnose this "illegal
seek" message further ????


Thanks for your help.
 
J

Joe Smith

I have a script in which I have " do $test" where $test refers to a
different perl script, say foo.pl

In foo.pl when the control is trying to execute my$result =
qx/\.\/test"/ I am getting an error saying Illegal seek. (All other
statements execute just fine).

You need to copy-and-paste the actual error message and the actual
statement in question. Re-typing the line is prone to typographical
errors, which obviously happened in this case.

That qx statement is all messed up. Lose the \ and change delimiters:

my $result = qx{./test}; # Using alternate delimiters
my $result = `./test`; # Or using the simple syntax

From your description, it sounds like you are running ./test from
the command line, which invokes foo.pl, which executes ./test again.

"Illegal seek" has no meaning to us unless you include:
*) The name of the file where the error was detected,
*) The line number of the statement that failed,
*) And copy-and-paste the line in question.

And
use strict;
use warnings;
use diagnostics;

-Joe
 
T

Tad McClellan

trying to execute my$result =
qx/\.\/test"/ I am getting an error saying Illegal seek.
^
^

The name of the program has a double quote character in it?

Please use copy/paste rather than attempting to retype code.

Any hints on what I coud do ?


Post actual Perl code.

Post a short and complete program *that we can run* that
duplicates the problem.

Include the *verbatim* text of any messages you get.

See the Posting Guidelines that are posted here frequently.
 
X

xhoster

Hi,

I have a script in which I have " do $test" where $test refers to a
different perl script, say foo.pl

Well, stop doing that. Execute foo.pl directly until you get the kinks
worked out, then go back to "do"ing it.
In foo.pl when the control is trying to execute my$result =
qx/\.\/test"/ I am getting an error saying Illegal seek. (All other
statements execute just fine).

Why choose / as the delimiter when it forces you to escape a literal /?
Do you have an actual program named ./test" ?
I browsed through some past messages here but still couldn't find
anything that works.

Any hints on what I coud do ? Is their a way to diagnose this "illegal
seek" message further ????

In my experience, "illegal seek" generally means that I inspected $! when
I had no business doing so, i.e. when there was not an actual error.

Xho
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,233
Latest member
AlyssaCrai

Latest Threads

Top