Hi,

Can someone explain the difference between backticks and system when
evaluated in this if statement:


sub getDate {
 print "start date\n";
 if ( system("/bin/date") ) {
   print "can't get date\n";
   exit(2);
 }
 print "finish date\n";
}

Returns the following:

start date
Thu Jul 28 12:13:59 EST 2005
finish date



While this:

sub getDate {
 print "start date\n";
 if ( `/bin/date` ) {
   print "can't get date\n";
   exit(2);
 }
 print "finish date\n";
}

Returns this:

start date
can't get date


O Lucent Technologies
Level 1, 68 Waterloo Rd.
North Ryde NSW 2113
Australia
Tel:    +61 (0)2 9491 6898
Mob:    +61 (0)434 127 545


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to