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

  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. 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. Hugo
    Replies:
    10
    Views:
    1,347
    Matt Humphrey
    Oct 18, 2004
  2. Joe Wright
    Replies:
    0
    Views:
    539
    Joe Wright
    Jul 27, 2003
  3. kaushikshome
    Replies:
    4
    Views:
    796
    kaushikshome
    Sep 10, 2006
  4. scad
    Replies:
    23
    Views:
    1,196
    Alf P. Steinbach
    May 17, 2009
  5. bb
    Replies:
    0
    Views:
    574
Loading...

Share This Page