Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: splitting the scalar variables in an array

by sunil9009 (Acolyte)
on Nov 17, 2013 at 11:05 UTC ( #1062987=note: print w/ replies, xml ) Need Help??


in reply to Re^2: splitting the scalar variables in an array
in thread splitting the scalar variables in an array

Consider this resolved, foreach was printing it 3 times. Final working code is as follows. Thanks to all of you guys fo the pointers.

sub gethosts { foreach $class(@hostclass) { chomp (@hosts_per_hostclass = `/opt/systems/bin/expand-hostclass --hos +ts -r $class`) ; #print "@hosts_per_hostclass \n"; push @dd, split "\n", $_ for @hosts_per_hostclass; } return @dd; }


Comment on Re^3: splitting the scalar variables in an array
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2014-11-28 18:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (199 votes), past polls