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

RE: [PBML] using variable value in array

Expand Messages
  • Mirza Abdullah Jan
    Thanks Charles. This is working fine with qq. Thanks once again Take care with regards Abdullah Jan Charles K. Clarkson wrote: ... No.
    Message 1 of 6 , Mar 29, 2006
      Thanks Charles.
      This is working fine with qq.
      Thanks once again
      Take care
      with regards
      Abdullah Jan

      "Charles K. Clarkson" <cclarkson@...> wrote:
      eman top posted:

      : Use this:
      : @myarray = qq($address $ip $destadd $destip)
      : instead of this:
      : @myarray = qw($address $ip $destadd $destip)
      : The different is that using qq is like:
      : @myarray = ("$address". "$ip", "$destadd", "$destip")

      No. No, it isn't. Test your code before answering
      questions. It only takes a little bit of time. It
      is often a bad idea to quote variables unnecessarily.

      #!/usr/bin/perl

      use strict;
      use warnings;
      use Data::Dumper 'Dumper';

      my $address = 'etc.com';
      my $ip = '10.10.10.1';
      my $destadd = 'dest.com';
      my $destip = '192.168.4.2';

      my @ip_stuff = qq($address $ip $destadd $destip);
      print Dumper \@ip_stuff;

      @ip_stuff = ($address, $ip, $destadd, $destip);
      print Dumper \@ip_stuff;

      __END__



      HTH,

      Charles K. Clarkson
      --
      Mobile Homes Specialist
      254 968-8328




      Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html



      ---------------------------------
      YAHOO! GROUPS LINKS


      Visit your group "perl-beginner" on the web.

      To unsubscribe from this group, send an email to:
      perl-beginner-unsubscribe@yahoogroups.com

      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


      ---------------------------------





      ---------------------------------
      Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates.

      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.