As Roger and jeffa already pointed out, 'substr' can be used. But completeness I'll mention 'unpack'. The Perl Cookbook p.3 & 4 mentions substr and unpack to access substrings. To remove the 1st character from a string, you could use unpack this way:
($first, $rest) = unpack("A1 A*", $original_string);
I don't know performance wise which is better, but I'm guessing 'substr' would be test if you just need to remove the first character. But if you need to separate and capture more than just one substring from the line, and the substrings are at the same location in every line, then unpack might be test. If performance is your concern, just create one loop that does one 1000(or 10,000, or 100,000) times, and then another loop that does the other 1000 times - capture the time at the start and end of each, and compare.

In reply to Re: Chopping the beginning of a string? by hmerrill
in thread Chopping the beginning of a string? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.