Hello everyone, I'm just trying to use the simplest of examples to learn how to use different functions and just get an understanding of how things are processed, and the syntax of Perl commands.
I just want to get the year as a variable. Here's the rediculously simple script I've started but I don't know why it wants to return "0" before the year. Here's my code: #!/usr/bin/perl print "What year were you born in?\n"; $a = <STDIN>; chop($a); $b = system "date +%Y"; #when date +%Y is typed into the console it says 2002 $age = $b - $a print "You are $age years old!\n"; when I execute this I get the following: What year were you born in? 1986 <~~~~~~I typed this then pushed enter 2002 You are -1986 years old! I'm a total newbie to Perl, someone please help! I'm running Mandrake and my shell is bash if that helps in any way, thanks. Steve -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
