I can't replicate your problem :) Maybe something jiggles loose from my tips

start+run "cmd" , then in the cmd.exe window

C:\Documents and Settings\username>dir /b fudge* File Not Found C:\Documents and Settings\username>echo echo fudge > fudge.bat

Then start+run "fudge.bat > fudge.txt"

Then back to cmd.exe window

C:\Documents and Settings\username>dir /b fudge* fudge.bat fudge.txt C:\Documents and Settings\username>type fudge* fudge.bat echo fudge fudge.txt C:\Documents and Settings\username>echo fudge fudge

So fudge.bat is called, fudge.txt is created, %userprofile% is the default cwd unless it was changed ( cruel microsoft tricks Re^4: cpan fails when MKS installed on Windows (HKCU\Software\Microsoft\Command Processor))

If I run "fudge2.bat > fudge2.txt" then fudge2.txt doesn't get created because fudge2.bat doesn't exist, but I also get a popup that windows can't find fudge2.bat

Why your perl program doesn't work? Impossible to say

For redirection, its best to do your testing from within cmd.exe ... and use absolute paths

Better yet, have perl redirect STDOUT/STDERR to files :

Some path/bat tips Re^4: OS independent perl script

some redirection ftype assoc tips ... probably doesn't apply if your stuff works from cmd.exe ... redirection problem, Win7, ASSOCiation , and @ARGV, Re: Out of date over <> and 5.10 (redir)

See also


In reply to Re: Perl in Windows - STDOUT to file Behavior difference by run context by Anonymous Monk
in thread Perl in Windows - STDOUT to file Behavior difference by run context by AngelOnTheSideline

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.