Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^4: Printing first element of an array in worksheet

by chandantul (Scribe)
on Dec 11, 2020 at 02:11 UTC ( [id://11124981]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Printing first element of an array in worksheet
in thread Printing first element of an array in worksheet

I am receiving all the elements from $responsetextall$i$j{set}{Client}{redirect_uris}; which was ARRAY of ARRAY references

$responsetextall[$i][$j]{set}{Client}{redirect_uris};

The issue is its not writing all the elements in single cell of a worksheet and its writing in separate cells. like the following 'http://abcd01.cpu.comp.com:80/AutosysPortal/' 'http://abcd01.cpu.comp.com:80/Da/', 'http://abcd01.cpu.comp.com:80/Ge/', 'http://abcd01.cpu.comp.com:80/PO/', 'http://abcd01.cpu.comp.com:80/g Can we split through "|" and put it into single cell?

Replies are listed 'Best First'.
Re^5: Printing first element of an array in worksheet
by choroba (Cardinal) on Dec 11, 2020 at 11:13 UTC
    You probably mean join, not split, it's the inverse. Yes, you can:
    my $string = join '|', @{ $responsetextall[$i][$j]{set}{Client}{redire +ct_uris} };
    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

      Thanks this works

Log In?
Username:
Password:

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

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

    No recent polls found