Here is my newbie dilemma!
I am familiar, or at least I can figure out the idea behind splitting, but not enough to be able to do it from a loaded array.
I understand if you have a variable say $new that has "I am new" you can split $new by the whitespace.
What I haven't been able to do is load in a FH that I created and split the array. I am guessing I would need a while or a foreach loop, but not really sure of the logic behind it.
I was thinking a foreach on the array would work but...well obviously I am slightly lost.
#!/usr/bin/perl use warnings; use strict; my $l; my @l; open (FH3, ">lessons.txt"); print FH3 "Perl*Lesson1\nPerl*Lesson2\nPerl*Lesson3\nJava*Lesson1\nJav +a*Lesson2\nJava*Lesson3\nPHP*Lesson1\nPHP*Lesson2\nPHP*Lesson3\n"; $l="lessons.txt"; open(FH3, $l) || die("Could not open file!"); @l=<FH3>; print "@l";

In reply to Splitting an array loaded from a file handle. by trenchwar

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.