vvp:CGI.pm printing vs executing statments? 
Author Message
 vvp:CGI.pm printing vs executing statments?

Hello,

I have a litte piece of code - where the first to lines in the if
statement just print to the screen -whereas the elsif actually execustes
a statement - they are very much the same.  How do I make the first if
execute - not display?

print $cgi->p("catalog: $catalog dataset: $dataset");<--THIS PRINTS

        if ($catalog && $dataset)
                {
                print $cgi->p (`/home/netsite/upd_catalog/upd_catalog
$catalog s
umitt_aaa`) or die "Error from script."; <--this prints the URL

                print $cgi->p (`/home/netsite/upd_catalog/upd_dataset
$dataset s
umitt_aaa`) or die "Error from script."; <--this prints the URL
                }

        elsif ($catalog && !$dataset)
                {
                print $cgi->p (`/home/netsite/upd_catalog/upd_catalog
$catalog s
umitt_aaa`) or die "Error from script.";<--this EXECUTES upd_catalog
with the parameter $catalog

I am using backquotes on each statement - but one executes and the first
one just prints.  

The parameters are passed.

Output (first 'if')- if $catalog and $dataset are given the values 1:

catalog: 1 dataset: 1

/home/netsite/upd_catalog/upd_catalog $catalog sumitt_aaa

/home/netsite/upd_catalog/upd_dataset $dataset sumitt_aaa

Output (elsif)- if $catalog is given the value 1:

catalog ID: 1 Updating: TO sumitt_aaa About to update catalog: 1 ... to
DB sumitt_aaa. Catalog 1 exists on the destination server. Replacing it
with the source information... Just saved old data to file
old_prod_catalog_data.unl ... Just started a transaction ... Just
obtained lock on sumitt_aaa table catalog... Just deleted old data ...
Just inserted new data ... Just saved all changes successfully.
<script is run> - this is what I want.

Help?

Thanks,

V



Mon, 29 Dec 2003 19:51:00 GMT  
 vvp:CGI.pm printing vs executing statments?

Quote:
> I have a litte piece of code - where the first to lines in the if
> statement just print to the screen -whereas the elsif actually execustes
> a statement - they are very much the same.  How do I make the first if
> execute - not display?

You are not showing us tha actual code.  I can tell this because
comments in Perl are introduced with '#' not '<--'.  I'm fairly
confident that in transcribing fro code by hand you also eliminated
the typos that were responsible for your problems.

Quote:
> I am using backquotes on each statement

Are you sure.  Are you really sure?

--
     \\   ( )
  .  _\\__[oo

 .  l___\\
  # ll  l\\
 ###LL  LL\\



Wed, 31 Dec 2003 21:25:56 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. CGI.pm vs. Base.pm

2. CGI-modules vs. CGI.pm

3. Printing in format statments using e/g format

4. Printing while simultaneously using CGI.pm and Mail::Internet.pm

5. cgi-lib.pl vs CGI.pm?

6. cgi-lib.pl vs CGI.pm

7. cgi.pm .vs. cgi-lib.pl

8. CGI.pm Script Executes, but Error in Browser

9. CGI.pm functions vs OO

10. CGI.pm: procedural vs. OO

11. CGI.pm and POST vs GET methods

12. CGI.pm vs. mac characters

 

 
Powered by phpBB® Forum Software