Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6845483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:30:21+00:00 2026-05-27T00:30:21+00:00

I have a sequence that looks like this: my $seq = D\IKLR\LK/Q; what I

  • 0

I have a sequence that looks like this:

my $seq = "D\IKLR\LK/Q";

what I want to do is to break the sequence into individual letter.

So I hope to get:

my $var = ['D', '\', 'I', 'K', 'L', 'R', '\', 'L', 'K','/' ,'Q'];

But why this does’nt do it:

 my @chars = split(//,$seq);
 print Dumper \@chars;

It gave this instead:

my $var = ['D', '\\', 'I', 'K', 'L', 'R', '\\', 'L', 'K', 'Q'];

What is the right way to do it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T00:30:22+00:00Added an answer on May 27, 2026 at 12:30 am

    What you are getting is exactly what you want.

    The way to represent a single \ is '\\' and not '\' as you expected because the \ in '\' escapes the second ' making the string incomplete but the Data::Dumper return value can always be evaled as it’s Perl code.

    But printing the individual elements of the array by say looping over it will print \.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some XSD that looks something like this: <element name=a> <complexType> <sequence> <element
Hi I have a data frame that looks like this: Seq H E T
Lets say I have a database that looks like this: tblA: ID, Name, Sequence,
I have an XML Schema that looks like this: <xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema> <xs:element name=root> <xs:complexType>
I have a space delimited tabular file that looks like this: >NODE 28 length
I have a vector that looks like this: mass<-c(-2, -6, -79, 31, -28, 198,
So I have an XQuery that looks something like this: for $i in /*:rootElement
I have a piece of xml that looks like this: <root> <tag1>tractor</tag1> <tag2> <subtag1
I have a bool array that looks like this bool[] responses = new bool[]
I have a data that looks like this (FASTA format). Note that in comes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.