NateTut has asked for the wisdom of the Perl Monks concerning the following question:
Well it's late on a Friday and I'm stuck. I'm trying to get Inline::Files to work and I am frustrated. I have boiled it down to the example below. Basically if you read from the virtual file and then try to write to it you get:
Otherwise it works as advertized. I have tried it on Windoze & Solaris with the same results.
print() on unopened filehandle CONFIG at Change__DATA__.pl line 26.
Otherwise it works as advertized. I have tried it on Windoze & Solaris with the same results.
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use Inline::Files -backup; my $Config; if(defined($ARGV[0]) and $ARGV[0] eq 'NoRead') { $Config->{'Foo'} = 1; } else { $Config = eval join "", <CONFIG>; } local $Data::Dumper::Useqq = 1; local $Data::Dumper::Indent = 1; $Config->{'Foo'}++; print Data::Dumper->Dump([$Config],['Config']); seek CONFIG, 0, 0; print CONFIG Data::Dumper->Dump([$Config],['Config']); __CONFIG__ $Config = { "Foo" => 2 };
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Inline::Files unopened filehandle errors redux
by BrowserUk (Patriarch) on Oct 16, 2009 at 21:56 UTC | |
by NateTut (Deacon) on Oct 16, 2009 at 22:08 UTC | |
by BrowserUk (Patriarch) on Oct 16, 2009 at 23:28 UTC | |
by Anonymous Monk on Oct 17, 2009 at 00:10 UTC | |
by BrowserUk (Patriarch) on Oct 17, 2009 at 05:26 UTC | |
|
Back to
Seekers of Perl Wisdom