Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

New to Perl

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've been looking around about how to find string equality and from what I've seen I just need to use eq but if AT is entered into the following code it's saying its not equal and i'm not sure why.

 
lowercase baba
Posts: 12988
66
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, to be fair, your strings are not equal.

Change line 11 to this:

note the two colons. This shows you that your string isn't what you think it is. it contains EXACTLY what you typed on the command line. and I'm pretty sure you hit THREE keys to get your "AT" (not counting shift or caps lock).

Then I suggest you look up the chomp method of perl.

 
Dustin Schreader
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your help. I figured the string wasn't being parsed correctly if I'm saying that right, so I did eventually fall upon the chomp method!
 
fred rosenberger
lowercase baba
Posts: 12988
66
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would say the string is being parsed properly, but it's taking everything you type at the command line, not just what you want.

I had someone at work have this exact same problem last week, except he was reading lines from a file.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic