On Tue, May 15, 2012 at 07:40:44AM -0400, sunita.prad...@emc.com wrote:
> Hi
> 
>                 I want to print the command during script execution .
> Example :
> 
> ===================
> $ls = `ls`;
> 
> Print "$ls\n";
> ==================

A straightforward way to do this is to run your script with the perl debugger:

     perl -d script_name

When it loads you'll see something like:

    michael@bivy:~$ perl -d tpl
    
    Loading DB routines from perl5db.pl version 1.32
    Editor support available.
    
    Enter h or `h h' for help, or `man perldebug' for more help.
    
    main::(tpl:5):  my %index;     ####  The first executable line of your 
script
    
Then press n on your keyboard to run the next command:
    
      DB<1> n                                                                   
                                                             
    main::(tpl:6):  my @file = <DATA>;
    
And after that just press <ENTER> to execute each command in turn. 

As you might imagine you can do other things with the debugger too.

-- 
            Michael Rasmussen, Portland Oregon  
      Other Adventures: http://www.jamhome.us/ or http://westy.saunter.us/
Fortune Cookie Fortune du courrier:
Happiness is a path, not a destination.
    ~ Tay Gillespie by way of Mark Canizaro

-- 
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