Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] Possibly off topic question

Expand Messages
  • Jenda Krynicky
    From: Luinrandir Hernsen ... PHP is just another programming language. ... Server side. PHP is usualy (if not always) included
    Message 1 of 3 , Sep 22, 2004
    • 0 Attachment
      From: "Luinrandir Hernsen" <Luinrandir@...>
      > What is PHP and how does it relate to perl?

      PHP is just another programming language.

      > Is PHP a server side or client side code?

      Server side. PHP is usualy (if not always) included inside HTML
      somewhat like this

      <title>Now it's <%= localtime %></title>

      (I said somewhat. I'm not sure what delimiters does PHP use and
      whether it does have a localtime() function.)

      > I was told by another party to use scanf, printf and fseek
      > in perl.... but rom my preliminary research, they seem to be PHP
      > code...

      printf does exist in Perl, instead of fseek() we have just seek(),
      there is no scanf() in Perl. (Except maybe defined in a module. I
      never felt the need to look for it.)

      > I'm all the heck corn-fused!

      ?

      > Oh.. and how am I curently save stuff to file?

      You can either use print() or printf(). You have to open the file
      first:

      use strict;
      open my $FH, '>', $filename
      or die "Can't write to $filename: $!\n";

      This creates a new lexical filehandle $FH and opens the $filename for
      writing. If the opening fails the script will print a message and
      exit.

      Then you can print into the filehandle

      print $FH "Hello, this goes into the file.\n";

      my $code = 7;
      printf $FH "The code is %04d.\n", $code;

      And when done with the file you just close it:

      close $FH;

      Anyway I think you'd better get yourself a decent book. Learning Perl
      5 is supposed to be a good one.

      Jenda
      ===== Jenda@... === http://Jenda.Krynicky.cz =====
      When it comes to wine, women and song, wizards are allowed
      to get drunk and croon as much as they like.
      -- Terry Pratchett in Sourcery
    Your message has been successfully submitted and would be delivered to recipients shortly.