Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Script error after PAR

by MorayJ (Acolyte)
on Feb 12, 2013 at 22:22 UTC ( #1018457=perlquestion: print w/ replies, xml ) Need Help??
MorayJ has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks

I have a script in which I use Cwd to get the current directory (getcwd) and then open a file in that directory.

This seems to work fine when running under perl. But when I use pp on it to package it so it can run independently, it returns the message ' no such file or directory' when trying to create the file that worked before.

Is it expected for par to bring in differences, or is there something obvios I'm overlooking?

Thanks for your time

MorayJ

Comment on Script error after PAR
Re: Script error after PAR
by Anonymous Monk on Feb 13, 2013 at 08:09 UTC

    Is it expected for par to bring in differences, or is there something obvios I'm overlooking?

    Yes, par brings in a different environment,

    Yes, you're overlooking something obvious :)

      Hmmmm, ok. I've done a couple of other scripts using PAR/pp and they have worked as they did pre-executable.

      Would you be kind enough to point out what I am missing? I can't see anything about having to make changes to a script to make it suitable so don't know where to look.

      Thanks

Re: Script error after PAR
by MorayJ (Acolyte) on Feb 13, 2013 at 20:12 UTC

    Me again!

    Right, I didn't really give enough information here, but it looks like the problem was that opening a file with >:encoding(utf8) just works when run through the perl interpreter.

    You need to have use Encoding in the script for par to work with it.

    Cheers

    MorayJ

      Indeed, I didn't!

      Thanks for the tip.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2014-12-22 01:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (110 votes), past polls