in reply to Gathering current ksh shell aliases in perl

use warnings; use strict; my @aliases = qx(ksh -c alias); print "@aliases\n";
However, this with create a non-login shell. What happens now depends on the versions of ksh you are using, and where your aliases are defined. Let me assume your aliases are in .kshrc. If so, then on ksh88 then ~/.kshrc (or the file defined in the ENV environment variable) will be executed and you should be fine. However on ksh93 it will not execute $ENV, so you need:
my @aliases = qx(ksh -c '. ~/.kshrc;alias');
or 'source' whatever file your aliases are defined in.

Replies are listed 'Best First'.
Re^2: Gathering current ksh shell aliases in perl
by afoken (Chancellor) on Apr 28, 2010 at 06:26 UTC

    But that still does not return the aliases defined interactively in the ksh instance invoking the perl script.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)