Perl: the Markov chain saw | |
PerlMonks |
opendir a directory abstraction?by LanX (Saint) |
on Feb 13, 2021 at 14:26 UTC ( [id://11128331]=perlquestion: print w/replies, xml ) | Need Help?? |
LanX has asked for the wisdom of the Perl Monks concerning the following question:
Hi Perl allows to open an file "abstraction" ° by providing a scalar-ref to a string open FH, "<", \$str; which is cool, because we can reuse all functionality based on reading files. Like with cached files. see open#Opening-a-filehandle-into-an-in-memory-scalar for details. But is there a way to do it with opendir ,too? I did some experiments providing a scalarref, but with no avail. like opendir DH, \$str Since telldir returns an integer-positions, I suppose the input has to be a scalar text with line delimiters and not an array.
Motivation
DISCLAIMER: Since I'm not very optimistic about an existing solution, this should probably rather be a meditation (?)
Cheers Rolf °) dunno how to phrase it better
Back to
Seekers of Perl Wisdom
|
|