Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: How do I remove newline character from a number got from unix command

by tousifp (Novice)
on Sep 04, 2013 at 12:20 UTC ( #1052315=note: print w/ replies, xml ) Need Help??


in reply to Re: How do I remove newline character from a number got from unix command
in thread How do I remove newline character from a number got from unix command

I was using chomp($year) and so not returning expected result. Thanks
  • Comment on Re^2: How do I remove newline character from a number got from unix command

Replies are listed 'Best First'.
Re^3: How do I remove newline character from a number got from unix command
by Happy-the-monk (Abbot) on Sep 04, 2013 at 13:05 UTC

    I was using chomp($year) and so not returning expected result. Thanks

    So...

    The documentation for chomp tells you how chomp works and what it returns.
    It is the contents of the variable itself that you should verify.

    Update: to be concise, I added "the contents of" to the line above.

    Cheers, Sören

    Créateur des bugs mobiles - let loose once, run everywhere.
    (hooked on the Perl Programming language)

      What did it return? - 1

      What did you expect? - 2013

      How did you verify the result? - by printing

      How did you fail to read the documentation? - beginner(sure for perl)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2016-07-29 12:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (261 votes). Check out past polls.