belg4mit has asked for the wisdom of the Perl Monks concerning the following question:
Luckily my initial code was this, else I might not have hit upon that.$a = tell(DATA); seek(DATA,$a,0); open(STDIN, "<&DATA"); while(<STDIN>){ print "STDIN: $_"; } __DATA__ Foo Bar Quux
Does anybody have an explanation for what's going on with that first snippet?while(<DATA>){ print "DATA: $_"; } seek(DATA,0,0); open(STDIN, "<&DATA"); while(<STDIN>){ print "STDIN: $_"; } __DATA__ Foo Bar Quux
--
I'm not belgian but I play one on TV.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Dup oddity OR Is it cargo cult if you wrote it yourself?
by BrowserUk (Patriarch) on Apr 01, 2003 at 01:54 UTC | |
by belg4mit (Prior) on Apr 01, 2003 at 01:58 UTC | |
|
Re: Dup oddity OR Is it cargo cult if you wrote it yourself?
by Aragorn (Curate) on Apr 01, 2003 at 09:08 UTC |