Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: split function

by Anonymous Monk
on Jan 25, 2012 at 08:37 UTC ( #949850=note: print w/ replies, xml ) Need Help??


in reply to Re^2: split function
in thread split function

It seems that data file can split up to 17th elements and then the rest will start to split on the next line.

Um, no, that would be jumping to conclusions.

my @junk = split /;/, join ';', 'a'..'z', 'A'..'J'; print int(@junk),"\n"; print "@junk\n"; print "$_=$junk[$_] " for 0,1,10,20,33,34,-1; __END__ 36 a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I +J 0=a 1=b 10=k 20=u 33=H 34=I -1=J

The reason your foreach loop doesn't work is explained in this FAQ, read all 3 parts

  1. Why it's stupid to `use a variable as a variable name'
  2. A More Direct Explanation of the Problem
  3. What if I'm Really Careful?

Read this if you want to cut your development time in half!

Read perlintro and the array /loop chapters of http://learn.perl.org/books/beginning-perl/


Comment on Re^3: split function
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2014-11-27 12:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (184 votes), past polls