in reply to processing on the command line

my $directory = shift @ARGV;
had you actually tried @ARGV before posting? or do i miss something in your question?

for future use, i want to recommend perlvar; this contains all special perl variables with explanation of their purpose.

Update: ok, i see, you're asking a shell question. you should have stated that you only get the first part until the space. I'm on linux and i couldn't guess that.
you can either escape the spaces correctly as it should be documented for your 'shell' which probably is DOS commandline,
or you can join() all arguments together with spaces.

Replies are listed 'Best First'.
Re: processing on the command line
by b10m (Vicar) on Mar 02, 2004 at 15:09 UTC
    "or do i miss something in your question?"

    I think you missed the part of the spaces and backslashes. To use your code, the input should be quoted (apostrophe) or escaped (backslashes):

    $ cat script.pl my $directory = shift @ARGV; print $directory."\n"; $ perl script.pl 'c:\Documents and Settings\All Users' c:\Documents and Settings\All Users $ perl script.pl c:\\Documents\ and\ Settings\\All\ Users c:\Documents and Settings\All Users

    Update Thanks to Corion I should add this disclaimer: "varying on the shell in use" ;)

    --
    b10m

    All code is usually tested, but rarely trusted.
A reply falls below the community's threshold of quality. You may see it by logging in.