Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > "Out of memory!" error with PerlIO::via

Reply
Thread Tools

"Out of memory!" error with PerlIO::via

 
 
kj
Guest
Posts: n/a
 
      10-16-2008



I've written a very simple PerlIO::via module, that implements only
two API functions:

sub PUSHED { bless \*PUSHED, $_[ 0 ] } # lifted from PerlIO::via::QuotedPrint
sub FILL {
my $in = $_[ 1 ];
while ( <$in> ) {
next if _is_blank_or_comment( $_ );
my ( $q, $e ) = ( split /\t/, $_, -1 )[ 3, 6 ];
return $_ unless length $q or $e !~ /$SOME_REGEXP/;
}
return undef;
}

When I use this layer like this:

open my $in, '<:via(MyLayer)', '/path/to/some/file' or die $!;
while ( <$in> ) { print }

....I get an "Out of memory!" error.

Intriguingly enough, if I run the same code through the Perl
debugger, it produces the correct output and the program terminates
without an error.

This behavior under the debugger is good news and bad news. The
good news is that it suggests that, whatever the problem is, it is
not something like a syntax error or some other error of usage
(e.g. wrong order of arguments to some function, etc.) in my code.

The bad news I can't use the debugger to get to the bottom of this!

In fact I've run out of ways to troubleshoot this problem.

Any ideas? (I'm open to the possibility of using something other
than PerlIO layers to implement this general filtering function.)

TIA!

Kynn
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xffc Thread 0x228 DBC 0x437b94 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr bazzer ASP .Net 0 03-30-2006 03:16 PM
Error connecting to SQLExpress 2005 locally (error: 26 - Error Locating Server/Instance Specified) hfk0 ASP .Net 2 03-27-2006 08:43 PM
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x8fc Thread 0x934 DBC 0x437b94 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr bazzer ASP .Net 1 03-24-2006 04:20 PM
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x8fc Thread 0x934 DBC 0x437b94 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr bazzer ASP .Net 0 03-24-2006 02:22 PM
Error 500: ERROR: Cannot forward. Writer or Stream already obtained. Error JavaQueries Java 1 03-01-2005 06:30 PM



Advertisments