Home Accessibility Courses Twitter The Mouth Facebook Resources Site Map About Us Contact
 
Python and Tcl - public course schedule [here]
Private courses on your site - see [here]
Please ask about maintenance training for Perl, PHP, Lua, etc
 
-> , >= and => in Perl

Yes, Perl is eclectic - lots of things it can do, taken from lots of places and so, yes, it does have all three of those operators!

-> Run the method named to the right on the object named on the left

>= Return 1 (a true value) if the expression to the left is numerically greater than the expression to the right

=> Normally used to indicate a key, value pair for entry into a hash. In fact, the => operator is the equivalent of a , (a comma) which can be used instead - the=> is just provided to make the your code easier to read, and (in some circumstances) saves you the need to quote keys.

Examples:
$kgs = $current->getweight();
# Get the weight of the $current object

print "heavy\n" if ($kgs >= 100);
# Print out if $kgs is numerically 100 or greater

%info = (weight => 120, height => 1850);
# Set a hash with 2 key, value pairs

(written 2006-11-18)

 
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
P204 - Perl - Conditionals and Loops
  [4323] Learning to program - Loop statements such as while - (2014-11-22)
  [4322] Learning to Program - the conditional statement (if) - (2014-11-21)
  [4031] Showing what programming errors look like - web site pitfall - (2013-03-06)
  [3895] Flowchart to program - learning to program with Well House - (2012-10-14)
  [3397] Does a for loop evaluate its end condition once, or on every iteration? - (2011-08-18)
  [3004] Increment operators for counting - Perl, PHP, C and others - (2010-10-18)
  [2832] Are you learning Perl? Some more examples for you! - (2010-06-27)
  [2711] For loop - checked once, or evety time? Ruby v Perl comparison and contrast - (2010-04-07)
  [2550] Do not copy and paste code - there are much better ways - (2009-12-26)
  [2351] Ternary operators alternatives - Perl and Lua lazy operators - (2009-08-12)
  [1727] Equality and looks like tests - Perl - (2008-07-29)
  [1696] Saying NOT in Perl, PHP, Python, Lua ... - (2008-07-04)
  [1607] Learning to program in Perl - (2008-04-11)
  [1477] Decisions - small ones, or big ones? - (2007-12-18)
  [1468] Lexical v Arithemetic testing, Bash and Perl - (2007-12-11)
  [1191] Smart English Output - via PHP and Perl ? : operator - (2007-05-18)
  [353] Wimbledon Neck - (2005-06-20)

P211 - Perl - Hashes
  [3662] Finding all the unique lines in a file, using Python or Perl - (2012-03-20)
  [3451] Why would you want to use a Perl hash? - (2011-09-20)
  [3400] $ is atomic and % and @ are molecular - Perl - (2011-08-20)
  [3106] Buckets - (2010-12-26)
  [3072] Finding elements common to many lists / arrays - (2010-11-26)
  [3042] Least Common Ancestor - what is it, and a Least Common Ancestor algorithm implemented in Perl - (2010-11-11)
  [2920] Sorting - naturally, or into a different order - (2010-08-14)
  [2915] Looking up a value by key - associative arrays / Hashes / Dictionaries - (2010-08-11)
  [2836] Perl - the duplicate key problem explained, and solutions offered - (2010-06-28)
  [2833] Fresh Perl Teaching Examples - part 2 of 3 - (2010-06-27)
  [1917] Out of memory during array extend - Perl - (2008-12-02)
  [1856] A few of my favourite things - (2008-10-26)
  [1826] Perl - Subs, Chop v Chomp, => v , - (2008-10-08)
  [1705] Environment variables in Perl / use Env - (2008-07-11)
  [1334] Stable sorting - Tcl, Perl and others - (2007-09-06)
  [968] Perl - a list or a hash? - (2006-12-06)
  [738] (Perl) Callbacks - what are they? - (2006-05-30)
  [386] What is a callback? - (2005-07-22)
  [240] Conventional restraints removed - (2005-03-09)

P218 - Perl - More Objects
  [4366] Changing what operators do on objects - a comparison across different programming languages - (2014-12-26)
  [4356] Object factories in C++, Python, PHP and Perl - (2014-12-19)
  [4098] Using object orientation for non-physical objects - (2013-05-22)
  [4096] Perl design patterns example - (2013-05-20)
  [3941] Building an object based on another object in Perl - (2012-12-03)
  [3581] Perl - calls to methods that use => - what do they mean? - (2012-01-16)
  [3377] What do I mean when I add things in Perl? - (2011-08-02)
  [3098] Learning Object Orientation in Perl through bananas and perhaps Moose - (2010-12-21)
  [3097] Making Perl class definitions more conventional and shorter - (2010-12-20)
  [2972] Some more advanced Perl examples from a recent course - (2010-09-27)
  [2876] Different perl examples - some corners I rarely explore - (2010-07-18)
  [2811] Igloos melt in the summer, but houses do not - (2010-06-15)
  [2717] The Multiple Inheritance Conundrum, interfaces and mixins - (2010-04-11)
  [2651] Calculation within objects - early, last minute, or cached? - (2010-02-26)
  [2427] Operator overloading - redefining addition and other Perl tricks - (2009-09-27)
  [1949] Nuclear Physics comes to our web site - (2008-12-17)
  [1819] Calling base class constructors - (2008-10-03)
  [1665] Factory method example - Perl - (2008-06-04)
  [1664] Example of OO in Perl - (2008-06-03)
  [1435] Object Oriented Programming in Perl - Course - (2007-11-18)
  [1320] Perl for Larger Projects - Object Oriented Perl - (2007-08-25)
  [1217] What are factory and singleton classes? - (2007-06-04)
  [831] Comparison of Object Oriented Philosophy - Python, Java, C++, Perl - (2006-08-13)
  [656] Think about your design even if you don't use full UML - (2006-03-24)
  [592] NOT Gone phishing - (2006-02-05)
  [588] Changing @INC - where Perl loads its modules - (2006-02-02)
  [531] Packages in packages in Perl - (2005-12-16)
  [246] When to bless a Perl variable - (2005-03-15)
  [227] Bellringing and Programming and Objects and Perl - (2005-02-25)


Back to
Presenting Melksham - for a weekend away in Wiltshire
Previous and next
or
Horse's mouth home
Forward to
Before and After - Well House Manor
Some other Articles
Clustering, load balancing, mod_rewrite and mod_proxy
Course Joining package - updated
A tale of a wee wall
Before and After - Well House Manor
-> , >= and => in Perl
Presenting Melksham - for a weekend away in Wiltshire
C++ and Perl - why did they do it THAT way?
Hotel door furniture
Training rooms to learn Open Source programming
C++ - just beyond the basics. More you can do
4759 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96 at 50 posts per page


This is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price.

Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2019: 404 The Spa • Melksham, Wiltshire • United Kingdom • SN12 6QL
PH: 01225 708225 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/mouth/930_-and-in-Perl.html • PAGE BUILT: Sat May 27 16:49:10 2017 • BUILD SYSTEM: WomanWithCat