Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Zombywuf
Mar 29, 2008

genericadmin posted:

... Plus it adds to module dependency hell. For example, to install Catalyst you basically become a CPAN mirror... it's horrible.

So install ACME::Everything. Problem solved :-)

Perl may have some weirdness, but are there any other languages in which this even possible?

Adbot
ADBOT LOVES YOU

Zombywuf
Mar 29, 2008

re: Frameworks

What about CGI::Application?

Zombywuf
Mar 29, 2008

I find your requirements strange and disturbing.

But hey, whatever floats your boat.

Zombywuf
Mar 29, 2008

TiMBuS posted:

fastCGI, url->handler mapping and the ability to delegate tasks over multiple files/namespaces are strange and disturbing requirements?

I looked up fastCGI, and all I found was something claiming to be faster than Netscape 1.1. Assuming this is the fastCGI you're thinking of, why not just use mod_perl? I have no idea if fastCGI is any good, but that site rings my BS meter up to 10.

Also, imports with long names?

Zombywuf
Mar 29, 2008

TiMBuS posted:

So to answer your question "why not just use mod_perl?" more directly:
Because fcgi is better.
Fair enough, fastcgi.org could do with some serious work then.

quote:

CGI::Application::Plugin::AutoRunmode::FileDelegate

The question mark was meant to imply "so what?" It fits on one line of a standard 80 column terminal.

Zombywuf
Mar 29, 2008

TiMBuS posted:

You mean because the 'official' CGI spec site is so much better? Or perhaps the SCGI page better tickles your fancy?

It doesn't have an article about being faster than Netscape 1.1 though.

quote:

However the length itself does get on my nerves too. Have you seen the synopsis for it?
code:
package MyApp;
use base 'CGI::Application';
use CGI::Application::Plugin::AutoRunmode 
        qw [ cgiapp_prerun];
use CGI::Application::Plugin::AutoRunmode::FileDelegate();
        
        sub setup{
                my ($self) = @_;
                my $delegate = new CGI::Application::Plugin::AutoRunmode::FileDelegate
                        ('/path/to/runmodes')
                $self->param('::Plugin::AutoRunmode::delegate' => $delegate);
        }
Jesus.

Yeah that's pretty bad, url rewriting would be simpler.

Zombywuf
Mar 29, 2008

TiMBuS posted:

URL rewriting has nothing to do with separating 'run modes' into multiple files.

Troll elsewhere, I came here for advice from people who knew what they were talking about (thanks, genericadmin). I didn't post here to get replies I could have just gotten from 7chan.

FFS, who pissed in your cornflakes?

You seemed to be asking how to get a restfull interface out of a single cgi app without throwing files all over the place, if that's not what you were after then I was answering the wrong question.

However if it were, url rewriting would be one way to do it.

The wrong way.

Allow me to quote from the mod_rewrite docs

mod_rewrite docs posted:

The great thing about mod_rewrite is it gives you all the configurability and flexibility of Sendmail. The downside to mod_rewrite is that it gives you all the configurability and flexibility of Sendmail.''
-- Brian Behlendorf

I hope this puts things into perspective.

Zombywuf
Mar 29, 2008

Looks like you're confusing the Perl parser. Try adding some whitespace, if nothing else, just for readability's sake.

Zombywuf
Mar 29, 2008

6174 posted:

I just tried maybe a dozen variations of adding whitespace at various locations (including whitespace around every operator) and the same error occurred.

This being the source (the parser being confused) would also be confusing to me because the line worked just fine from the script I copied it from (which roughly takes the same input format and outputs yet another different format).

Also for the record, these scripts weren't things I wrote initially, I just need to change a formula here and there.

The problem with the Perl parser is that certain parts of the syntax (regexes mostly) can sometimes only be interpreted by looking ahead in the code.

Generally its / that confuse it, does line 75 contain any /s? Also, what's the error you're getting?

Zombywuf
Mar 29, 2008

6174 posted:

Also line 3 is "use Switch;"

I suspect your problem lies there, Switch will be doing weird things to your syntax tree to add more syntax into Perl. It's a bit of a pain, but you're safer with elsif.

Zombywuf
Mar 29, 2008

TiMBuS posted:

One day it'll be out.

/me lights a candle at his alter of Larry and chants the sacred runes

$@%*
$@&*
$@%*
...

Zombywuf
Mar 29, 2008

Strict 9 posted:

Regex question: How the hell do I remove weird ASCII characters? Like upside-down question marks. I've tried a copy and paste, and that doesn't work. I've tried "\xBF", which is the hex code, and that doesn't work either. It just won't match the drat things.

Upside down question marks are not ASCII. Why do you need to remove them? Usually when I've seen code that does this kind of thing, it's doing something wrong.

Adbot
ADBOT LOVES YOU

Zombywuf
Mar 29, 2008

yaoi prophet posted:

The "upside down question mark" is probably your editor/terminal/whatever program's way of indicating that there is an unsupported character of some sort there (wide unicode character in a terminal expecting 7bit ASCII or latin-1). You should examine the data in hex and see what it really is, it may be iso-8859 of some form, or unicode.

Unicode is not a character encoding.

  • Locked thread