Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: Repeating the same command in different portions of input

by Kenosis (Priest)
on Jan 15, 2013 at 21:03 UTC ( [id://1013456]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Repeating the same command in different portions of input
in thread Repeating the same command in different portions of input

Yes, splitting the 'chunk' is a good solution! However, since you've noticed the chunk lacks newlines, change:

my @values = split('\n', $chunk);

to

my @values = split /\s+/, $chunk;
  • This splits on whitespace
  • It uses a regex, not a string literal (also, '\n' would not be interpolated into a newline since you've used single quotes)
  • Parentheses are optional

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-23 16:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found