Re: Incorrect Path or format?

2004-07-27 Thread Andrew Mellinger
To clarify what Adam is saying (I didn't understand his answer at first.) 
Yes, you are in the correct place (your home directory) but when you 
typed

/Documents/simple_print
that is a full-path.  To execute using a relative path from within your 
user's directory (which pwd showed you that youy were) you could use 
either:

Documents/simple_print
-or-
./Documents/simple_print
Notice that neither is prepended with a slash which indicates full path. 
Adams answer of using the ~ expansion works just as well.

-Andrew
On Tue, 27 Jul 2004, Adam Witney wrote:
Date: Tue, 27 Jul 2004 14:21:37 +0100
From: Adam Witney [EMAIL PROTECTED]
To: Nick Pappas [EMAIL PROTECTED], MacOS X [EMAIL PROTECTED]
Subject: Re: Incorrect Path or format?
Hi Nick,
You are trying to run a file from the Document folder on your hard disk, not
your home directory... You need to do it like this
perl ~/Documents/simple_print
Or
perl /Users/username/Documents/simple_print
But I suspect you will also need to make the file executable first, with
this command
chmod a+x  ~/Documents/simple_print
Cheers
adam

I am just learning to use Perl on OS 10.3. I am not an experienced
Unix programmer, so I am probably doing something very basically
wrong.
My first Hello World script is not executing. I created a Plain
Text script using TextEdit and saved it in my Documents folder with
the name simple_print.
In Terminal, I give a pwd command and get back the reply: /Users/username
When I type: perl /Documents/simple_print, I get the diagnostic
Can't open perl script /Documents/simple_print: No such file or directory
That seems to mean I am making some kind of mistake with the path name.
The first line in the program is: #!  /usr/bin/perl
What is wrong?

Nick

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



Re: Incorrect Path or format?

2004-07-27 Thread Doug McNutt
At 09:16 -0400 7/27/04, Nick Pappas wrote:
When I type: perl /Documents/simple_print, I get the diagnostic
Can't open perl script /Documents/simple_print: No such file or directory

Your documents folder is probably in your home directory rather than on the root.

perl $HOME/Documents/simple_print

or

cd $HOME/Documents
perl simple_print

The OS neXt GUI confuses the concept when it offers the option of saving to 
Documents.

-- 

Applescript syntax is like English spelling:
Roughly, but not thoroughly, thought through.


Re: Incorrect Path or format?

2004-07-27 Thread Jeff Lowrey
At 09:16 AM 7/27/2004, Nick Pappas wrote:
I am just learning to use Perl on OS 10.3. I am not an experienced Unix 
programmer, so I am probably doing something very basically wrong.
You'll get there.
My first Hello World script is not executing. I created a Plain Text 
script using TextEdit and saved it in my Documents folder with the name 
simple_print.

In Terminal, I give a pwd command and get back the reply: /Users/username
This is telling you that the full path to your Documents folder is actually 
/Users/username/Documents.

When I type: perl /Documents/simple_print, I get the diagnostic
Can't open perl script /Documents/simple_print: No such file or directory
Unix paths are constructed starting from a root directory.  The name of 
that root directory is /.

If you want to use a relative path, that is one that does not start from 
/, you need to indicate that you are building a relative path.   This is 
done with one of a few different characters - either ., or ~ 
usually.  ~ means Relative to my home directory, and . means 
relative to the current directory.

So you could cd to /, and then perl ~/Documents/simple_print, and that 
would be the same as perl /Users/username/Documents/simple_print.   Or 
you could cd (or not, since you're starting there) to /Users/username, and 
say perl ./Documents/simple_print.  (notice the period before the first 
slash), and that would also be equivalent to perl 
/Users/username/Documents/simple_print.

But if you were cded to somewhere else like '/etc/mail', then perl 
./Documents/simple_print would be equivalent to perl 
/etc/mail/Documents/simple_print where perl ~/Documents/simple_print 
will always be equivalent to perl /Users/username/Documents/simple_print.

-jeff lowrey
who probably is not the first or only person to answer this, and his 
message will likely show up late




Re: Incorrect Path or format?

2004-07-27 Thread Nick Pappas
Thanks for the responses - so many and so quickly.
I'm sure I'll be back with more. I am working my way up to writing a 
program that will read and store temperature information from some 
external sensors.

Nick

I am just learning to use Perl on OS 10.3. I am not an experienced 
Unix programmer, so I am probably doing something very basically 
wrong.

My first Hello World script is not executing. I created a Plain 
Text script using TextEdit and saved it in my Documents folder with 
the name simple_print.

In Terminal, I give a pwd command and get back the reply: /Users/username
When I type: perl /Documents/simple_print, I get the diagnostic
Can't open perl script /Documents/simple_print: No such file or directory
That seems to mean I am making some kind of mistake with the path name.
The first line in the program is: #!  /usr/bin/perl
What is wrong?

Nick



Re: Incorrect Path or format?

2004-07-27 Thread Nick Pappas
Unless what you're doing is OSX specific -- which would be cool, as 
the project sounds interesting, but my guess is that it's more 
generic than that -- then the Perl Beginners list might be the right 
place for this.
Yes, I'll be there as well, I just felt this question might be 
tangled up in OS X and I would get a more helpful response here.

The application is OS X based.