Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Trying to capture a value from a list of values

by parthodas (Acolyte)
on Sep 02, 2015 at 11:36 UTC ( [id://1140783]=note: print w/replies, xml ) Need Help??


in reply to Re: Trying to capture a value from a list of values
in thread Trying to capture a value from a list of values

'$myhash{SBLLNXSRVRHOSTS})' has server names like -- dvapoms1,dvapoms2
The code shows below things --
@mylnxsrvrs = split(',', $myhash{SBLLNXSRVRHOSTS}); @mywinsrvrs = split(',', $myhash{SBLWINSRVRHOSTS}); @mysblroot = split(',', $myhash{SIEBELROOT}); @mysblsrvrpath = (',',$myhash{SBLSRVRPATH}); foreach $something (@mylnxsrvrs) {my $lnxsrvr = "$something"; printf "$something $lnxsrvr\n\n";} ##dvapoms1 dvapoms1 ##dvapoms2 dvapoms2 printf "$lnxsrvr\n"; ##"shows null" printf "@mylnxsrvrs"; ##dvapoms1 dvapoms2
Hope this clears the point. I need to catch dvapoms1 in $lnxsrvr.

Replies are listed 'Best First'.
Re^3: Trying to capture a value from a list of values
by tangent (Parson) on Sep 02, 2015 at 11:45 UTC
    Why have you completely ignored Ed's advice?

    To get the first value of your array:
    my $first_value = $mylnxsrvrs[0];
      I did not ignored Ed's advise. But could not apply it. Though using my $first_value = $mylnxsrvrs[0]; solved my issue. Thanks a lot.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1140783]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2024-04-16 04:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found