Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl in comparison to using ASP? 4

Status
Not open for further replies.

garymgordon

Programmer
Joined
Apr 5, 2000
Messages
307
Location
US
I was just curious ... if most of what some people do in ASP could be done by using Perl ... or isn't that possible?

I was also curious of the differences in trying to use Perl to work in a similar fashion to ASP. Or, should I also consider learning ASP when I can?

Basically, ... can Perl do what ASP can?

What's the story?

:-)

Thanks!
Gary
Gary M. Gordon, LLC
webmaster@garymgordon.com
Certified Web Developer ::
Application Programmer
 
Let me also add ... that I had a project that needed help with on an NT server. ASP was recommended to solve the problem but I was curious if Perl could have been used .. or if Perl is limited on an NT server (with IIS) ? The project was basically to create an index.html file (which we eventually did in a default.asp file) to look at the files and subdirectories within that folder and then display them in the browser .. and making the links to those files and other sub folders ..linkable.

Anyhow .. what limitations (if any) would I have in trying to user Perl on an NT server - that I wouldn't have using ASP? And, would PHP then act the same way as ASP.

Sorry for my confusion, but I'm just looking for some advice from those who know. (And, I know you're out there.)
hahaha

Thanks again,
Gary
Gary M. Gordon, LLC
webmaster@garymgordon.com
Certified Web Developer ::
Application Programmer
 
to the extent of my knowledge, everything that is computably possible is possible with perl. running with NT and IIS, you will have disadvantages, but none that are too malevolent. one difference for sure would be in speed, and the only real solution to this is Apache/mod_perl. also, as ASP was specifically designed for the task of cgi programming, it may be easier to accomplish some tasks. this is trivial, as the judicious use of a module or two will more than compensate for this (however, at a potential loss of speed). other than those, i really can't think of anything that might have the power to stop you from doing any given project (assuming the project is possible to begin with). "If you think you're too small to make a difference, try spending a night in a closed tent with a mosquito."
 
I am using alot of perl on an NT web server (IIS), and I have been able to do something similar to your default.asp, only with perl. It hasn't been too difficult from the point of view of getting information on NT oriented modules and the like, and like perl anywhere else; it has been reliable.
BUT I don't know much ASP, or other MS technologies like VB etc. so I can't really comment about that, but as far as I know everything you can do with ASP can be done with perl.
 
Jez,

I was just curious. You said that "I have been able to do something similar to your default.asp". With that being said, I was curious if you'd be willing to share with me what code was used and required to accomplish the same task in Perl - as it was in ASP.

I hope you don't mind my asking, but I'd love to look and compare the differences in what would be used in Perl vs ASP to accomplish this.

Thanks,
Gary

(If you want, you can email it to me at webmaster@garymgordon.com)

THANKS!!

PS: Just another note regarding NT ... I just had to set up (on NT) the Outlook Team Folders (which runs with Exchange Server) and it (for what ever reason) didn't want to upload via FTP onto my UNIX server, but had no problem with the NT server. I wasn't sure if (and I am assuming that you haven't) had any experience with this Outlook Team Folder stuff by MS. :-) haha Just another MS thing I guess.

Gary M. Gordon, LLC
webmaster@garymgordon.com
Certified Web Developer ::
Application Programmer
 
Well, let's not forget the next generation of ASP, ASP+.

Disclaimer: I am not trying to start a Pepsi/Coke argument.

ASP+, interestingly enough, will be able to parse Perl. I'm not yet sure how I feel about that, because it's soo double edged, being a fan of Perl.

Anyway, I am bordering on that argument... Just wanted to throw that out there "Absorb what is useful, discard what is not. Add what is uniquely your own." - Bruce Lee - The Tao of Jeet Kune Do
 
That script would actually be quite easy to do in perl, you would just save the folder's file names to an array and print them all out, you could even change the icons next to them (like on the Apache webserver) using search patterns. - Ben Russell
- President of Intracor Technologies (
 
Ben,

Would you mind helping me by creating the script I would need to use to do this? I hate to ask, but I don't know enough about Perl yet to actually write it.

If you can't I'll understand.

Just let me know if you could. Thanks!

Gary
Gary M. Gordon, LLC
webmaster@garymgordon.com
Certified Web Developer ::
Application Programmer
 
Gary,
Did you get the code I emailed you??

I have also this week been doing a more simple directory listing type script for indivual sections of a web site.
Again it's on NT, but that hasn't been a problem.
Basically I have got a directory listing and used grep to get rid of the . and .. files.
Then for each file in a specified directory (which are directories themselves) I have built the path in the script and then gone into each of those directories and accessed an index file (plain text), and got additional info for display from there.

The result is a page that is always up to date and lists different folder names (each in this case is a group of people), and what is contained within that folder i.e. various documents relating to these groups of people.
The main need for the index file is just to add extra text and information that isn't available from the system i.e. group name, main contact etc.
I've put some of the code below;-

opendir(MDS, $startpath) || die "Cannot open $startpath: $!\n";
@dirs=grep(!/^\.\.?$/, readdir MDS);
closedir(MDS);

#you now have an array with the contents of the file.

foreach $files(@dirs) {
$inform = $startpath . $files . $slash . $indexfile;
#print $inform;
open (FIL, $inform) || die "Cannot open data file: $!\n";
@indat = <FIL>;
close FIL;
push (@datafil, [@indat]);

# by now you have all the info from all the index files in a 2 level array and you just loop through printing to the screen.
e.g.
for ($i=0;$i<@datafil;$i++) {
$title = $datafil[$i][0];
print $title;
}


I have had very few problems doing this, and the whole script and a couple of supporting ones run in each frame of a three frame set, with no performance complaints.
The folder of groups contains about 30-50 folders with 10-20 supporting docs each and 20ish lines of text in each index file.

Hope this helps.

Also, since I don't know much ASP, is this kind of thing as easy in ASP?? and also this method requires an index file that is maintained manually for each folder.
Could this index stuff be done using MS index server??

Jez

:-)
 
jez,

I didn't get your email :(

If you could re-email it ... that would be great.

webmaster@garymgordon.com

But I guess my question is ... what do I do with the script you wrote above and how do I specifically implement it.

If you'd rather email it to me, that would be fine.

Thanks a lot!!!!

Gary
Gary M. Gordon, LLC
webmaster@garymgordon.com
Certified Web Developer ::
Application Programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top