Hey Guys, would anyone care to explain whats going on;
I have a few codes and i don't know why one works and the other doesn't. I'm playing around with concatenation operators "," and "."
These are my codes. ALL THE CODES WORKED EXCEPT FOR THE LAST ONE!!!
CODE ONE
[code=perl]
#! /usr/bin/perl
#stringoperator .plx
use warnings;
print "print", " several", " strings", " here", "\n";
print "print" . " several" . " strings" . " here" . "\n";
[/code]
For the second code i tried using both concatenations in the same line of code, just to see if I'd get any errors but they both gave me desired results.
CODE TWO
[code=perl]
#! /usr/bin/perl
#string1.plx
use warnings;
print "Four sevens are ". 4 * 7 ,"\n";
print " Four sevens are ", 4 * 7 ."\n";
[/code]
CODE THREE
[code=perl]
#! /usr/bin/perl
#string2.plx
use warnings;
print "G0 JOHNNY" ." GO!!"x2, "\n";
[/code]
CODE FOUR
[code=perl]
#! /usr/bin/perl
#string2.plx
use warnings;
print "G0 JOHNNY" ," GO!!"x2, "\n";
[/code]
CODE FIVE
[code=perl]
#! /usr/bin/perl
#string2.plx
use warnings;
print "G0 JOHNNY" ." GO!!"x2, "\n";
[/code]
CODE SIX
[code=perl]
#! /usr/bin/perl
#string2.plx
use warnings;
print "G0 JOHNNY" ." GO!!"x2. "\n";
[/code]
Error Reads As;
String found where operator expected at <filename.plx > line 4, near "2. "\n""
(Missing operator before "\n"?)
syntax error at <filename.plx > line 4, near 2. "\n""
Execution of <filename.plx > aborted due to compilation errors.
I
I have a few codes and i don't know why one works and the other doesn't. I'm playing around with concatenation operators "," and "."
These are my codes. ALL THE CODES WORKED EXCEPT FOR THE LAST ONE!!!
CODE ONE
[code=perl]
#! /usr/bin/perl
#stringoperator .plx
use warnings;
print "print", " several", " strings", " here", "\n";
print "print" . " several" . " strings" . " here" . "\n";
[/code]
For the second code i tried using both concatenations in the same line of code, just to see if I'd get any errors but they both gave me desired results.
CODE TWO
[code=perl]
#! /usr/bin/perl
#string1.plx
use warnings;
print "Four sevens are ". 4 * 7 ,"\n";
print " Four sevens are ", 4 * 7 ."\n";
[/code]
CODE THREE
[code=perl]
#! /usr/bin/perl
#string2.plx
use warnings;
print "G0 JOHNNY" ." GO!!"x2, "\n";
[/code]
CODE FOUR
[code=perl]
#! /usr/bin/perl
#string2.plx
use warnings;
print "G0 JOHNNY" ," GO!!"x2, "\n";
[/code]
CODE FIVE
[code=perl]
#! /usr/bin/perl
#string2.plx
use warnings;
print "G0 JOHNNY" ." GO!!"x2, "\n";
[/code]
CODE SIX
[code=perl]
#! /usr/bin/perl
#string2.plx
use warnings;
print "G0 JOHNNY" ." GO!!"x2. "\n";
[/code]
Error Reads As;
String found where operator expected at <filename.plx > line 4, near "2. "\n""
(Missing operator before "\n"?)
syntax error at <filename.plx > line 4, near 2. "\n""
Execution of <filename.plx > aborted due to compilation errors.
I
Comment