Hi Mike!

On Wednesday 06 Jan 2010 19:27:59 Grove, Michael wrote:
> Can someone tell me why I need double quotes for this to work at the line
>  with: print $first, $second, $third\n;
> 
> #!/usr/bin/perl -w
> 

Don't use "-w". Add "use strict;" and "use warnings;". Then fix the errors.


> $first = 0xFF;
> $second = 0377;
> $third = 0b11111111;
> print $first, $second, $third\n;

$third\n is invalid code. The "\n" must be placed inside a string.

Regards,

        Shlomi Fish

> $answer = $first + $second + $third;
> print "$answer\n";
> 
> It only gives this output when I write double quotes "print $first,
>  $second, $third\n";
> 
> 255, 255, 255
> 765
> 
> 
> Mike Grove | AIX System Administrator
> OIT - BIO - Server Farms Division
> PA Department of Labor & Industry
> 651 Boas Street Room 124 | Harrisburg, PA 17121
> Phone: 717-705-2724 | Fax: 717-783-6364
> AIX Hot Line 717-525-5598 | AIX Cell 717-329-0502
> 

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Interview with Ben Collins-Sussman - http://shlom.in/sussman

Bzr is slower than Subversion in combination with Sourceforge. 
( By: http://dazjorz.com/ )

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