CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate: Re: [unix8me] Net::LDAP Proxy addresses: Edit Log



Laurent_R
Veteran / Moderator

Aug 5, 2017, 4:27 AM


Views: 1607
Re: [unix8me] Net::LDAP Proxy addresses

I don't know this module, but this:


Code
 $smtp[0-7]

is the wrong syntax for what you probably want. It should most probably be:

Code
@smtp[0..7]


This syntax:

Code
 $smtp[0-7]

tries to fetch the array element with subscript -7, i.e. seven places before the end of the array.

And, BTW, this would be an array with eight items, not seven.

If your array has less than eight addresses, you could probably use something like this:

Code
@smtp[0..$#smtp]


If you have "empty slots" (undefined elements) within your array, you might first need to remove these empty slots, for example using a grep command:

Code
@smtp = grep {defined $_} @smtp;



(This post was edited by Laurent_R on Aug 5, 2017, 4:33 AM)


Edit Log:
Post edited by Laurent_R (Veteran) on Aug 5, 2017, 4:33 AM
Post edited by Laurent_R (Veteran) on Aug 5, 2017, 4:33 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives