Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Here there be camels!

by LanX (Saint)
on Feb 28, 2015 at 23:43 UTC ( [id://1118211]=note: print w/replies, xml ) Need Help??


in reply to Re: Here there be cammels!
in thread Here there be cammels!

Furthermore does readline depend on the chunk-size determined of the input-record-separator $/

The only possibility to fake this is to reopen and reread line by line.

I have no idea how seek could be able to set $. without lots of magic.

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)

PS: Je suis Charlie!

Replies are listed 'Best First'.
Re^3: Here there be camels!
by Anonymous Monk on Mar 01, 2015 at 00:00 UTC
    I have no idea how seek could be able to set $. without lots of magic.

    It doesn't update $. itself; it does update PL_last_in_gv.

    open my $fa, '<', '/etc/passwd' or die $!; open my $fb, '<', '/etc/group' or die $!; <$fa>; $.=9; <$fa>; warn "One"; <$fb>; $.=17; <$fb>; warn "Two"; seek $fa,256,1; warn "Three"; seek $fb,256,1; warn "Four"; <$fa>; warn "Five"; <$fb>; warn "Six"; __END__ One at - line 3, <$fa> line 10. Two at - line 4, <$fb> line 18. Three at - line 5, <$fa> line 10. Four at - line 6, <$fb> line 18. Five at - line 7, <$fa> line 11. Six at - line 8, <$fb> line 19.

    See pp_sysseek in pp_sys.c.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1118211]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-03-29 06:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found