• Perl Question

    From Avon@21:1/101 to All on Sunday, March 15, 2020 19:11:15
    else{
    my($sec,$min,$hour,$mday,$mon,$year) = localtime(time);
    $sn = sprintf("%04d%02d%02d%02d", $year + 1900, $mon + 1, $mday, 1)
    }

    I am trying to get $sn to print but suspect something in this code is amiss?

    Any thoughts?

    --- Mystic BBS v1.12 A46 2020/03/12 (Windows/32)
    * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (21:1/101)
  • From Netsurge@21:4/154 to Avon on Sunday, March 15, 2020 08:27:36
    else{
    my($sec,$min,$hour,$mday,$mon,$year) = localtime(time);
    $sn = sprintf("%04d%02d%02d%02d", $year + 1900, $mon + 1, $mday, 1)
    }

    I am trying to get $sn to print but suspect something in this code is amiss?

    You are missing a ";" at the end of the $sn statement, so it should read:

    }else{
    my($sec,$min,$hour,$mday,$mon,$year) = localtime(time);
    $sn = sprintf("%04d%02d%02d%02d", $year + 1900, $mon + 1, $mday, 1);
    }

    |15frank |08// |15netsurge
    |07disksh0p|08!|07bbs |08% |07bbs.diskshop.ca |08% |07mystic goodness |11SciNet |03ftn hq |08% |07https://scinet-ftn.org

    --- Mystic BBS v1.12 A45 2020/02/18 (Linux/64)
    * Origin: % disksh0p!bbs % bbs.diskshop.ca % SciNet ftn hq % (21:4/154)
  • From Spectre@21:3/101 to Avon on Sunday, March 15, 2020 21:31:00
    I am trying to get $sn to print but suspect something in this code is amiss?

    my($sec,$min,$hour,$mday,$mon,$year) = localtime(time); $sn = sprintf("%04d%02d%02d%02d", $year + 1900, $mon + 1, $mday, 1) }

    My perl is.... well that good... but I'm going to hazard a guess you're
    trying to assign the output of the sprintf, but you need to tell it to
    evaluate the expression otherwise it'll just go and assign that lot as a massive string starting with sprintf?

    Spec

    *** THE READER V4.50 [freeware]

    --- SuperBBS v1.17-3 (Eval)
    * Origin: Scrawled in haste at The Lower Planes (21:3/101)
  • From Avon@21:1/101 to Netsurge on Monday, March 16, 2020 13:08:14
    On 15 Mar 2020 at 08:27a, Netsurge pondered and said...

    You are missing a ";" at the end of the $sn statement, so it should read:

    }else{
    my($sec,$min,$hour,$mday,$mon,$year) = localtime(time);
    $sn = sprintf("%04d%02d%02d%02d", $year + 1900, $mon + 1, $mday, 1);
    }

    I thought that also but still could not get $sn to print in the text file the script generates. There's an earlier 'my' declaration of $sn further up the script that if I state a value like 'my $sn=55555;' and then run the script
    it prints the value but for some reason that's the only way I can get the serial generated number to show.

    --- Mystic BBS v1.12 A46 2020/03/12 (Windows/32)
    * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (21:1/101)
  • From tenser@21:1/101 to Avon on Monday, March 16, 2020 13:10:26
    On 16 Mar 2020 at 01:08p, Avon pondered and said...

    On 15 Mar 2020 at 08:27a, Netsurge pondered and said...

    You are missing a ";" at the end of the $sn statement, so it should r

    }else{
    my($sec,$min,$hour,$mday,$mon,$year) = localtime(time);
    $sn = sprintf("%04d%02d%02d%02d", $year + 1900, $mon + 1, $mday, 1) }

    I thought that also but still could not get $sn to print in the text
    file the script generates. There's an earlier 'my' declaration of $sn further up the script that if I state a value like 'my $sn=55555;' and then run the script it prints the value but for some reason that's the only way I can get the serial generated number to show.

    Can you post the whole script somewhere?

    --- Mystic BBS v1.12 A46 2020/03/12 (Windows/32)
    * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (21:1/101)
  • From Avon@21:1/101 to Spectre on Monday, March 16, 2020 13:10:26
    On 15 Mar 2020 at 09:31p, Spectre pondered and said...

    my($sec,$min,$hour,$mday,$mon,$year) = localtime(time); $sn = sprintf("%04d%02d%02d%02d", $year + 1900, $mon + 1, $mday, 1) }

    My perl is.... well that good... but I'm going to hazard a guess you're trying to assign the output of the sprintf, but you need to tell it to evaluate the expression otherwise it'll just go and assign that lot as a massive string starting with sprintf?

    I know little Perl... perhaps Frank can advise but I can;t get $sn to print
    and suspected this section of the code may be at fault.

    --- Mystic BBS v1.12 A46 2020/03/12 (Windows/32)
    * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (21:1/101)
  • From mug@21:1/172 to Avon on Sunday, March 15, 2020 21:12:24
    my($sec,$min,$hour,$mday,$mon,$year) = localtime(time);
    $sn = sprintf("%04d%02d%02d%02d", $year + 1900, $mon + 1, $mday, 1)

    I am trying to get $sn to print but suspect something in this code is amiss?

    You have a syntax error in the missing semicolon on the second line. This
    code works fine on my end:

    #!/usr/bin/env perl

    my($sec,$min,$hour,$mday,$mon,$year) = localtime(time);
    $sn = sprintf("%04d%02d%02d%02d", $year + 1900, $mon + 1, $mday, 1);

    print "$sn\n";

    --- Mystic BBS v1.12 A45 2020/02/18 (Linux/64)
    * Origin: The Bottomless Abyss BBS * bbs.bottomlessabyss.net (21:1/172)
  • From alterego@21:2/116 to Avon on Monday, March 16, 2020 12:09:25
    Re: Perl Question
    By: Avon to All on Sun Mar 15 2020 07:11 pm

    else{
    my($sec,$min,$hour,$mday,$mon,$year) = localtime(time);
    $sn = sprintf("%04d%02d%02d%02d", $year + 1900, $mon + 1, $mday, 1)
    }
    I am trying to get $sn to print but suspect something in this code is amiss?

    Doesnt look like anything bad to me (been a while since I've done perl).

    IE: $sn will be assigned a value (sprintf) instead of it being assigned the result of printing a value.

    But if $sn is bad, perhaps the "if" statement before the "else" is triggering the true content of the if, rather than the false?
    ...deon


    ... Predestination was doomed from the start.
    --- SBBSecho 3.10-Linux
    * Origin: I'm playing with ANSI+videotex - wanna play too? (21:2/116)
  • From mug@21:1/172 to Avon on Sunday, March 15, 2020 21:30:19
    By the way, I've done LOTS of time generation with perl in my day, and I started doing it how your code is doing it. For me it's easier to use the POSIX module and make calls to strftime() which has the same formatting
    syntax as the libc strftime() function, which is also the same syntax as the linux 'date' command.

    #!/usr/bin/env perl
    use POSIX 'strftime';
    $yyyymmdd = strftime('%Y%m%d', localtime(time));
    print $yyyymmdd . "\n";

    --- Mystic BBS v1.12 A45 2020/02/18 (Linux/64)
    * Origin: The Bottomless Abyss BBS * bbs.bottomlessabyss.net (21:1/172)
  • From Netsurge@21:4/154 to Avon on Sunday, March 15, 2020 21:39:18
    I thought that also but still could not get $sn to print in the text
    file the script generates. There's an earlier 'my' declaration of $sn further up the script that if I state a value like 'my $sn=55555;' and then run the script it prints the value but for some reason that's the only way I can get the serial generated number to show.

    Send me back the script I sent you and I'll figure out what is going on.

    |15frank |08// |15netsurge
    |07disksh0p|08!|07bbs |08% |07bbs.diskshop.ca |08% |07mystic goodness |11SciNet |03ftn hq |08% |07https://scinet-ftn.org

    --- Mystic BBS v1.12 A45 2020/02/18 (Linux/64)
    * Origin: % disksh0p!bbs % bbs.diskshop.ca % SciNet ftn hq % (21:4/154)
  • From Netsurge@21:4/154 to Avon on Sunday, March 15, 2020 21:40:52
    I know little Perl... perhaps Frank can advise but I can;t get $sn to print and suspected this section of the code may be at fault.

    There is a deceleration before that else statement that needs to be met or
    else it won't run that part of the code. That is more than likely your issue. Once you send it to me I will sort it back out for you.

    |15frank |08// |15netsurge
    |07disksh0p|08!|07bbs |08% |07bbs.diskshop.ca |08% |07mystic goodness |11SciNet |03ftn hq |08% |07https://scinet-ftn.org

    --- Mystic BBS v1.12 A45 2020/02/18 (Linux/64)
    * Origin: % disksh0p!bbs % bbs.diskshop.ca % SciNet ftn hq % (21:4/154)
  • From Netsurge@21:4/154 to alterego on Sunday, March 15, 2020 21:41:24
    But if $sn is bad, perhaps the "if" statement before the "else" is triggering the true content of the if, rather than the false?

    You are correct, that is what is happening.

    |15frank |08// |15netsurge
    |07disksh0p|08!|07bbs |08% |07bbs.diskshop.ca |08% |07mystic goodness |11SciNet |03ftn hq |08% |07https://scinet-ftn.org

    --- Mystic BBS v1.12 A45 2020/02/18 (Linux/64)
    * Origin: % disksh0p!bbs % bbs.diskshop.ca % SciNet ftn hq % (21:4/154)
  • From Sneaky@21:1/152 to Avon on Wednesday, March 18, 2020 07:29:42
    Hi Paul


    can you please send me another gal-ibbs.cfg , I must have done same thing
    wrong transfering it to the galactic dir, as my maintence doesn't like it. Thank you

    Ian S 2nd Choice Core Mystic Nz

    --- Mystic BBS v1.12 A46 2020/03/07 (Windows/32)
    * Origin: 2nd Choice Core : New Zealand (21:1/152)
  • From Avon@21:1/101 to Netsurge on Wednesday, March 18, 2020 16:20:29
    On 15 Mar 2020 at 09:40p, Netsurge pondered and said...

    I know little Perl... perhaps Frank can advise but I can;t get $sn to print and suspected this section of the code may be at fault.

    There is a deceleration before that else statement that needs to be met
    or else it won't run that part of the code. That is more than likely
    your issue. Once you send it to me I will sort it back out for you.

    frank // netsurge

    I did send it to your SciNet inbox from Agency... did you get it?

    --- Mystic BBS v1.12 A46 2020/03/12 (Windows/32)
    * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (21:1/101)
  • From Avon@21:1/101 to Sneaky on Wednesday, March 18, 2020 16:20:57
    On 18 Mar 2020 at 07:29a, Sneaky pondered and said...

    Hi Paul


    can you please send me another gal-ibbs.cfg , I must have done same thing wrong transfering it to the galactic dir, as my maintence doesn't like
    it. Thank you


    will do :)

    --- Mystic BBS v1.12 A46 2020/03/12 (Windows/32)
    * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (21:1/101)
  • From Netsurge@21:4/154 to Avon on Wednesday, March 18, 2020 08:41:10
    I did send it to your SciNet inbox from Agency... did you get it?

    Got it and sent it back to you all fixed up. I tested it and you now get a serial number.

    |15frank |08// |15netsurge
    |07disksh0p|08!|07bbs |08% |07bbs.diskshop.ca |08% |07mystic goodness |11SciNet |03ftn hq |08% |07https://scinet-ftn.org

    --- Mystic BBS v1.12 A45 2020/02/18 (Linux/64)
    * Origin: % disksh0p!bbs % bbs.diskshop.ca % SciNet ftn hq % (21:4/154)
  • From Sneaky to Avon on Thursday, March 19, 2020 07:13:00
    Avon Sn> can you please send me another gal-ibbs.cfg , I must have done same thing
    wrong transfering it to the galactic dir, as my maintence doesn't like
    it. Thank you


    will do :)

    Thank you

    Ian S 1st Choice Core Sbbs Nz

    --- MultiMail/Win32 v0.49
  • From Avon@21:1/101 to Netsurge on Thursday, March 19, 2020 18:18:03
    On 18 Mar 2020 at 08:41a, Netsurge pondered and said...

    Got it and sent it back to you all fixed up. I tested it and you now get
    a serial number.

    what was the issue Frank?

    ..and thanks :)

    --- Mystic BBS v1.12 A46 2020/03/18 (Windows/32)
    * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (21:1/101)
  • From Netsurge@21:4/154 to Avon on Thursday, March 19, 2020 01:25:40
    what was the issue Frank?

    The If statement before the else statement. Seeing as you will only be using
    it with fsxnet and not with multiple nodelists, I just removed it completely.

    |15frank |08// |15netsurge
    |07disksh0p|08!|07bbs |08% |07bbs.diskshop.ca |08% |07mystic goodness |11SciNet |03ftn hq |08% |07https://scinet-ftn.org

    --- Mystic BBS v1.12 A45 2020/02/18 (Linux/64)
    * Origin: % disksh0p!bbs % bbs.diskshop.ca % SciNet ftn hq % (21:4/154)
  • From Ratz@21:2/114 to Avon on Saturday, March 28, 2020 14:39:26
    can you please send me another gal-ibbs.cfg , I must have done same t wrong transfering it to the galactic dir, as my maintence doesn't lik it. Thank you


    will do :)


    Can you do the same for me, the one I have currently is locking up the game.

    thanks =]


    --
    |04Ratz|15

    --- Mystic BBS v1.12 A46 2020/03/18 (Windows/32)
    * Origin: Freeside BBS - Cincinnati, USA - freeside.bbs.io (21:2/114)