Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Executing external program via backquotes

by 5mi11er (Deacon)
on Feb 10, 2010 at 22:09 UTC ( [id://822532]=note: print w/replies, xml ) Need Help??


in reply to Executing external program via backquotes

Well, you're already surrounding the directory you're searching through with double quotes, now try surrounding the $_ argument with double quotes too:
@results = `grep -i "$_" $can_archive`;
-Scott

Replies are listed 'Best First'.
Re^2: Executing external program via backquotes
by King0 (Initiate) on Feb 10, 2010 at 22:35 UTC

    Thanks for the suggestion; I had that in my first version of the script -- but unfortunately double quoting $_ doesn't resolve the issue. Rather, when the argument is supplied to grep it some how breaks the argument into to separate ones, in spite of the variable being double quoted. For example, if the $_ variable held Jon Doe -- the error would be:

    grep Jon: No such file or directory grep Doe: No such file or directory
    Do you have any other suggestions? Thanks. -Dan

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://822532]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (12)
As of 2024-04-23 14:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found