Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Grep & Regex Question

by jdlev (Scribe)
on Dec 01, 2013 at 09:41 UTC ( #1065131=note: print w/replies, xml ) Need Help??


in reply to Re: Grep & Regex Question
in thread Grep & Regex Question

Excellent. Got it to work! I'm just curious about one thing. In order to use the user input prompt to assign the variable, I had to change it to:

chomp($position = <>);

Why do you have to add chomp in order to get the user input to work normally? It looks like it adds a new line after a user input's data for some reason if you just do $position = <>;

I love it when a program comes together - jdhannibal

Replies are listed 'Best First'.
Re^3: Grep & Regex Question
by choroba (Chancellor) on Dec 01, 2013 at 09:54 UTC
    It does not add it, the user does: he/she ends his/her input with a newline.
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1065131]
help
Chatterbox?
[GotToBTru]: back atcha thezip

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2016-12-05 21:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (94 votes). Check out past polls.