the only thing i can say is that your (sligthly modified) demo
use strict; use warnings; use Config; print STDERR qq!Perl $^V on $^O arch $Config{archname}\n!; sub demo { my ($s1, $s2) = ('',''); my $sFormat = "s1='%s' s2='%s'\n"; open(my $fh1, '>', \$s1) or die "Can't open fh1"; print $fh1 'Hi Thing One'; printf STDERR $sFormat, $s1, $s2; # => s1='Hi Thing One' s2='' open(my $fhSave, '>&', $fh1) or die "Can't save fh1"; close $fh1; open($fh1, '>', \$s2) or die "Can't redirect fh1"; print $fh1 'Hi Thing Two*Bye Thing Two'; printf STDERR $sFormat, $s1, $s2; # => s1='Hi Thing One' s2='Hi Thing Two*Bye Thing Two' # PICK ONE OF TWO OPEN OPTIONS BELOW #1# #print STDERR "Option 1\n"; open($fh1, '>&', $fhSave) + or die "Can't restore fh1"; #2# #print STDERR "Option 2\n";open($fh1, '>', \ substr($s1, length($s1) +) ) or die "Can't restore fh1"; print $fh1 '*Bye Thing One'; printf STDERR $sFormat, $s1, $s2; # OUTPUT FROM OPEN OPTIONS #1# => s1='Hi Thing One' s2='Hi Thing Two*Bye Thing Two' #2# => s1='Hi Thing One*Bye Thing One' s2='Hi Thing Two*Bye Thing Tw +o' } demo(); exit(0);
will output your same output in modern Strwaberry release,
#option 1 ----------------------------------------······· | Perl v5.14.2 on MSWin32 arch MSWin32-x86-multi-thread | s1='Hi Thing One' s2='' | s1='Hi Thing One' s2='Hi Thing Two*Bye Thing Two' | Option 1 | s1='Hi Thing One' s2='Hi Thing Two*Bye Thing Two' -------------------------------------------------------------------- +---······· [OK] C:\ulisse\strawberry\perl\bin\perl.exe ----------------------------------------······· | Perl v5.20.0 on MSWin32 arch MSWin32-x86-multi-thread-64int | s1='Hi Thing One' s2='' | s1='Hi Thing One' s2='Hi Thing Two*Bye Thing Two' | Option 1 | s1='Hi Thing One' s2='Hi Thing Two*Bye Thing Two' -------------------------------------------------------------------- +---······· [OK] C:\ulisse\straw5.20-32b\perl\bin\perl.exe ----------------------------------------······· | Perl v5.16.2 on MSWin32 arch MSWin32-x64-multi-thread | s1='Hi Thing One' s2='' | s1='Hi Thing One' s2='Hi Thing Two*Bye Thing Two' | Option 1 | s1='Hi Thing One' s2='Hi Thing Two*Bye Thing Two' -------------------------------------------------------------------- +---······· [OK] C:\ulisse\straw64\perl\bin\perl.exe #option 2 ----------------------------------------······· | Perl v5.14.2 on MSWin32 arch MSWin32-x86-multi-thread | s1='Hi Thing One' s2='' | s1='Hi Thing One' s2='Hi Thing Two*Bye Thing Two' | Option 2 | s1='Hi Thing One*Bye Thing One' s2='Hi Thing Two*Bye Thing Two' -------------------------------------------------------------------- +---······· [OK] C:\ulisse\strawberry\perl\bin\perl.exe ----------------------------------------······· | Perl v5.20.0 on MSWin32 arch MSWin32-x86-multi-thread-64int | s1='Hi Thing One' s2='' | s1='Hi Thing One' s2='Hi Thing Two*Bye Thing Two' | Option 2 | s1='Hi Thing One*Bye Thing One' s2='Hi Thing Two*Bye Thing Two' -------------------------------------------------------------------- +---······· [OK] C:\ulisse\straw5.20-32b\perl\bin\perl.exe ----------------------------------------······· | Perl v5.16.2 on MSWin32 arch MSWin32-x64-multi-thread | s1='Hi Thing One' s2='' | s1='Hi Thing One' s2='Hi Thing Two*Bye Thing Two' | Option 2 | s1='Hi Thing One*Bye Thing One' s2='Hi Thing Two*Bye Thing Two' -------------------------------------------------------------------- +---·······
but never print '*Bye Thing One' in a old 5.8 release:
option 1 perl c:\ulisse\elisheva-demo01.pl Pe on MSWin32 arch MSWin32-x86-multi-thread s1='Hi Thing One' s2='' s1='Hi Thing One' s2='Hi Thing Two*Bye Thing Two' Option 1 s1='Hi Thing One' s2='Hi Thing Two*Bye Thing Two' >echo option 2 option 2 >perl c:\ulisse\elisheva-demo01.pl Pe on MSWin32 arch MSWin32-x86-multi-thread s1='Hi Thing One' s2='' s1='Hi Thing One' s2='Hi Thing Two*Bye Thing Two' Option 2 s1='Hi Thing One' s2='Hi Thing Two*Bye Thing Two' >perl -v This is perl, v5.8.8 built for MSWin32-x86-multi-thread


L*
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

In reply to Re: Redirecting/Restoring of Memory Files by Discipulus
in thread Redirecting/Restoring of Memory Files by ELISHEVA

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.