Illegal Seek - Any Hints

Discussion in 'Perl Misc' started by codefixer@gmail.com, Apr 4, 2005.

  1. Guest

    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.
     
    , Apr 4, 2005
    #1
    1. Advertising

  2. Joe Smith Guest

    wrote:

    > 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
     
    Joe Smith, Apr 4, 2005
    #2
    1. Advertising

  3. <> wrote:

    > 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.


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, Apr 4, 2005
    #3
  4. Guest

    wrote:
    > 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

    --
    -------------------- http://NewsReader.Com/ --------------------
    Usenet Newsgroup Service $9.95/Month 30GB
     
    , Apr 4, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. smarty

    illegal seek

    smarty, May 14, 2008, in forum: C Programming
    Replies:
    16
    Views:
    5,065
    Keith Thompson
    May 16, 2008
  2. Replies:
    2
    Views:
    467
  3. Replies:
    4
    Views:
    1,085
  4. Dave Saville

    illegal seek

    Dave Saville, Sep 8, 2003, in forum: Perl Misc
    Replies:
    21
    Views:
    292
    Alan J. Flavell
    Sep 17, 2003
  5. Replies:
    3
    Views:
    131
    Andreas Perstinger
    May 14, 2013
Loading...

Share This Page