Hmmm, probably because I didn't think about doing it that way. I just assumed that I had to define the 9 elements (yes, in the /etc/shadow file, there are always 9 elements) before I could join them. Of course,

$newentry = join(':',(split/:/)[0..8]);

is much cooler. Thanks for the input.

Of course, davorg is right, I forgot that split has a third field that I could have done the same thing. Oh well.

Not feeling as enlightened, mostly feeling like a knucklehead now. :))

Thus I am birdbrane

update: Actually, I have just included the relevant lines of code, there is an "if" statement between the "split" and "join". Otherwise, I would be splitting and rejoining, while doing nothing in between. Doing something for no reason, hmmm, maybe that should be my philosophy for life... :)


In reply to Re: Re: I am now slice-aware by birdbrane
in thread I am now slice-aware by birdbrane

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.