Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Perl/CGI problemo

Name: Anonymous 2011-11-13 1:23

@files = <data/blogs/*>;
$i=$#files;
while ($i > $#files - 5 and $i >= 0) {
    $file = @files[$i];
    open F, "$file/blogdata" or die $!;

The folders are numbered 0, 1, 2 etc... however, it can only open the first 2 and otherwise breaks without output of any kind.

Name: Anonymous 2011-11-13 1:29

The file permissions are also exactly the same for each file/folder

Name: Anonymous 2011-11-13 2:09

It doesn't work because you didn't use code tags.

Name: HAXUS THE GREAT 2011-11-13 3:12

>>3
@files = <data/blogs/*>;
$i=$#files;
while ($i > $#files - 5 and $i >= 0) {
    $file = @files[$i];
    open F, "$file/blogdata" or die $!;

The folders are numbered 0, 1, 2 etc... however, it can only open the first 2 and otherwise breaks without output of any kind.

Name: Anonymous 2011-11-13 4:36

Now you've got text in your code. Terrible!

Name: Anonymous 2011-11-13 5:29

CGI? CGI?

Welcome to the 21st century! Please join us, the water is fine!

http://perldancer.org/
http://mojolicio.us/
Or at least use plack: http://plackperl.org/

Name: Anonymous 2011-11-13 5:35

Also:
Don't use global filehandles, use lexical vars. Don't use 2 arg open.

open my $anus, '<', '/enormous/penis'

Consider using autodie, so you won't need to check the return value of open

Also, wtf is while ($i > $#files - 5 and $i >= 0)? What is that supposed to do? Why wouldn't you just iterate for(@files)?

Name: Anonymous 2011-11-13 7:23

>>6
having to download and install extra bullshite just to write some data through an HTTP socket
Yeah, the 21st century sure is great.

Name: Anonymous 2011-11-13 9:08

>>6

#!/usr/bin/env perl
use Dancer;

get '/' => sub {
    "Hello World!"
};

dance;

lol is this some Sinatra on Perls I'd hit it

Don't change these.
Name: Email:
Entire Thread Thread List