Mailing List Archive

system()
just wanna know how you can include system("dig domain.com"); in embperl and
be able to put the result in a variable.

tnx
RE: system() [ In reply to ]
You would do it just like you do in normal perl.

<html>

[.-
open (DIG, "dig domain.com | ");
$foo = <DIG>;
close (DIG);
-]
dig returned: [+ $foo +]

alternatively, you can try:

dig returned: [+ `/usr/local/bin/dig domain.com` +]

On 02-Jun-2000 Embperl wrote:
> just wanna know how you can include system("dig domain.com"); in embperl and
> be able to put the result in a variable.
>
> tnx
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org

Regards,

Wim Kerkhoff, Software Engineer
NetMaster Networking Solutions
wim@netmaster.com
Re: system() [ In reply to ]
Hmm... Skip the use of backticks... Bad things can be done.

Check out: http://www.w3.org/Security/Faq/wwwsf5.html#Q44 on how to
properly interact with system commands.

Also, double and triple check user inputs also before passing them to
ANY system command.

Wim Kerkhoff wrote:
>
> You would do it just like you do in normal perl.
>
> <html>
>
> [.-
> open (DIG, "dig domain.com | ");
> $foo = <DIG>;
> close (DIG);
> -]
> dig returned: [+ $foo +]
>
> alternatively, you can try:
>
> dig returned: [+ `/usr/local/bin/dig domain.com` +]
>
> On 02-Jun-2000 Embperl wrote:
> > just wanna know how you can include system("dig domain.com"); in embperl and
> > be able to put the result in a variable.
> >
> > tnx
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> > For additional commands, e-mail: embperl-help@perl.apache.org
>
> Regards,
>
> Wim Kerkhoff, Software Engineer
> NetMaster Networking Solutions
> wim@netmaster.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org

--
__________________________________________________________
Mr. Erich L. Markert emarkert@pace.edu
Computer Learning Center TEL (914)422-4328
Pace University
1 Martine Ave
White Plains, New York 10606-1932

Those who do not understand Unix are condemned to reinvent it, poorly.
-- Henry Spencer