On 12/11/2011 09:47 AM, Gabor Szabo wrote:
> Hi,
>
> In my Perl Tutorial http://szabgab.com/perl_tutorial.html
> I am teaching regular, 3 -parameter open and using
>
> while (my $row =<$fh>) { }
>
> for reading a file. Similar way writing a file.
>
> I got some comments that I should use and teach
> https://metacpan.org/module/IO::All instead.
>
> I discussed that and some related issues in
> http://szabgab.com/how-to-teach-modern-perl.html
>
> I was also told to use https://metacpan.org/module/File::Slurp
> Others told me to avoid it because it does not deal with layers.
> Specifically utf8.
>
> Since then, I found https://metacpan.org/module/File::Open and I think
> it's nice.
> It improves the open() command in a way that I think more natural than
> the built-in
> open but it does not change the way you read the content.
>
> I suggested to Lukas Mai, the author of File::Open an additional API to
> have a function called oopen that would work like the fopen of File::Open
> but would return an object on which I could call ->slurp or
> ->readline or ->readall.
>
> No reply so far. I might implement it in a separate module
> and integrate later if he agrees.
>
> So how do you read and write files?
> How would you like to read and write files?
> What do you think about my oopen idea?
>
I'm either using Perl's open or File::Slurp, which works fine with
UTF-8 files if you add the proper binmode to the function call.
Regards
Racke
--
LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team
_______________________________________________
Perl mailing list
[email protected]
http://mail.perl.org.il/mailman/listinfo/perl