Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

perl newbie and activeperl

by markrydenfan81 (Initiate)
on May 01, 2007 at 02:05 UTC ( [id://612902]=perlquestion: print w/replies, xml ) Need Help??

markrydenfan81 has asked for the wisdom of the Perl Monks concerning the following question:

I installed Active Perl I believe. I opened up command prompt and typed perl example.pl and it gave me can't open, no such file or directory. I am not very good with dos though. I can't seem to switch to the perl folder.

Replies are listed 'Best First'.
Re: perl newbie and activeperl
by Popcorn Dave (Abbot) on May 01, 2007 at 02:58 UTC
    You would probably best be served by getting a text editor that allows you to run your programs from the editor. Personally I use ConText - syntax highlighting and it's free, plus it lets you set up the function keys to run your Perl programs and lets you see the text output in the bottom window - but there are many others to choose from. Search on here and you'll get many opinions.

    That said, the short answer is use the cd command to change to the directory your program is in, and in addition make sure that Perl is in your path - ActiveState should have done that for you I believe. That should do the trick.

    Since you're not that good with DOS you'd be best to do a Google search for DOS commands or a DOS tutorial.

    Good luck!

    Revolution. Today, 3 O'Clock. Meet behind the monkey bars.

    I would love to change the world, but they won't give me the source code

Re: perl newbie and activeperl
by syphilis (Archbishop) on May 01, 2007 at 04:04 UTC
    Hi,
    The good news is that perl is being found (or you would have got a different error). For the command you gave to work you need to cd the folder that contains example.pl. As regards finding your way around the shell, Googling for DOS commands turns up some useful links. Here's one such link The information you need will also be accessible under windows Help (try topics involving the term "command line") - but it might take some digging up.

    Once you know the name of a command you can also get info about it by typing 'command /?' at the command prompt. For example try running chdir /?

    Cheers,
    Rob
Re: perl newbie and activeperl
by robot_tourist (Hermit) on May 01, 2007 at 08:41 UTC

    I am not very good with dos though. I can't seem to switch to the perl folder.

    As a previous monk suggested, you do not need to go to the perl folder, you need to go to the folder where your perl script is, in your case where example.pl is. I like to think I am good with the Windows command line, but here's a tool I love: Command Prompt Here.

    Create a new notepad file on your desktop (call it cmdhere.reg or something), put the text from the link in it as per the instructions there, save it, close it, double-click it and click OK to merge it into your registry. Then you can use Windows Explorer to find your perl script and then simply right-click on the folder your script is in to open up a command prompt window where the prompt is already at your script's folder!

    How can you feel when you're made of steel? I am made of steel. I am the Robot Tourist.
    Robot Tourist, by Ten Benson

Re: perl newbie and activeperl
by ww (Archbishop) on May 01, 2007 at 18:30 UTC
    Not to discourage you, but your comment that you are "not very good with dos" gives me great concern about the likelihood of success in doing anything very interesting with Perl. (This observation is null and void where prohibited AND/OR where you are just using a windows box because it's available but are already expert with some other Operating System/Command Line Interface :-)

    Much of what you're likely to want to do with Perl will be greatly facilitated by understanding your OS. I don't mean to suggest that you have to become a Kernel wizard or a guru on the internals of DOS or Windows (and by the way, since W2K, the Windows offers its CLI via cmd.exe... which has some semi-significant variance from command.com, the interface to the earlier DOS prompt).

    But, IMO, in parallel with your early experimentation with perl, you will be very well served by making the effort to "get good" with your operating system, because the strengths of Perl become especially obvious when you learn how easily you can do jobs that would be difficult or impossible (for any given level of skill) from windows, itself.

    That said, welcome to the Monastery... and fair winds on your quest.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://612902]
Approved by GrandFather
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2025-03-21 20:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When you first encountered Perl, which feature amazed you the most?










    Results (63 votes). Check out past polls.