Perl storage question

Discuss how to write good code, break bad code, your current pet projects, or the best way to approach novel problems

Perl storage question

Post by AZ_ on Sat Jul 02, 2011 6:39 pm
([msg=59325]see Perl storage question[/msg])

How come on Windows I don't have to include the comment #!/usr/bin/perl? I can just write commands and they automatically get stored (somewhere), and execute them. Where do they get stored? If I was using a unix system, how could I change the storage place from /usr/bin/perl to something like /alpha/omega/perl?

Is that possible?
User avatar
AZ_
Poster
Poster
 
Posts: 105
Joined: Sun Jun 05, 2011 12:38 pm
Blog: View Blog (0)


Re: Perl storage question

Post by fashizzlepop on Sat Jul 02, 2011 6:52 pm
([msg=59330]see Re: Perl storage question[/msg])

The shebang line tells the terminal where to look for the Perl interpreter.
On unix:
Code: Select all
$ ./perlScript.pl
will read the file, see the shebang line and know to execute it with the Perl interpreter found at that location. You can install Perl wherever you like.

On windows, you will normally run it with:
Code: Select all
>perl perlScript.pl
which will automagically know to use the Perl interpreter to compile it. Of course, you CMD will need to know the Perl command which you would add to the environment vars if it isn't already there thanks to Strawberry Perl.

Of course in Unix, you can initiate it like the windows version and this will allow you to omit the shebang line.

shebang eq #!/usr/bin/Perl

As for your "storage" confusion, I'm not sure what you mean.
The glass is neither half-full nor half-empty; it's merely twice as big as it needs to be.
User avatar
fashizzlepop
Developer
Developer
 
Posts: 2304
Joined: Sat May 24, 2008 1:20 pm
Blog: View Blog (0)



Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests