Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] Convert array to scalar

Expand Messages
  • Hans Ginzel
    ... When a scalar walue is stored into array, it is stored into the first (counted form null) slot. $currentdate = $currentdate[0]; ... Thats correct, because
    Message 1 of 6 , May 2 12:29 AM
    • 0 Attachment
      On Wed, Apr 30, 2003 at 04:53:19PM -0400, Nguyen, David M wrote:
      > That's what I have but it does not give me correct output.
      >
      > @currentdate = $telnet->cmd('date | cut -d\' \' -f2-3');
      > $currentdate = @currentdate;
      >
      > I should get: April 30 ------> Today date.


      When a scalar walue is stored into array, it is stored into the first
      (counted form null) slot.

      $currentdate = $currentdate[0];

      > But it gave me: 1

      Thats correct, because array contain one entry. See perldoc perldata.

      Hans
    Your message has been successfully submitted and would be delivered to recipients shortly.