in reply to Re^2: getting shell expansion to work
in thread getting shell expansion to work

I guess the simplest way is then to be explicit about what you want to happen, instead of hoping for some magic in Perl that you don't know about:

my $pattern = 'mc-lang-+([^-])-+([^-])*.rpm'; my $results = `$ENV{SHELL} -c echo $pattern`;

assuming that by $SHELL you mean the environment variable $SHELL and not the Perl variable $SHELL.

Replies are listed 'Best First'.
Re^4: getting shell expansion to work
by perl-diddler (Chaplain) on Dec 28, 2007 at 19:36 UTC
    Yes...specifically, I wanted bash's expansion, so more recent revisions have included deliberate specification using "bash -c". Someone else noted that they got the extended regular expressions to work using the backquote syntax even though perl invokes bash using the "sh" alias. They (and I) both thought that invoking bash with the sh alias might limit bash to 'sh' compatibility mode...but surprise -- it didn't (not that one should rely on such things! :-)...