For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > August 2007 > RE: Error in executing the script









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RE: Error in executing the script
Bob McConnell

2007-08-06, 6:59 pm

Remove the tab or spaces before the EOT label. It must be the only thing
on that line.

Bob McConnell

> -----Original Message-----
> From: Sayed, Irfan (Irfan) [mailto:isayed@avaya.com]=20
> Sent: Monday, August 06, 2007 11:03 AM
> To: beginners@perl.org
> Subject: Error in executing the script
>=20
> Hi All,
> =20
> I have following script
> =20
> #!/usr/atria/bin/Perl
> use strict;
> use warnings;
>=20
> # Subroutine prototypes
> join_proj();
> rebase();
> deliver();
> quit();
> =20
> # Define the actions to take
> my %action_to_take =3D (
> '1' =3D> \&join_proj,
> '2' =3D> \&rebase,
> '3' =3D> \&deliver,
> '4' =3D> \&quit,
> );
> =20
> # Print the menu selection
> print <<"EOT";
> Select one of:
> 1. Join the project
> 2. Rebase
> 3. Deliver
> 4: quit
> EOT
> =20
> # Get the user's input
> my $menu_item =3D <>;
> chomp($menu_item);
> =20
> # Take action based on the user's choice
> if (defined $action_to_take{$menu_item}) {
> $action_to_take{$menu_item}->();
> } else {
> print "I didn't understand the command.\n";
> do_exit();
> }
> =20
> exit 0;
> =20
> #-------------------------------------------------------------
> sub join_proj() {
> print "Joining Project\n";
> return;
> }
> =20
> sub rebase() {
> print "rebasing\n";
> return;
> }
> =20
> sub deliver() {
> print "delivering...\n";
> return;
> }
> sub quit() {
> print "Exiting\n";
> return;
> }
> =20
> I am getting following error.
> =20
> Can't find string terminator "EOT" anywhere before EOF at=20
> merge.pl line
> 29
> =20
> Can somebody please help
> =20
> Regards
> Irfan.
> =20
> =20
> =20
>=20
>=20
>=20

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com