Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

syntax error

Posted on 2002-03-03
3
Medium Priority
?
149 Views
Last Modified: 2010-03-05
What wrong in this code ?

use File::Copy;
move("c:/a.a","c:/a.done")
         or {
             print("1st msg\n");
             print("2nd msg\n");
         }
0
Comment
Question by:addady
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 16

Expert Comment

by:maneshr
ID: 6837860
addady,

"..What wrong in this code ?.."

What exactly does/does not happen?

Do you get an error? Please provide more details.

This will help you get a more accurate answer, faster.
0
 
LVL 16

Expert Comment

by:maneshr
ID: 6837864
addady,

Meanwhile, try this variation of your code.

use File::Copy;

if (!(move("c:/a.a","c:/a.done"))){
  print("1st msg\n");
  print("2nd msg\n");
}

Let me know how it goes.
0
 
LVL 1

Accepted Solution

by:
japhyRPI earned 200 total points
ID: 6838163
What's wrong is that the "or" operator requires two EXPRessions.  A BLOCK is not an EXPRession; your code has

  {
    print ...;
    print ...;
  }

which is a BLOCK.  You can use the 'do' keyword to make that BLOCK an EXPRession:

  move("C:/a.a" => "C:/a.done") or do {
    print ...;
    print ...;
  };
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question