Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Spaces in the input argument in perl

Status
Not open for further replies.

ranjeeth

Newbie level 6
Joined
Aug 3, 2005
Messages
13
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Mumbai,India
Activity points
1,469
perl passing single input argument

I have written a small code in Perl to search for a given string in text files in a given directory. I take the directory name and string as input arguments to the perl program. Perl takes the space as the seperator for the argument, this does not allow for spaces in the directory name/ text string.
Is there a way by which a single input argument can have a space?
 

perl input argument

Is there a way to have spaces in ARGV[0], ARGV[1] etc in Perl ?
eg if I type perl -w search.pl a1 a2, then the arguments are seperated by space, I have an argument which has a space, How do I deal with it?

Still waiting for an answer ...

Thanks in advance
 

perl input a directory name with spaces

windows:
inclose the args with spaces with "" (double quotes), example
Code:
program "arg 0" "arg 1"

unix:
inclose the args with spaces with '' (single quotes), example
Code:
> program 'arg 0' 'arg 1'
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top