Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Ram file bug?

by PodMaster (Abbot)
on Feb 16, 2006 at 09:43 UTC ( #530622=note: print w/replies, xml ) Need Help??


in reply to Ram file bug?

Looks like you've got a bug
use strict; use warnings; my $ram; open RAM, '>', \$ram; seek RAM, 10, 0; print RAM ' '; warn length $ram;; open RAM, '>', \$ram; binmode RAM, ':raw' or warn $!; seek RAM, 10, 0; print RAM ' '; warn length $ram;; open RAM, '>:raw', \$ram; seek RAM, 10, 0; print RAM ' '; warn length $ram; warn `$^X -v`; __DATA__ C:\dev\loose>perl5.8.0 open.ram.raw.pl 11 at open.ram.raw.pl line 9. 11 at open.ram.raw.pl line 16. 11 at open.ram.raw.pl line 21. This is perl, v5.8.0 built for MSWin32-x86-multi-thread Copyright 1987-2002, Larry Wall Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using `man perl' or `perldoc perl'. If you have access to + the Internet, point your browser at http://www.perl.com/, the Perl Home Pa +ge. C:\dev\loose>perl5.8.4 open.ram.raw.pl 11 at open.ram.raw.pl line 9. 11 at open.ram.raw.pl line 16. 11 at open.ram.raw.pl line 21. This is perl, v5.8.4 built for MSWin32-x86-multi-thread (with 3 registered patches, see perl -V for more detail) Copyright 1987-2004, Larry Wall Binary build 810 based on sources provided by ActiveState Corp. http://www.ActiveState.com ActiveState is a division of Sophos. Built Jun 17 2004 21:47:33 Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using `man perl' or `perldoc perl'. If you have access to + the Internet, point your browser at http://www.perl.com/, the Perl Home Pa +ge. C:\dev\loose>perl5.8.6d open.ram.raw.pl 11 at open.ram.raw.pl line 9. 11 at open.ram.raw.pl line 16. 11 at open.ram.raw.pl line 21. This is perl, v5.8.6 built for MSWin32-x86-multi-thread Copyright 1987-2004, Larry Wall Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using `man perl' or `perldoc perl'. If you have access to + the Internet, point your browser at http://www.perl.org/, the Perl Home Pa +ge. C:\dev\loose>perl5.8.7 open.ram.raw.pl 11 at open.ram.raw.pl line 9. 11 at open.ram.raw.pl line 16. 11 at open.ram.raw.pl line 21. This is perl, v5.8.7 built for MSWin32-x86-multi-thread Copyright 1987-2005, Larry Wall Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using `man perl' or `perldoc perl'. If you have access to + the Internet, point your browser at http://www.perl.org/, the Perl Home Pa +ge. C:\dev\loose>

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.

Replies are listed 'Best First'.
Re^2: Ram file bug?
by BrowserUk (Pope) on Feb 16, 2006 at 10:04 UTC

    Could you try again but undef $ram between the opens?

    use strict; use warnings; my $ram; open RAM, '>', \$ram; seek RAM, 10, 0; print RAM ' '; warn length $ram;; undef $ram; open RAM, '>', \$ram; binmode RAM, ':raw' or warn $!; seek RAM, 10, 0; print RAM ' '; warn length $ram;; undef $ram; open RAM, '>:raw', \$ram; seek RAM, 10, 0; print RAM ' '; warn length $ram; warn `$^X -v`; __END__ C:\test>junk 11 at C:\test\junk.pl line 9. Use of uninitialized value in open at C:\test\junk.pl line 12. 11 at C:\test\junk.pl line 16. Use of uninitialized value in length at C:\test\junk.pl line 22. 0 at C:\test\junk.pl line 22. This is perl, v5.8.6 built for MSWin32-x86-multi-thread (with 3 registered patches, see perl -V for more detail) Copyright 1987-2004, Larry Wall Binary build 811 provided by ActiveState Corp. http://www.ActiveState. +com ActiveState is a division of Sophos. Built Dec 13 2004 09:52:01 Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using `man perl' or `perldoc perl'. If you have access to + the Internet, point your browser at http://www.perl.org/, the Perl Home Pa +ge.

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      My results match yours

      MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
      I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
      ** The third rule of perl club is a statement of fact: pod is sexy.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://530622]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2021-01-27 10:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?