Re: handling perl string containing '@' and '$' with system function
- From: "A. Sinan Unur" <1usa@xxxxxxxxxxxxxxxxxxx>
- Date: Wed, 28 Nov 2007 02:25:41 GMT
wong_powah@xxxxxxxx wrote in news:638c7b6c-b259-4438-84c5-
3ec7fff60cef@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:
If I had a perl string $newpw which is inputed by a user and it may
contain special characters such as '@' and '$' (e.g. "5a@Wf7$X"). How
to pass it to the system function properly?
This does not work:
system("/usr/local/bin/acthw -pw \"$newpw\"");
The simplest way would be to bypass the shell:
system '/usr/local/bin/acthw', '-pw', $newpw;
perldoc -f system
Sinan
--
A. Sinan Unur <1usa@xxxxxxxxxxxxxxxxxxx>
(remove .invalid and reverse each component for email address)
clpmisc guidelines: <URL:http://www.augustmail.com/~tadmc/clpmisc.shtml>
.
- References:
- handling perl string containing '@' and '$' with system function
- From: wong_powah
- handling perl string containing '@' and '$' with system function
- Prev by Date: Re: page 124 of the camel book
- Next by Date: Re: Failed with exit code 65280.
- Previous by thread: handling perl string containing '@' and '$' with system function
- Next by thread: Re: handling perl string containing '@' and '$' with system function
- Index(es):
Relevant Pages
|