Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

by chandantul (Beadle)
on Dec 11, 2020 at 02:11 UTC ( #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 (Archbishop) 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
Node Status?
node history
Node Type: note [id://11124981]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2021-04-17 17:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?