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

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: why this code doesnt work?
by ikegami (Patriarch) on Jul 04, 2011 at 20:43 UTC

    [ I moved your post to Seekers of Perl Wisdom. PerlMonks Discussion is for discussion about PerlMonks. ]

    [ Your post is hard to read. Please use <p> at the start of paragraphs and <c>...</c> around computer text (code, data, output, etc). ]

    pdw should be pwd. See also: Cwd.

Re: why this code doesnt work?
by sumeetgrover (Monk) on Jul 04, 2011 at 20:54 UTC

    Apart from formatting the code and then re-pasting it here, you would also need to paste the output that this Perl script produces.

    You have used #!/usr/bin/env perl in the shebang line, so you'd also need to ensure that the Perl binary is searcheable in the $PATH environment variable of your UNIX shell for this script to execute.

Re: why this code doesnt work?
by Anonymous Monk on Jul 04, 2011 at 23:44 UTC
    Cwd can tell you the current directory.
    #! /usr/bin/env perl use strict; use warnings; use Cwd 'getcwd'; print "current dir: ", getcwd(), "\n";
Re: why this code doesnt work?
by JavaFan (Canon) on Jul 04, 2011 at 22:14 UTC
    You ought to have gotten an error message that explains why.
Re: why this code doesnt work?
by bimleshsharma (Beadle) on Jul 05, 2011 at 06:32 UTC

    Actually your code is like this...

    #!/usr/bin/env perl
    use warnings;
    use strict;
    my $dummy_scalar_1;
    $dummy_scalar_1=`pdw`;
    chomp $dummy_scalar_1;
    print "$dummy_scalar_1";

    nothing wrong with code except one. You should write

    $dummy_scalar_1=`pwd`;
    instead of
    $dummy_scalar_1=`pdw`;
    enjoy....