I wrote the Perl
module to get the user name from the user through <stdin>
and print it as like below,
use strict;
use warnings;
{
package Insert;
sub Insert_DATA
{
my $User_Name;
print "Please Enter the User Name: ";
chomp ( $User_Name = <stdin> );
print $User_Name , "\n";
}
}
return 1;
But when I executed this code, It gives the error like this,
readline() on unopened filehandle stdin at Insert_Data.pm line 26.
Use of uninitialized value $User_Name in chomp at Insert_Data.pm line 26.
Use of uninitialized value $User_Name in print at Insert_Data.pm line 27.
So please help to solve this problem.
Thanks.