Variable showing up as blank in Format output. Stumped...

Discussion in 'Perl Misc' started by Zeheeba, May 3, 2005.

  1. Zeheeba

    Zeheeba Guest

    Hello Everyone.
    I have a format that is outputting a variable as empty spaces. I have
    no clue why its doing this.

    The variable causing problems is listed below:

    $revzone="$last.$net.1.10.in-addr.arpa";

    If I put the print command after this declaration I get

    43.15.1.10.in-addr.arpa

    The problem occurs when I place it in the following format:
    ___________________________________________________________
    format DEFAULTREV =
    server 10.1.99.20
    zone @<.1.10.IN-ADDR.ARPA
    $ip
    update add @<<<<<<<<<<<<< 10800 PTR @>>>>>>>>>>>>.domain.com."
    $revzone, $host
    show
    send
    ..
    ____________________________________________________________

    The first variable space after "update add" has 25 <'s in it, I
    truncated it due to the line wrapping.

    After outputting this format to a file, it looks like this:
    _____________________________________________________________
    server 10.1.99.20
    zone 15.1.10.IN-ADDR.ARPA
    update add 10800 PTR name.domain.com.
    show
    send
    ..
    _____________________________________________________________

    Does anyone know why a blank space would be left instead of the
    variable? I have never had this problem with formats before.
    Any help is appreciated.

    Regards,
    Daniel
    Zeheeba, May 3, 2005
    #1
    1. Advertising

  2. Zeheeba

    Zeheeba Guest

    I apologize for not giving details. Here they are before they are
    asked for...

    Perl version: 5.6.0-17
    OS - Yellow Dog Linux 3.0
    Zeheeba, May 3, 2005
    #2
    1. Advertising

  3. Zeheeba

    Anno Siegel Guest

    Zeheeba <> wrote in comp.lang.perl.misc:
    > Hello Everyone.
    > I have a format that is outputting a variable as empty spaces. I have
    > no clue why its doing this.
    >
    > The variable causing problems is listed below:
    >
    > $revzone="$last.$net.1.10.in-addr.arpa";
    >
    > If I put the print command after this declaration I get
    >
    > 43.15.1.10.in-addr.arpa
    >
    > The problem occurs when I place it in the following format:
    > ___________________________________________________________
    > format DEFAULTREV =
    > server 10.1.99.20
    > zone @<.1.10.IN-ADDR.ARPA
    > $ip
    > update add @<<<<<<<<<<<<< 10800 PTR @>>>>>>>>>>>>.domain.com."
    > $revzone, $host
    > show
    > send
    > .
    > ____________________________________________________________
    >
    > The first variable space after "update add" has 25 <'s in it, I
    > truncated it due to the line wrapping.
    >
    > After outputting this format to a file, it looks like this:
    > _____________________________________________________________
    > server 10.1.99.20
    > zone 15.1.10.IN-ADDR.ARPA
    > update add 10800 PTR name.domain.com.
    > show
    > send
    > .
    > _____________________________________________________________
    >
    > Does anyone know why a blank space would be left instead of the
    > variable? I have never had this problem with formats before.
    > Any help is appreciated.


    Presumably one or the other of the variables used is not defined
    when write is called. You don't show that, so we can only guess.

    Run your code under strict and warnings and follow the hints.

    Anno
    Anno Siegel, May 3, 2005
    #3
  4. Zeheeba

    Guest

    Problem solved, thanks for your help Anno. I shouldn't work on scripts
    so late at night. The variable $revzone was being declared after the
    format was being written, no wonder it wouldn't work.

    Thanks again.

    Daniel
    , May 3, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tshad

    blank cells not showing

    tshad, Jun 13, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    678
    Eliyahu Goldin
    Jun 15, 2005
  2. Ray Booysen
    Replies:
    2
    Views:
    645
    Ray Booysen
    Mar 28, 2006
  3. Sharron
    Replies:
    1
    Views:
    814
    Thomas Matthews
    Aug 19, 2003
  4. Tom
    Replies:
    2
    Views:
    418
  5. Alex Rybalov

    asp pages randomly showing as blank white pages

    Alex Rybalov, May 27, 2004, in forum: ASP General
    Replies:
    2
    Views:
    284
    Alex Rybalov
    May 27, 2004
Loading...

Share This Page