in reply to Handling the output of a system command -- how to best manage?

For the first part of your question, you can return your current working directory with http://perldoc.perl.org/Cwd.html:
use Cwd; my $dir = getcwd;

Can you please elaborate on what you mean for the second part of your question?

  • Comment on Re: Handling the output of a system command -- how to best manage?
  • Download Code

Replies are listed 'Best First'.
Re^2: Handling the output of a system command -- how to best manage?
by taint (Chaplain) on Jun 20, 2012 at 14:17 UTC

    Greetings, and thank you very much for your reply.
    Yes, I can elaborate. :)
    Firstly, I'm not very good at this. But after many fails, this was the best I could conceive:
    my $listing = $ENV{CWD};
    While it did give me Current Working Directory.
    Perl(1) was (rightfully) unhappy with my choice
    ( Insecure $ENV{PATH} while running with -T switch ).

    Why do I care about CWD||PWD? Because my script will live in /cgi-bin/, or @INC.
    I need to include it where ever I call it from
    eg; <!--#exec cgi="/cgi-bin/filelist.pl" -->.
    I've looked at other modules that would dump/list the contents of folders -- File::Listing, for example.
    But given that none of them offered the ability to alternate td/div background colors for readability,
    and that there are thousands of, ahem... PHP scripts that do this. I thought this might be a worthy endevour -- god knows I need the practice! :)

    I hope this makes better sense of my delemna, and thank you again for your response.

    #!/usr/bin/perl -Tw
    
    use strict;
    use perl::always;
    
    my $perl_version( 5.12.4 );
    
    print $perl_version;