Perl/PHP Thread

Cromewell

Administrator
Staff member
Perl is a scripting language. It's similar to PHP, though PERL is used much more frequently used to automate command line stuff and in the networking world and used much less on the web now.

There are also lots of PERLisms where stuff works by seemingly magic, I'm not sure PERL knows how some of it works :p

Generally I'd say you could write something faster in Perl but it depends on it's complexity. Object support in Perl is kind of wacky. It's there and it works but it can be quite confusing on a first look.
 
Can I use something like visual basic to code it, or another program (no idea what you call them), and what examples could a novice like me do?
 

Cromewell

Administrator
Staff member
You can't write Perl in VB, you have to write it in PERL :)

http://www.perl.org/

If you have a linux machine it will most certainly have Perl installed or at the very least a package for it. To install it on Windows most installs I know of use Active.

You write it as you would PHP, in whatever text editor you like.
 

Ankur

Active Member
I searched a lot for this but couldn't find the solution to my problem. Maybe I couldn't search it well.

I have a folder in the server, with multiple MS word files i.e docx, doc. Basically my whole website is session based, every file upload is placed in some folder, all I want to do is this:
A user with session id "1" can access file "a1.docx"
but the file tends to be public and downloadable to everyone. Can anyone give a solution to this?
 

Cromewell

Administrator
Staff member
You might be able to fake it by storing the files in a non-public directory (i.e. outside of htdocs) and getting it via an accessor script. Just make sure your directory is read/write for your web user.
 

limited

New Member
Code:
<?php
$fp=fopen("mywork.doc","w");
$str="Hello";
fwrite($fp, $str);
fclose($fp);
?>
The above code works fine and prints hello properly, can anyone tell me how to print "Hello" in Bold or Italics or any other format?

<?php
$fp=fopen("mywork.doc","w");
$str="Hello";
fwrite($fp, $str);

echo "<b>";echo "Hello";echo "</b>";
echo "<strong>";echo "Hello";echo "</strong>";
echo "<i>";echo "Hello";echo "</i>";
echo "<em>";echo "Hello";echo "</em>";

fclose($fp);
?>
 

Cromewell

Administrator
Staff member
<?php
$fp=fopen("mywork.doc","w");
$str="Hello";
fwrite($fp, $str);

echo "<b>";echo "Hello";echo "</b>";
echo "<strong>";echo "Hello";echo "</strong>";
echo "<i>";echo "Hello";echo "</i>";
echo "<em>";echo "Hello";echo "</em>";

fclose($fp);
?>

While b/strong and I/em tags work, generally these will be done with css and a span tag now, within reason for what you are trying to do. MDN actually does an ok job with it https://developer.mozilla.org/en-US/docs/Web/HTML/Element/b
 
Top