Ivor Williams wrote:
> Hi,
>
> Any of you know of a way of getting to the raw DCL command line in perl,
> before it has been globbed, argv chunked and otherwise mangled?
>
> I am looking at something which will fake a particular DCL command without
> the users or scripts knowing the difference. However, the environmental
> stuff seems to get in the way. For example, to disable wildcard expansion or
> globbing as Unixers call it requires an additional pair of quotes (which
> need to be doubled up to pass in the quotes, and an extra layer of quotes
> put roung the outside, looks pretty horrible really but it works!).
>
> $ perl munge.pl dir/size=all """*.c"""
>
> What would be really handy is something like this:
>
> use VMS::RawDCL;
>
> $command = VMS::RawDCL::command_line;
> $command =~ s/^\w+//; #Remove the MUNGE command itself
>
> print "You typed $command\n";
> open DCL,"$command|" or die "Failed to spawn $!\nStopped";
> print "Here are the results\n";
>
> while (<DCL>)
> {
> print;
> }
Here is an interesting variation on that theme:
$ type raw.plx
print `@ARGV`;
$ perl raw.plx dir/size=all .c
Directory USER:[PVHP.GAF]
T.C;3 3/3 20-MAR-1998 17:10:22.35
TMP68674.C;1 1/3 22-FEB-1999 15:20:46.69
Total of 2 files, 4/6 blocks.
HTH
Peter Prymmer