Sara has asked for the wisdom of the Perl Monks concerning the following question:

Hi all , I am trying to parse my input from a command line, I am doing
while(@ARGV) { $arg = shift(@ARGV) }
it work fine but if i have this "C:\Sara\file\doc", then it read me only C:Sarafiledoc, why is it doing this , am I doing it wrong . thanks

2002-06-27 Edit by Corion : Moved to Seekers of Perl Wisdom; added formatting; changed title

Replies are listed 'Best First'.
Re: command line
by belg4mit (Prior) on Jun 27, 2002 at 01:50 UTC
    It's not, you're using some form of interpolating quotes, \ escapes certain characters, invalid escape sequences return the original character. The \ get wiped out in the output.

    You probably want to look at using Getopt::Std or Getopt::Long

    --
    perl -pew "s/\b;([mnst])/'$1/g"