Hi all,

I could be a very basic question but I am unable to find any answers on
internet.

What's the difference between "=>" and ">=" in Perl ?

To the best of my knowledge, ">=" means greater than or equal to and "=>" is
just used instead of comma to distinguish between key and values while
assigning a hash.

I am unable to justify the output of the following program (for "=>"
operator)

$ cat y.pl
#! /usr/bin/perl

use warnings;
use strict;

my $i = 6;

if ($i >= 5)
{
        print "\nInside If";
}
else
{
        print "\nInside Else";
}

print "\n===================================";

if ($i => 5)
{
        print "\nInside If";
}
else
{
        print "\nInside Else";
}

print "\n";
$ perl y.pl
Useless use of private variable in void context at y.pl line 26.

Inside If
===================================
Inside If
[EMAIL PROTECTED]:~]$


Thanks & Regards
Amit Saxena

Reply via email to