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

Re: Output runs into prompt

by hippo (Abbot)
on Jan 20, 2014 at 16:16 UTC ( #1071342=note: print w/replies, xml ) Need Help??

in reply to Noob question

Previous answers (sensibly) recommending Cwd notwithstanding, your problem in the top example is that your output is running into your shell prompt for the following command (whatever that might be). Your chomp is removing the trailling newline that you might need to do this. You could therefore chomp after the print if that's the way you want to go about it.

However, your second script works fine if we adjust the shebang:

$ cat #!/usr/bin/perl use strict; use warnings; my $currDir = `pwd`; chomp $currDir; print "$currDir\n"; $ ./ /tmp $

This suggests that the code you've posted may not be the code you are running.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1071342]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2018-04-20 09:22 GMT
Find Nodes?
    Voting Booth?