www.webdeveloper.com

Search:

Type: Posts; User: Sixtease

Page 1 of 16 1 2 3 4

Search: Search took 0.04 seconds.

  1. Replies
    4
    Views
    2,233

    You can put the module just next to the binary...

    You can put the module just next to the binary and if it's not working, you can use lib and FindBin.html
  2. Replies
    1
    Views
    460

    none. And they are both the same as $var. If you...

    none. And they are both the same as $var. If you want to access the local variable, you can use the qualified name. This means, in main script $::var and in a package Foo $Foo::var.
  3. Replies
    2
    Views
    749

    look at the REMOTE_USER http header.

    look at the REMOTE_USER http header.
  4. Replies
    3
    Views
    612

    By the way, the difference between saying $foo++...

    By the way, the difference between saying $foo++ vs ++$foo is not that ++$foo is somehow incremented sooner or "immediately". It merely means that the expression returns the original or the...
  5. Replies
    3
    Views
    612

    There's a neat module called B::Deparse, that can...

    There's a neat module called B::Deparse, that can show you how exactly the perl interpreter understands your code. I saved the code in a file called precedence.pl and called the following line and...
  6. Replies
    3
    Views
    598

    I might add that a method gets the thing that's...

    I might add that a method gets the thing that's before the arrow as its first parameter, so when calling
    NewObject->new('red','green') the "new" method will get "NewObject" as the first parameter...
  7. Replies
    3
    Views
    598

    Firstly, I believe there's a typo. The two first...

    Firstly, I believe there's a typo. The two first red lines make little sense with $myobject. I would expect the variable to be $newobject, as declared one line above.

    What the first two red lines...
  8. The whole response consists of HTTP headers and...

    The whole response consists of HTTP headers and then the HTTP body. The HTTP body is a HTML document, which consists again of HTML head and HTML body but that's another story. The headers are set...
  9. It's a content-type issue. The server says this...

    It's a content-type issue. The server says this in the HTTP headers: Content-Type: text/plain. So check where the headers are set and change the content type to text/html.
  10. Replies
    6
    Views
    2,066

    I don't get it. What do you mean if they let you?...

    I don't get it. What do you mean if they let you? It's a hosting where you have some space and you can upload whatever source code you want, no?
  11. Replies
    6
    Views
    2,066

    Why don't you install them in your storage...

    Why don't you install them in your storage yourself?
  12. Replies
    6
    Views
    2,066

    Use a module. This is a function from my app that...

    Use a module. This is a function from my app that sends mail to users:


    use Email::MIME;
    use Email::Sender::Simple;
    use Email::Sender::Transport::SMTP;

    sub _sendmail {
    my ($c, $mail) =...
  13. Replies
    1
    Views
    3,797

    Well basically you would place the script to the...

    Well basically you would place the script to the cgi-bin directory and set its execute and read permissions. Then make a HTML page with the form. The action attribute of the form should be the URL of...
  14. Replies
    4
    Views
    3,645

    Then I'd hook the deleting all invalid sessions...

    Then I'd hook the deleting all invalid sessions to requests: Whenever a request comes, before anything else is done, delete the old sessions. You may want to store the last time the check was done...
  15. Replies
    2
    Views
    2,715

    sub get_record { my $record = ; ...

    sub get_record {
    my $record = <DATA>;
    chomp $record;
    return $record
    }

    my @records_buf;
    while (my $record = get_record()) {
    push @records_buf, $record;
    if (@records >= 3)...
  16. Replies
    4
    Views
    3,645

    I would set up a cron job every minute that will...

    I would set up a cron job every minute that will delete all sessions with mod time older than 15000ms. And of course with each request, actualize the session mod time. Where is the catch? Or is there...
  17. Replies
    2
    Views
    1,962

    What? What language is this? :-) What is the...

    What? What language is this? :-) What is the relationship of the first lines (amb ...) with the line below (12-05-30 ...)?

    If you just want to extract the time (with colons stripped), and save the...
  18. Replies
    2
    Views
    1,039

    my ($before_img1, $img1, $after_img1) = $bc[2] =~...

    my ($before_img1, $img1, $after_img1) = $bc[2] =~ /(.*?)(<\s*img\b[^>]*>)(.*)/;
  19. Replies
    1
    Views
    2,281

    You can't do that with Perl. Ask Google about...

    You can't do that with Perl. Ask Google about JavaScript file system API to do that.

    Otherwise, try to follow a tutorial. Handling forms with Perl is a completely basic topic, covered a thousand...
  20. Replies
    2
    Views
    629

    You can do so using globs: my $variable =...

    You can do so using globs:


    my $variable = 'foo';
    {
    no strict 'vars';
    *$variable = sub { print "Foo!\n"; };
    }
    foo();
  21. Replies
    4
    Views
    796

    Here's how I do it: use Email::MIME; use...

    Here's how I do it:


    use Email::MIME;
    use Email::Sender::Simple;
    use Email::Sender::Transport::SMTP;
    sub _sendmail {
    my ($mail, $cfg) = @_;

    my $to = $mail->{to};
  22. Replies
    2
    Views
    524

    What you do is: for each line { add the line...

    What you do is:

    for each line { add the line to @urls; print the whole @urls array }

    Of course you end up with
    url1
    url1 url2
    url1 url2 url3

    The simplest thing were to move the printing...
  23. Replies
    5
    Views
    669

    Show me an example of the variable $user_remove...

    Show me an example of the variable $user_remove contains.

    If it has just the username (and that's the sufficient match criterion), then you can check if it's the last word on $line:

    $line =~...
  24. Replies
    5
    Views
    669

    one solution could be (assuming the users to...

    one solution could be (assuming the users to remove are in @users_remove array) to replace the loop with:
    LINE:
    foreach my $line (@file_lines) {
    foreach my $user_remove (@users_remove) {
    ...
  25. That's what you write in your regexp ^{\*+$...

    That's what you write in your regexp

    ^{\*+$
    ^: line start
    {: literal "{"
    \*: literal "*"
    +: repetition
    $: end of line
    So if there's anything else than just {******, the match fails.
Results 1 to 25 of 389
Page 1 of 16 1 2 3 4
HTML5 Development Center



Recent Articles