Read Line And Selected Subsequent Lines

Discussion in 'Perl Misc' started by sc0ri0n, May 13, 2004.

  1. sc0ri0n

    sc0ri0n Guest

    sc0ri0n, May 13, 2004
    #1
    1. Advertisements

  2. sc0ri0n

    Bob Walton Guest

    sc0ri0n wrote:

    > I was looking for this and I saw Perl Gurl's code in
    > http://www.purlgurl.net/~purlgurl/perl/file/read_1.html
    >
    > I've 2 questions ...
    >
    > 1-) why does "$line_1 = ;" work and print the next line?



    That's because that's not what the line really says. Check out the HTML
    source and see why you should ignore crap from PG (it forgot to quote
    its source code when it made HTML out of it).


    >
    > 2-) Is it possible to go back and read the previous 3 lines too?



    Sure. Check out

    perldoc -f seek

    and

    perldoc -f tell

    But why would one want to do that, when one has already read them to get
    to where one is (assuming normal variable-lenght text sorts of lines) --
    one could just hang on to them.


    ....


    > Pete


    --
    Bob Walton
    Email: http://bwalton.com/cgi-bin/emailbob.pl
     
    Bob Walton, May 13, 2004
    #2
    1. Advertisements

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. Hugo
    Replies:
    10
    Views:
    1,605
    Matt Humphrey
    Oct 18, 2004
  2. Wai Yip Tung
    Replies:
    5
    Views:
    1,255
    Andrew Dalke
    Sep 4, 2004
  3. kaushikshome
    Replies:
    4
    Views:
    1,027
    kaushikshome
    Sep 10, 2006
  4. scad
    Replies:
    23
    Views:
    1,463
    Alf P. Steinbach
    May 17, 2009
  5. bb
    Replies:
    0
    Views:
    689
  6. gry
    Replies:
    2
    Views:
    1,090
    Alf P. Steinbach
    Mar 13, 2012
  7. Marek Stepanek
    Replies:
    12
    Views:
    689
    Peter J. Holzer
    Sep 2, 2006
  8. Replies:
    27
    Views:
    647
    Peter J. Holzer
    May 18, 2007
Loading...