Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners > Re: how to sepe...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 10904 of 12002
Post > Topic >>

Re: how to seperate the run time argument with | character

by chas.owens@[EMAIL PROTECTED] (Chas. Owens) Apr 8, 2008 at 11:30 PM

On Tue, Apr 8, 2008 at 3:46 PM, mitr <mitr.bala@[EMAIL PROTECTED]
> wrote:
>
>  Hi,
>
>  I have a perl script, where I am passing more than 3 arguments, but I
>  want to seperate them with |(pipe)or any other special charcater
>  instead of blank space, cause the argument itself I have the space
>  like " sixty three".
>  For example c:\perl>perl sample.pl sixty three|fouty four| twenty two
>  in windows.
>
>  now I am passing the argument like
>
>  c:\perl>perl sample.pl two three four, when you do not have the space
>  in the argument itself then it is fine otherwise it is taking
>  everything as an argument.
>
>  Could anyone please help me on this issue?
snip

The correct way to do this is to quote the arguments that contain
characters the shell cares about (space, |, &, [, $, etc):

perl sample.pl 'this is one argument' two three

-- 
Chas. Owens
wonkden.net
The most im****tant skill a programmer can have is the ability to read.
 




 1 Posts in Topic:
Re: how to seperate the run time argument with | character
chas.owens@[EMAIL PROTECT  2008-04-08 23:30:05 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Oct 14 10:03:29 CDT 2008.