Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Redirection for Perl in Windows 7 fails?

by secondo (Initiate)
on Mar 20, 2013 at 20:02 UTC ( #1024609=perlquestion: print w/replies, xml ) Need Help??

secondo has asked for the wisdom of the Perl Monks concerning the following question:

Esteemed and enlightened readers:

When I try to save the output of a perl script process to a file using a newer computer running Windows 7 with Strawberry Perl, redirection fails where it worked in the past.

For example, the command line pashtoUTF8.txt > charlist.txt

results in an empty file named charlist.txt being written to the current directory.

Other Perl scripts perform as expected.

Can someone help me understand the issue?

Humbly and gratefully yours,


  • Comment on Redirection for Perl in Windows 7 fails?

Replies are listed 'Best First'.
Re: Redirection for Perl in Windows 7 fails?
by BrowserUk (Pope) on Mar 20, 2013 at 20:31 UTC

    You are missing your file associations. Type the following (with mods for your setup) on a command line:

    C:\>assoc .pl=Perl C:\>ftype Perl="c:\perl64\bin\perl.exe" "%1" %*

    After that, you should find that redirection works as normal.

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re: Redirection for Perl in Windows 7 fails?
by kielstirling (Scribe) on Mar 20, 2013 at 20:05 UTC
    Can you post the code ??
Re: Redirection for Perl in Windows 7 fails?
by hdb (Monsignor) on Mar 20, 2013 at 20:10 UTC

    In my experience, you need to add perl at the beginning of the line:

    perl pashtoUTF8.txt > charlist.txt

    Perhaps a suitable shebang line at the beginning of the script would work as well. As I am lazy I have not tried.

    For every complex problem there is an answer that is clear, simple, and wrong. H. L. Mencken

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1024609]
Approved by NetWallah
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2020-08-10 22:03 GMT
Find Nodes?
    Voting Booth?
    Which rocket would you take to Mars?

    Results (58 votes). Check out past polls.