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

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

unichist.pl 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,

secondo

Comment on Redirection for Perl in Windows 7 fails?
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 (Parson) on Mar 20, 2013 at 20:10 UTC

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

    perl unichist.pl 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
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.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2014-09-01 18:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (15 votes), past polls