Solved

print dumper

Posted on 2009-05-05
2
292 Views
Last Modified: 2012-05-09
I'm trying to assing a user's input to a string.. why when i chomp the input and use print Dumper does the outcome look like this:
I typed the word enter

with chomp:
';AR1 = 'Enter;

with no chomp:
$VAR1 = 'Enter
';
my $input = <>;

         

      chomp ($input);

Open in new window

0
Comment
Question by:cucugirl
2 Comments
 
LVL 39

Expert Comment

by:Adam314
Comment Utility
The $input after <> will have a newline character on it.  The chomp will remove the newline character.   If there is a newline, the Dumper will display it.
0
 
LVL 84

Accepted Solution

by:
ozo earned 125 total points
Comment Utility
l\it looks like you have "\r\n" at then end p $input and a "\r" at the end of $input after the chomp
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now