Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Assigning multiple lines into first element of array

by shabird (Sexton)
on Mar 01, 2020 at 03:09 UTC ( #11113595=note: print w/replies, xml ) Need Help??


in reply to Re: Assigning multiple lines into first element of array
in thread Assigning multiple lines into first element of array

Everything works good but one more thing how can i count number of characters in first element of the array? When it returns first element of array it has many characters e.g: GAGGTGCTGGGGAGCAGCGTGTTTGCTGTGCTTGATTGTGAGCTGCTGGGAAGTTGTGACTTTCATTTTA CCTTTCGAATTCCTGGGTATATCTTGGGGGCTGGAGGACGTGTCTGGTTATTATATAGGTGCACAGCTGG. how come i count these characters?

  • Comment on Re^2: Assigning multiple lines into first element of array

Replies are listed 'Best First'.
Re^3: Assigning multiple lines into first element of array
by AnomalousMonk (Bishop) on Mar 01, 2020 at 06:26 UTC

    See length:

    c:\@Work\Perl\monks>perl -wMstrict -le "my @ra = ('MANYCHARACTERS'); printf qq{1st element of array has %d characters \n}, length $ra[0]; " 1st element of array has 14 characters


    Give a man a fish:  <%-{-{-{-<

Re^3: Assigning multiple lines into first element of array
by tybalt89 (Prior) on Mar 01, 2020 at 08:08 UTC

    ...

    my @counts = map s/.*\n//r =~ tr/A-Z//, @array; print "counts: @counts\n";

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2020-09-20 13:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (121 votes). Check out past polls.

    Notices?