Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^4: selecting columns from a tab-separated-values file

by CountZero (Bishop)
on Jan 22, 2013 at 07:28 UTC ( #1014588=note: print w/ replies, xml ) Need Help??


in reply to Re^3: selecting columns from a tab-separated-values file
in thread selecting columns from a tab-separated-values file

What's the first arg to split()? It appears to be a single blank char. How does that work to split upon tab chars?
It's a space enclosed within single quotes. It tells split to split on whitespace, e.g., \t, \n, space.
That is a dangerous thing to do. it works for your example data, but it will break on real word data where you will have LAST names like Van Winkle and CITYs called New York.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics


Comment on Re^4: selecting columns from a tab-separated-values file
Select or Download Code
Re^5: selecting columns from a tab-separated-values file
by Kenosis (Priest) on Jan 22, 2013 at 07:56 UTC

    You're quite right and this has been corrected. Appreciate you catching this.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2014-07-11 07:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (220 votes), past polls