It is working for one line program . How can we implement in a script ?

-Sunita

-----Original Message-----
From: CloudWebDNS.com [mailto:supp...@cloudwebdns.com] 
Sent: Tuesday, May 15, 2012 5:27 PM
To: beginners@perl.org
Subject: Re: how to display commands while perl script executing

Hello,

Try this:

$ perl -le '$c="ls -l";print $c;system $c'
ls -l
total 16
drwxr-xr-x 4 pyh pyh 4096 2012-05-12 17:08 backup
drwxr-xr-x 2 pyh pyh 4096 2012-05-13 08:29 bin
drwxr-xr-x 5 pyh pyh 4096 2012-05-03 11:03 ipdata
drwxr-xr-x 4 pyh pyh 4096 2012-05-14 10:34 tmp



> Hi
>
>                  I want to print the command during script execution .
> Example :
>
>
> ===================
> $ls = `ls`;
>
> Print "$ls\n";
> ==================
>
> In the above script I want to print "ls" command before 'ls' command gets 
> executed . Like  "set -x" does  in  shell scripts .
>
> Could you please help me on this ?
>
> Thanks
> Sunita
>
>
>



-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/



Reply via email to