Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

In Perl, if $var = "1"; and you print 'You win $var dollar'; what would it return?

 

1. You win $var dollar

2. You win $1 dollar

3. You win1 dollar

4. You win0 dollar

user-image
Question ajoutée par Emad Mohammed said abdalla , ERP & IT Software, operation general manager . , AL DOHA Company
Date de publication: 2015/08/29
Emad Mohammed said abdalla
par Emad Mohammed said abdalla , ERP & IT Software, operation general manager . , AL DOHA Company

In Perl when the print statement is using a single quote (') instead of a double quote (") Perl prints the exact characters. This means even if $var is a variable it will not be treated as one because Perl is printing the actual dollar sign. If you wanted to print the variable, so it shows how many dollars have been won you would type: "You win $var dollars"; as the command.

Mohsin Patel
par Mohsin Patel , Accounting Analyst , Water G.

You win $var dollar, whatever variable value is.

More Questions Like This

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?