Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: Output runs into prompt

by hippo (Parson)
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.

Comment on Re: Output runs into prompt
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1071342]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2016-05-03 08:05 GMT
Find Nodes?
    Voting Booth?