|
Joined: May 2001
Posts: 2,798
Member
|
Member
Joined: May 2001
Posts: 2,798 |
I was wondering... What does 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?
|
|
|
|
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
|
P.I.T.A. / Programmer
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
|
|
|
|
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 George George George of the jungle...
|
|
|
|
Joined: May 2000
Posts: 1,356
Addict
|
Addict
Joined: May 2000
Posts: 1,356 |
... strong as he can beeee!
|
|
|
|
Joined: May 2001
Posts: 2,798
Member
|
Member
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?
|
|
|
|
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...
|
|
|
|
Joined: Aug 2000
Posts: 874
Moderator / Developer
|
Moderator / Developer
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)
|
|
|
|
Joined: May 2001
Posts: 2,798
Member
|
Member
Joined: May 2001
Posts: 2,798 |
Thanks jordo. I am somewhat new to this so I don't understand some stuff.
|
|
|
|
Joined: May 2001
Posts: 2,798
Member
|
Member
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.
|
|
|
|
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...
|
|
|
|
Joined: May 2001
Posts: 2,798
Member
|
Member
Joined: May 2001
Posts: 2,798 |
|
|
|
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.
|
|
Posts: 417
Joined: November 2001
|
|
Forums63
Topics37,574
Posts293,926
Members13,850
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|