PHP and Perl in One Script?
gbulmash asks: "Recently, I began working on a graphics project and wanted to use ImageMagick. As a PHP coder, I figured I'd use MagickWand for PHP. But after some investigation, I decided that an alpha at 0.1.8 with sparse documentation just wasn't going to be good enough for production use. I decided that PerlMagick would be a much better API, but I didn't want to code the whole project in Perl. In the end, I found a cool package for embedding Perl code in PHP scripts (with an article on its use) and it went to a 1.0.0 release, earlier this year. I think I've found my answer, but before I make a final decision and go ahead with it, I thought I'd ask the knowledgeable Slashdot crowd: Is there a better way of interfacing Perl with PHP so you can get the best of both worlds?"
So you've got Perl in your PHP, is there a way to do PHP in your Perl?
Just use the Windows Scripting Host!
Whenever I hear the word 'Innovation', I reach for my pistol.
Why didn't you use the ImageMagick extension in PECL? There's plenty of image processing options with PHP, just because MagickWand didn't work out for you, that doesn't mean you have to concoct a monstrous hybrid of PHPerl.
Bogtha Bogtha Bogtha
I love the smell of napalm in the morning. It smells like... victory.
I thought this was already publicized, Perl & PHP in one script? Isn't that just a brain fuck :)
Error 407 - No creative sig found
Instead of going with some bizarre rube-goldberg hack like this (does it even work with dynamically loadable Perl modules?), just write a separate Perl script that does what you need and receives data on standard input and gives responses on standard output. Use PHP's proc_open() function. You can even set up the Perl script as a daemon, if you like, and get higher performance.
I used this same trick to interface a binary-only executable to my PHP script. You can even use XML to pass the data back and forth, if you swing that way. I don't know how this might work on Windows, if that's what you're running on.
By the way, version numbers mean absolutely nothing except the author's opinion of his own software. In fact, the article you posted says: "the extension is still marked EXPERIMENTAL". Sounds like alpha to me.
Not to mention, this is the same guy that wrote Turck MMCache and in my testing, mmcache couldn't stay stable for more than a day or two, and would randomly return junk characters instead of output from our PHP scripts. Not exactly an author I'd trust for this kind of lower-level stuff. (Yeah, I know, there are 10 billion geeks who used MMCache on their 5-hit-per-day blog and it worked perfectly, and will not hesitate to point this out. It just didn't work for me, and other products did, sorry!)
For what it's worth, I've used "pecl-imagick-0.9.11" on my Gentoo servers to manipulate images (basically, to generate thumbnails by resizing and sharpening) and it works perfectly. I think this is different than what you're talking about. So unless you really just can't live without Perl (?), try that first.
Instead of looking at version numbers, test thoroughly.
I can't see any possibility of flamewars in this subject.
There is, alas, a reason. Much wider scope for takeup of your script. Plenty of ISPs offer a well configured PHP interpreter, but most do not offer a very wide or up to date CPAN selection.
http://uk.php.net/manual/en/function.apache-note.p hp
Hopefully you'll come to your senses first.
All the security of PHP and all the readability of Perl? It's a surefire win. I wonder why the whole world hasn't caught on to this one yet?
Slashdot - where whining about luck is the new way to make the world you want.
What if you don't like cats?
Hey, I might have found the first legit reason for using PHP!
Mathematics is made of 50 percent formulas, 50 percent proofs, and 50 percent imagination.
Do most hosting providers provide the software necessary to embed perl in php? If not, this is a non-conversation. Mine doesn't even give me a compiler, I have to beg if I want anything (or compile a static binary somewhere else.) To be fair, they were plenty responsive the one time I asked for anything.
"You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
It means you chose to use an inferior language.
"I use a Mac because I'm just better than you are."
> To be fair, they were plenty responsive the one time I asked for anything.
That's enough about butt-sex, plz stay on topic in future.
Ahhh, nothing like a good flamewar! OK, I'll bite. Tell me, please, how do you write multidimensional arrays in Perl? No, no, you are *not* allowed to use references! Or what about a multidimensional hash? Suppose I wanted to migrate from PHP to Perl, how would I translate this perfectly valid PHP code to Perl:
$x["a"]["b"]["c"] = "d";
I mean, can you do it the Perl way, with less keystrokes?
as almost always, CPAN is your friend in all things perl-related.
aside from that, i really don't understand why you'd use PHP if you're familiar enough with perl to use it.
As Iunderstand it ... Mason, a perl based web authoring kit has been used by quite a few web sites, including Amazon.
... I guess their website is just painfully slow and prone to problems.
Yeah
This space for rent. All reasonable inquiries will be entertained at proprietors discretion.
I can't see any possibility of flamewars in this subject.
Just wait until the Ruby-folks have finished their daily 4 hour circlejerk-gathering and read this.
"omg ruby has closures monads omg agile wepp too ow omg" seems to be their favourite argument in favour of their toy language.
I'm probably going to get flamed for this but have you considered using rails? Seriously, you just spend a couple of hours installing it on your development box before you discover the speed and power of rails. Then when you've used the programming equivilent of a lumphammer to sculpt your fine detailed script, you get to spend the next week looking for hosting. I do all my development on a gentoo box, it only took me a weekend to set up from stage 1. I have some great USE flags that make my RAILS development go super fast and gentoo only takes about 1.5 hours a week to maintain. Well, sometimes it takes a little longer because the QA is non-existent of late.
That's what I'd do anyway, RoR running on gentoo with some kicking USE flags. I'm developing a complete Ajax OS in my spare time using this system. It's going to revolutionize the OS market and yes, it will have use flags.
So you've got Perl in your PHP, is there a way to do PHP in your Perl?
Sure!
</joke>
That green slime had it coming.
You'd never guess it from the moronic comments here but mixing dynamic languages will be common one day, until then:
http://parrotcode.org/
http://nekovm.org/
Huh, some perl driven web apps:
http://www.slashcode.com/
http://scoop.kuro5hin.org/
I have been trolled. Hope this helps. Have a nice day.
Personally I prefer Java Servlets, with perl a second place, then python, then bash, then C, then php.
Start Running Better Polls
Throwing a couple thousand servers behind a web app solves just about any performance issue.
I know ImageMagik is the kitchen sink of image editing, but have you looked into PHP's embedded image functions? There's very few effects you couldn't produce on your own with those functions. I'll grant it's probably easier to just pass arguments to the ImageMagik library, but probably not more efficient.
Allows you to avoid the problems of calling ImageMagik, piping it through perl, then doing whatever you need to do in PHP. Sounds like a recipie for excessive server load, to me.
I'm writing a processor in RoR, wanna cooperate? :P
Send email from the afterlife! Write your e-will at Dead Man's Switch.
I am in no way an expert of programming nor web... ...but from my surfing experience, it seems like html + PHP creates very fast websides.
(And PHP can do funky things like change colours on events like mouseover etc? groovy! )
urd
I tend to use ImageMagick a lot via PHP scripts, but not with any sort of polyglot of code or anything – I just use exec("convert ... ");. It's probably not the most cross-platform way, but since I tend to do exclusively Linux/UNIX-based stuff, and most of the code is only used by me for my own sites anyway, it's not a problem at least as far as I'm concerned.
Creative misinterpretation is your friend.
I would be worried by a hosting provider that included a compiler on a production system. There is no need for one, and most *nix worms require the existance of one.
It's a basic security best practice.
Bit off-topic, but if you need those kinds of features (compilers, custom Perl modules, etc.) maybe check out one of the user-mode Linux Web hosts like Linode.com – they've been running my site for a few months, and I'd say it's probably the best thing since Al Gore invented the Interwebs :-) You get your own distribution, your own choice of server configurations... it's like a dedicated server without the dedicated server. [Not trying to sound like an advertisement or anything like that, just a very happy user recommending a useful service.]
Creative misinterpretation is your friend.
Come now, you sound like every other expert PHP programmer to me.
The fact that you had to do this:
$x->{"outer hash of references to hashes"}->{"inner hash of scalars or refs"}
Was Perl just being precise
The outer '$' sigil indicates you wish to treat the whole expression as a scalar lvalue or rvalue.
The first '->' indicates you wish to deference a scalar named 'x'.
The first '{...}' indicates you wish to treat (deferenced x) as a hash and use the lookup operator on it.
The second '->' indicates you wish to treat the return value of the lookup as a reference, and dereference that.
The inner '{...}' is the final hash lookup, which returns the scalar you wanted originally.
Incidentally, whenever you see this notation:
@array[$index]
Internally perl is really doing:
*array->[$index]
Because array is just an entry in a symbol table that is a reference (just like how arrays in C are pointers, or in Java are objects references).
But the @ notation carries additional connatations: when you use it as an lvalue it performs a shallow copy of the array in the rvalue (unlike a scalar reference assignment which only gives you a new handle to the _same_ array)... and it allows you to indicate when you want array or scalar context for functions or operators.
Anyway, at some point (last decade, *eye roll*) someone (Larry) decided that since Perl can tell what kind of reference something is before dereferencing it, that the syntatic sugar that @ and % operators get should apply everywhere (so [] and {} both deference AND lookup, all the time). So all the ->{}/->[] groups can collapse... just like in other languages.
But Perl can do this safely since it already knows what you're trying to do and won't let you do otherwise (using array lookup on a hash reference, for example).
THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
An out of date practice. If a subverted process can write a file anywhere then it can save some perl/php/shell/python/scheme/etc code to a file and call the relevant script interpreter to run it.
Erm, a non-conversation? If you want something that your host won't provide then take your money elsewhere!
Yes, but you can read the contents of "not_a_worm.pl". You can't read a compiled worm which deleted its source on first run.
How about Ruby?
The Spoon
Updated 6/28/2011
Anywayz, thanks for sharing cuz sharing is caring. LOL!
Important Stuff * Please try to keep posts on topic. * Try to reply to other people's comments instead of starting new threads. * Read other people's messages before posting your own to avoid simply duplicating what has already been said. * Use a clear subject that describes what your message is about. * Offtopic, Inflammatory, Inappropriate, Illegal, or Offensive comments might be moderated. (You can read everything, even moderated posts, by adjusting your threshold on the User Preferences Page) * If you want replies to your comments sent to you, consider logging in or creating an account Problems regarding accounts or comment posting should be sent to CowboyNeal
not to be spamy or anything, but I've compiled stuff on my dreamhost box before. They even gave me a sudo password when I asked politely. (In all fairness, I do have a dedicated server, and that might make a dfference.)
;)
And I've been with em long enough to have a good number of concerns (mostly my fault) and they were always very responsive. (And always helped me fix it.)
If you're interested, http://dreamhost.com/ or http://www.dreamhost.com/r.cgi?95192 if you feel like being nice to me
"What does slashdotting mean?"
"You've never heard of slashdot?"
"I know it makes websites not work."
Real men program in PerlHP!
The worm can unlink not_a_worm.pl after it executes perl.
The post said Perl, not PERL. The latter isn't as capable.
how to invest, a novice's guide
Why wouldn't they give you a 'sudo password' on YOUR dedicated box? Or do you mean a shared account? I'm not really sure I would want an account on a host that gives out root access willy nilly...even to those asking politely.
That said I already have a Dreamhost account, cost me $10 for a whole year for their crazy domain insane plan, so it it's almost worth it for the laughs if they turn out to be total shizzle. So far no probs though...
Not if the worm author used B::Bytecode and deleted the perl source on first run. It'd be about as hard to read as a compiled worm. It's possible that more folks have the skills to disassemble and understand perl bytecode, but I'm not confident in that.
.sig: file not found
Sadly i have to admit that i use perl & php together...
Perl's DBD for Postgresql has some issues dealing with oddly formed strings (even when properly quoted). PHP doesn't have this issue (even when the strings are unquoted). So i literally execute a php script on the CLI to perform insert operations. (The php script just reads a temporary file with the data needed to insert.)
Yes this is hokey... but it works, and i didn't want to spend another hour or two figuring out why perl was having issues.
That's like calling Commodore 64 BASIC inferior to Commodore 128 BASIC.
OK, seriously, people, use the best tool for the job, anyone who tells you otherwise is a clueless idiot.
Not every project requires the same language.
e.g. Don't spend an hour writing a C++ program when a batch file can do the job in 5 minutes.
Thank you
A. T. Roll
"Seven Deadly Sins? I thought it was a to-do list!"
and just because you can don't mean you should. It's never a good idea to mix languages on any project. Try to explain this to a programmer.
There's like ten bazillion ways to integrate PHP with Image processing tools like Image Magick just like with any other OSS language. Only more so because the PHP userbase is largest. No need to use some Hack involving Perl. Typo3 (www.typo3.org) uses Image Processing to generate Menubuttons and stuff, there are countless other PHP projects out there doing the same, and it's no sweat at all to start the imagemagick CLI tools (contvert, etc.) including parameters from PHP. 30 lines of code max I'd say. Do you homework and then ask in some PHP forums and mailinglists for sample code. You'll get answers in no time.
We suffer more in our imagination than in reality. - Seneca
Right. And of course, this means that the best way to write web applications must ALWAYS be to use Mono/JScript server side. Why? JScript is syntactically identical to ECMAScript (Javascript to you buzzwordy people).
110100 1101000 1101000 1100110 0 1101111 1101000 1100011 1
This question isn't all that relevent to the topic other than a brief mention of PHP. No hard feelings if modded off-topic.
I'm a 3D artist working in the VFX industry. Recently, I've been scripting within my 3D app. (The syntax of this language is a lot like PHP...) There are a lot of things you can do with the scripting portion of the app. You can write modeling plugins that play with the geometry. You can write shaders. You can automate tedious tasks. You can work on the RGB buffers after they've been written. Etc. There was a rumor flying around that they were going to switch from the PHP'esque syntax to Python, the justification being that they can do much more powerful things with it. I'm unfamiliar with Python, so please forgive my ignorance. I just wanted to ask: Can anybody describe in laymen's terms what this sort of change could mean towards writing better/more efficient code? I'm almost afraid to ask this question for fear of starting a PHP vs. Python war, but I'm just curious if there's a significant difference in philosophy with this language or if the company making this app is just trying to follow in the footsteps of more successful apps that already use Python.
"I like to lick butts!" by MobileTatsu-NJG (#32700246) (Score:5, Informative)
Eh. Penny Arcade is on Ruby on Rails. It is slow, prone to crashing on update days, has a fair bit of broken code...all in all, not a winning endorsement for the framework or the language and its viability for large scale deployment.
One Perl to rule them all
One C to find them
One bash to bring them all
and in PHP bind them!
110100 1101000 1101000 1100110 0 1101111 1101000 1100011 1
Actually it's more like thinking there might be a poster with a sense of humour around here.
"I use a Mac because I'm just better than you are."
Since perl is a write only language, I don't know if that's neccesarily true.
It's never a good idea to mix languages on any project.
It helps keep modules loosely coupled: write domain-functions and user-interface in different languages, and you'll find it easier to keep each funtionality where it belongs.
I have to say I used Turck MMCache on an 80 server farm serving up >4 million page loads (not hits) per day with not a single problem. This was back in the PHP4 days. Based on the load on the machines it could have easily been done with 5 but management wanted to spread the risk in an insanely large manner.
rodent...
Tactical nuclear weapons are a viable alternative!
How about Catalyst-View-PHP.
Never underestimate the dark side of the Source
PHP would be a good tool, for a black man. 97% of negros have the P-H-Pizzle chromosome, while 97% of whites use more logical languages like Perl. The difference is clear in the supremecy of the language and its symantics. I fail to see a use for calling perl code from php. Let me make a simple comparison for you, when a white man goes into a bank, it must be to invest money to maintain his supremacy. While a black man starts gatt'n nigga's to clean the place out. The difference is clear, I don't wish you to agree with me. I simply wish you to see my point of view.
White as always,
GWB
Congratulations! You found the worst of both worlds.
It's not PHP's fault. As a language it is more than capable of delivering security and stability. It just happens to not be idiot-proof while being quite idiot-accessible.
In that regard, its existence is no worse than the number of Windows machines running right now. Or for that matter, how many apps have been coded in Visual BASIC?
I've done C++, Perl and some Tomcat stuff ... On the whole, it has been more worthwhile to take the time committed to those approaches and re-apply it tightening up PHP code.
Now, that's a huge qualifier, I admit -- a lot of noobs aren't going to do commit that time.
But, I think it's not necessarily the right characterization to blame a language for empowering stupid people. It's right to blame the stupid people.
I scream. You scream. I assume that means we're both acquainted with the problem. We proceed.
Dreamhost is AWESOME! I have been with them for a couple years and they are great and always giving new features. I wouldn't run something mission-critical on a $7.95 a month plan, but for email, blogs, non-traffic heavy sites, I would use them again and again.
-A
It's dedicated, I upgraded from shared. I dont think they give out root for shared accounts. I'm not so sure I'd want that either...
I was only on the shared server for a couple months before I decided I needed more power (They don't have a specific limit on cpu minutes, but some of my stuff was hitting the box prety hard.)
Like I said though, they've always taken good care of me.
"What does slashdotting mean?"
"You've never heard of slashdot?"
"I know it makes websites not work."
Not found
Whatever it was you were looking for, it's not here. This may be due to...
* You made a typo in the URL
* What you are looking for no longer exists on CPAN
* You followed an invalid link. If this is the case, please inform the maintainer of the refering page
Why do you need them to work in the same script? Have your PHP generate an img tag that references the perl script in the src attribute. Then the web browser will fetch the image data directly from the perl script and you don't need a Frankensteinian monster.
ROFL. It's funny cuz it's true.
"Pearl and PHP DNA... just don't mix"
How are you quoting those strings? Are you using bind variables and "prepare"? If you are then its a bug in DBD.
Only if "basic security best practices" involve giving users a false sense of security.
http://outcampaign.org/
Well, that's one of its problems, but that's hardly what I'd call its main fault. Though I use it quite a bit, PHP is not an easy-to-use language if you care about correctness, robustness or security. I have a webpage that lists, in point form, some of the criticisms of PHP that I have accumulated over the last few years. The page is about PHP 4, since that's still what my customers' systems are using, but some of the criticisms apply to PHP 5 as well.
I really, really hope you're kidding. Changing colors on mouseovers (aka hover) is part of HTML, CSS, and ECMAScript. PHP is great for generating HTML/CSS/ECMAScript, but any server side language worth its CPU cycles could generate the same effects.
"it's not about aptitude, it's the way you're viewed" - Galinda
Just wondering. :-)
GD didn't support GIF files (legally) for a long time (you could always compile it in, but that meant nothing to people on shared hosting). Also, ImageMagick produced, in my opinion, better quality files at smaller sizes than GD used to.
Of course, today, with no GIF problems and the quality on both about par, there's not a lot of difference.
Our system offers a plugin based solution, use GD or ImageMagick with a single config file change. As far as calling ImageMagick from PHP goes, we just use the command execution functions.
I am NaN
I've used both PHP and Perl for web development. I'd discourage mixing PHP and Perl in the same script, it's not necessary. Sure, it can be done, but just because it can be done doesn't necessarily make it a good idea. It will make your website harder to maintain, because whoever is going to maintain your website in the future will need to know both perl and PHP (granted, they are relatively similar languages).
There is a clearly defined functional separation in this case, though. It would seem to me that you want to do your web stuff in PHP and your images in Perl. Write your image scripts in perl then; There's nothing wrong with generating in PHP. Perl people will be able to maintain your image scripts, PHP people will be able to maintain your web scripts.
Visit http://ringbreak.dnd.utwente.nl/~mrjb/growingbettersoftware to download your free copy of the book
Okay, so slashdot doesn't properly replace brackets. That sentence ought to have been "There's nothing wrong with generating in PHP".
Visit http://ringbreak.dnd.utwente.nl/~mrjb/growingbettersoftware to download your free copy of the book
And the Schrödinger Cat experiment is to write code which might be either Perl or PHP, but you don't know until you actually run it?
The Tao of math: The numbers you can count are not the real numbers.
http://blog.sykosopp.com/2006/02/26/one-file-to-ru le-them-all/
// comments, trigraphs disabled).
Embed all your languages, this file can be interpreted or compiled in 7 different coding languages:
$ php poly.sh.pl.php.tcl.cpp.bf.py.c.lhs.txt
#I'm a PHP script
$ python poly.sh.pl.php.tcl.cpp.bf.py.c.lhs.txt
I'm a Python program.
$ perl poly.sh.pl.php.tcl.cpp.bf.py.c.lhs.txt
I'm a Perl program.
$ tclsh poly.sh.pl.php.tcl.cpp.bf.py.c.lhs.txt
I'm a tcl script.
$ sh poly.sh.pl.php.tcl.cpp.bf.py.c.lhs.txt
I'm a sh script.
Rename file to compile in C/C++:
$ gcc p.c -o c;./c
I'm a C program (C89 with
$ g++ p.c -o cp;./cp
I'm a C++ program, trigraphs disabled.
Hallvar Helleseth (hallvar)
Using too many languages is bad?
Hell, then a page of mine that uses all of:
* bash
* C
* C++
* Perl
* perhaps even Python or some such (hell, I don't look under the pants of programs I call)
* sed
* grep
And as far as I know, this is not a rare practice. If it's not a CPU-critical script, bash makes for good glue code. And you can't call it hard to maintain (at least until you look at sourceless configure scripts).
The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
My understanding has always been this was a hypothetical set of attack.
None of the problems you list on your site are that extreme. In point of fact, I use almost none of them (for example, I have my own function for XML parsing, probably a leftover habit from every other language where parsing was my problem). Every language has its issues (buffer overruns, too much file system access, etc.).
I scream. You scream. I assume that means we're both acquainted with the problem. We proceed.
Sarcasm, dude.
For instance, accessing variables that are not defined returns nothing by default (most languages will throw an exception should this happen). This results in problems like this occuring.
There are plenty of easy to learn languages such as Python and Ruby out there that do not have nearly as many problems, so there is not too much of an excuse to use PHP for anything but the simplest web page. What this guy is trying to do, use PHP despite the fact that it is obviously not powerful enough for his requirements), is just wrong.
Mathematics is made of 50 percent formulas, 50 percent proofs, and 50 percent imagination.
Meet Embperl
Promote civility: mod down any post starting with 'ummm'.
It's never a good idea to mix languages on any project.
Like for example, SQL and Perl. Wait a sec...
Use the best tools for the job, sometimes multiple languages are needed.
Actually it's more like thinking there might be a poster with a sense of humour around here.
I would ask if you were new here, but your ID says otherwise.
Besides, it's a well known fact that everyone with a ID under 500,000 has had their sense of humor brutally killed by the trolls. Well, except for Taco and company, they're laughing all the way to the bank.
Fair enough.
I scream. You scream. I assume that means we're both acquainted with the problem. We proceed.
I am in the joyous position of having to maintain a monstrosity of an application that was written by at least 4 different programmers over a period of years with numerous kludges plastered on top of a highly dodgy initial design.
A lot of the early code was in Perl. Obfuscated, unreadable, indecipherable (and uncommented) Perl. So I decided to re-implement whole libraries of functions in PHP instead. But...a lot of what goes on in the application is driven by 2 Perl daemons, and they needed access to the new PHP libraries too.
So:
Day by day, the penguins steal my sanity
Yep, i setup the insert in a $dbh->prepare("INSERT INTO .... VALUES (?, ?, ?, ?);");
and then i try a $sth->execute(@values);
Only if you execute it, not if you open it up in $TEXT_EDITOR.
The worm has already written the file and called perl to interpret it long before you noticed and got there with your text editor.
See? Completely less capable.
Seriously though, I meant to link to PERL instead.
how to invest, a novice's guide
http://outcampaign.org/
Well you could use the PHthon PHP/Python bridge, then the Perlthon Python/Perl bridge.
Wasn't Parrot supposed to solve all these problems? Or was that just a sick joke that some misguided people too much too seriously?
-Don
Take a look and feel free: http://www.PieMenu.com
Thanks a lot, slashdot subject line filter. Those equal signs were suppost to be => arrows -- I didn't mean that they were equal (or ordered).
-Don
Take a look and feel free: http://www.PieMenu.com
I take issue at your vile insinuation that pure innocent peanut cups which taste so wonderful and never hurt anyone, could possibly have any poisonous PHP or Perl in them!
I throw down this gauntlet to defend the reputation of peanut butter cups! Dual at 11:00.
-The Peanut Butter Cup Monster
That @foo and $foo are entirely seperate "slots" in the symbol table as far as Perl is concerned.
But under the hood both @foo and $foo are both ARRAY refs, it's just that @foo has special copy-by-value semantics and array-context-when-lvalue-ness and other implicit connotations.
And you're right (oops), yeah that first -> is required because then you have this ambiguity:
my $foo = [1, 2, 3];
my @foo = (4, 5, 6);
print $foo[2]; ### Which foo is this?
The answer being it's always '6', and this:
$foo->[2]
Is always '3'.
THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
Personally I prefer Java Servlets, with perl a second place, then python, then bash, then C, then php.
Right now I'm trying to figure out how to migrate away from IIS (we're debating what language / configuration we're going to go with...) which is VBScript. I've got Perl books, java books, maybe even some PHP books.
I know that I'm not entirely comfortable with a move from VBScript to PHP (even though they're about equal in capabilities), plus there's the immaturity of PHP. Perl seems likely due to its maturity and I don't think I'll have a problem groking it. (I know C, C++, REXX, VB, FORTRAN, PASCAL, with exposure to half a dozen other application languages.)
But where do you start with Java Servlets? (JSP?) I know, it's a lazy question, but why JSP instead of perl?
Wolde you bothe eate your cake, and have your cake?
... we wrote it.
http://cpan.uwinnipeg.ca/dist/PHP
For your consideration: http://us3.php.net/manual/en/ref.image.php
If you would like to see a simple script which generates a graph on the fly, help yourself to this.
Yes, there are languages far more powerful than PHP. But, as I say EVERY TIME this flamewar goes down- are you sure you need them? As my grand-pappy used to say: why go deer hunting with a tank when a shotgun will do just fine?
barack to the future?
There is a php application that I've written and am still writing, and I really wish I had gone the Perl route in stead. In PHP when you hit the wall, you hit it fast and hard. The most infurating thing is when they changed default settings which broke a lot of helper libs, which were abadoned by the developers. I'm with you and now I'm converting my app to Perl and CPAN modules; no sense in developing my app, and debugging other peoples libs.
Apocalypse Cancelled, Sorry, No Ticket Refunds
Apocalypse Cancelled, Sorry, No Ticket Refunds
Well, maybe, but not anymore. Accoring to CNN, Taco is someone who "doesn't matter anymore".
How long before they let you out of the padded cell, anyway?
I remember the bad old days of shell programming. There's a reason we stopped doing that, you know. Ask the nice men in the white outfits to explain it to you if you ever go-outpatient, will you?
The only reason I can think of for a mish-mash of programming language is that you want to be the only person around who can figure it out. I have seen it done quite often in the IT industry. I personally don't agree with it, but it can be a very effective tool for making sure that you don't visit the unemployment office too often.
If that is the case, then mix in everything that you can possibly think of. XML, PHP, Perl, put in some VBScript, maybe even javascript. Learn some Flash and throw that in as well, for some video or splash screen or something. Doesn't really matter what you use it for. If you are using a database backend, and chances are good that you are, don't just use one database. Use a variety of database programs, each with one table. That way you can make tons of database connections in the code and they will all look different. It will leave them guessing for years why you did it that way. (People will usually assume that you had a reason for doing it that way, even if they can't figure out why.) Just as long as the next guy to try and work on it can't figure it out. That way, you can sit by the phone and wait for it to ring.
Now of course, if you are just trying to make an efficient streamlined program, then I would pick PERL as the language and go from there. You may find that PERL doesn't meet all your needs, and you can add in things as needed, but just keep it small. Oh, and don't forget to document everything. Chances are, that unless it is an overly easy application, you aren't going to remember everything.
1 terabyte transfer per month for 9.95.
I wonder what would happen if I signed up for 2 different hosts that advertise something like that and send a 1 gig file back and forth?
for one would i even reach the 1 terrabyte limit ?
for 2 how long till my account was shut down ?
Anyone out there tried this ?
These guys actualy talked about that sort of thing. they said that they would loose money if a customer used up their full terabyte, but that because the vast majority of their customers use far less bandwidth they still honor their word even to the few that do.
heres the quote: source: http://blog.dreamhost.com/2006/05/18/the-truth-abI have a 4 terabyte limit on my server, but I havn't ever exceded 2. I think theres only been two months where I broke 1 terabyte...
but I've never heard a single other DH customer complain about being disabled for bandwidth. (they have forums that I browse occasionaly)
"What does slashdotting mean?"
"You've never heard of slashdot?"
"I know it makes websites not work."