Previous Thread
Next Thread
Print Thread
Rate Thread
#102948 07/07/2001 11:30 PM
Joined: May 2001
Posts: 2,798
Member
Member
Offline
Joined: May 2001
Posts: 2,798
I was wondering...


What does

Code
code:


mean in Perl? I see it in if statements that opena some sort of file. And I have seen some other letters like that I think. Could you explain to me all the letters and what they do?

Sponsored Links
#102949 07/08/2001 1:02 AM
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
P.I.T.A. / Programmer
Offline
Joined: Sep 2000
Posts: 755
if (-e 'foo.pl') {

means "if the file foo.pl exists, then...."

You can get a list and explanation by typing

perldoc -f "-x"

at a command line

--mark


"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
#102950 07/08/2001 1:07 AM
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
like your new/old quote Mark laugh

George

George

George of the jungle...


- Allen wavey
- What Drives You?
#102951 07/08/2001 4:44 AM
Joined: May 2000
Posts: 1,356
Addict
Addict
Joined: May 2000
Posts: 1,356
... strong as he can beeee! laugh

#102952 07/08/2001 12:17 PM
Joined: May 2001
Posts: 2,798
Member
Member
Offline
Joined: May 2001
Posts: 2,798
So how exactly do I get it to work? I tried put it in a cgi file like


perldoc -f "-x"


but it didn't work. Just a server error. Is there a different way to do this?

Sponsored Links
#102953 07/08/2001 12:55 PM
Joined: May 2000
Posts: 1,356
Addict
Addict
Joined: May 2000
Posts: 1,356
you'll use that command locally :rolleyes: to get an explanation of the command.

open command prompt `terminal in linux or command in windows` and type;

perldoc -f -x

also, there must be html perl documents in your system that are installed with perl... you can read them...

#102954 07/08/2001 3:11 PM
Joined: Aug 2000
Posts: 874
Moderator / Developer
Moderator / Developer
Offline
Joined: Aug 2000
Posts: 874
common ones are:

-e (file exists)

-x (file is executeable)

-r (file can be read)

-w (file is writeable)

-d (is a directory)

#102955 07/08/2001 6:05 PM
Joined: May 2001
Posts: 2,798
Member
Member
Offline
Joined: May 2001
Posts: 2,798
Thanks jordo. I am somewhat new to this so I don't understand some stuff.

#102956 07/08/2001 8:03 PM
Joined: May 2001
Posts: 2,798
Member
Member
Offline
Joined: May 2001
Posts: 2,798
I have a question.

if (-e '/ubb/ubbcgi/ultimatebb.cgi') {

I want it to find a file thats is on the same domain but a subdomain like board.stonecrick.com ... how do I get this to work. I tried doing it with the folder name on FTP and the full address because the file that is calling this is located at http://www.stonecrick.com/file.pl


That's not the real file but ya know what I mean.

#102957 07/10/2001 11:36 AM
Joined: May 2000
Posts: 1,356
Addict
Addict
Joined: May 2000
Posts: 1,356
if the file and script are on the same account or server;

if (-e '/ubb/ubbcgi/ultimatebb.cgi') {
#do something
} else {
#do something
}

will work... if they are in different machines or accounts, the program can not find the file...

Sponsored Links
#102958 07/10/2001 11:50 AM
Joined: May 2001
Posts: 2,798
Member
Member
Offline
Joined: May 2001
Posts: 2,798
Ok, Thanks.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Nettomo
Nettomo
Germany, Bremen
Posts: 417
Joined: November 2001
Forum Statistics
Forums63
Topics37,574
Posts293,926
Members13,850
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240506)